Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 14, 2008, 11:00 PM   #1
stakis
macrumors member
 
Join Date: Oct 2007
Creating a command that starts when OS X boots

Hey all,

I haven never done this before so I'd like some help

I'm looking to have Terminal load and run a command and the quit when OS X boots... kinda like a start up app..

is there any way this can be done?

please if you can give me a detailed instruction that would be great!!!

Thanks again!!!
stakis is offline   0 Reply With Quote
Old Apr 15, 2008, 12:30 AM   #2
HiRez
macrumors 601
 
HiRez's Avatar
 
Join Date: Jan 2004
Location: Western US
Probably someone can provide you with more details, but start by reading up on launchd, which is what OS X uses to do such things. You might also be able to run an AppleScript, but I think all startup processes have to run with root privileges. Also check out Lingon, which is a free GUI application to help you create and manage launchd processes.
__________________
Go outside, the graphics are amazing!
HiRez is offline   0 Reply With Quote
Old Apr 15, 2008, 12:32 AM   #3
Cybix
macrumors 6502a
 
Cybix's Avatar
 
Join Date: Feb 2006
Location: Western Australia
Send a message via AIM to Cybix Send a message via Skype™ to Cybix
you could use a cron.

@reboot userid /path/to/app
__________________
Inverted Reality - apple, linux, r/c, tech
leopardtricks.com - Leopard tips and tricks!
visit the kitchenmac site www.kitchenmac.com
Cybix is offline   0 Reply With Quote
Old Apr 15, 2008, 12:35 AM   #4
DoFoT9
macrumors P6
 
DoFoT9's Avatar
 
Join Date: Jun 2007
Location: Singapore
Send a message via AIM to DoFoT9 Send a message via MSN to DoFoT9 Send a message via Skype™ to DoFoT9
out of curiosity...

that would only start once the user has logged in?? or can you put it at the OS level and it starts after the rest of the computer has loaded??

e.g. can you have it load while still at the login window?
__________________
Official MacRumors IRC @ irc.krono.net #macrumors (Or http://kewlirc.net:9090/)
2012 2.5GHz Mac Mini Dual - 16GB RAM
Win8 PC - i5-3570k - 16GB RAM - SSD
DoFoT9 is offline   0 Reply With Quote
Old Apr 15, 2008, 03:01 AM   #5
Mac_Max
macrumors 6502
 
Join Date: Mar 2004
Follow this guide to make your shell script (shell referring to the terminal), and then use the Login Items section in the Accounts Preference Pane to start it at boot.
Mac_Max is offline   0 Reply With Quote
Old Apr 15, 2008, 04:14 PM   #6
HiRez
macrumors 601
 
HiRez's Avatar
 
Join Date: Jan 2004
Location: Western US
Quote:
Originally Posted by Mac_Max View Post
Follow this guide to make your shell script (shell referring to the terminal), and then use the Login Items section in the Accounts Preference Pane to start it at boot.
But that won't run the script at boot, only at login time, for a particular user (unless they added some option for this in Leopard I'm not aware of). The OP said they wanted to run it at boot time.
__________________
Go outside, the graphics are amazing!
HiRez is offline   0 Reply With Quote
Old Apr 15, 2008, 08:30 PM   #7
bloomberg
macrumors newbie
 
Join Date: Sep 2007
I'm a recent switcher so there may be a better (read faster) way. It takes a few steps to create a startup script under osx.
  • Create a directory under /Library/StartupItems/yourscript
  • Create a *.plist file for your script in yourscript dir that defines your script parameters
  • Create a startup script in yourscript dir (it may also stop & restart)
Read about the details here. As someone who uses linux I certainly appreciate why it's done this way. However, a simple helper script to generate the most common cases would be nice instead of copying and pasting every time. Good luck!
bloomberg is offline   0 Reply With Quote
Old Apr 16, 2008, 12:39 AM   #8
stakis
Thread Starter
macrumors member
 
Join Date: Oct 2007
Hey all thanks for the help... managed to get it done!!!
stakis is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iPhone: iPhone 4 starts then after 5 seconds turns off then automatically starts up again etc Iphix iOS 6 0 Jul 27, 2013 06:33 AM

Forum Jump

All times are GMT -5. The time now is 01:53 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC