![]() ![]() A copy of the script from Geekarist's answer is given below. You may choose a different name.Ĭreate a file named Startup.sh in My Agent application's Contents/Resources folder. (If this folder does not exist, then create the folder.) Here, I will name the application "My Agent". Save the application to your ~/Applications folder. do shell script quoted form of (POSIX path of (path to me) & "Contents/Resources/Startup.sh") Use the Script Editor application to create a application containing the line given below. If the script exits with a non-zero status, then the application shows a popup window with an error message. Wrapping the script in an application also allows the user to customize privacy settings. AppleScript was chosen over a workflow, because the Script Editor application does not overwrite manual changes made to an applications ist file, where as the Automator application does. Here, the script is wrapped in an AppleScript application. This answer explains how to run a command on at login and is based on Geekarist's answer. To get rid of the item simply replace load in the above command with unload. As a bonus, launchd will monitor it and, if it exits for any reason, it will be re-started. This will cause launchd to load the item which will cause it to start MongoDB on boot. ![]() Save this in /Library/LaunchAgents/ (you will need an administrator account and/or sudo), then open a terminal and do: sudo launchctl load /Library/LaunchAgents/ This is an XML file, so you can do it with your favourite text editor or alternatively you can use the Property List Editor that's installed with the Mac OS X Dev Tools. ![]() If you don't want to use Lingon, you need to create a launchd Property List. To run a command on start up on OS X, you need to use launchd. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |