An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Previous Thread
Next Thread
Print Thread
Run bash script as root on boot?
#18913 11/04/11 05:13 PM
Joined: Nov 2011
OP Offline

Joined: Nov 2011
Greetings,

As this is my first post in this amazing forum, I would like to give a hearty HELLO! This looks like it will be a great resource while I learn the ways of internal MacOSX.

How do I run an SH script as root every time I boot the computer?

I have experience with Ubuntu, so this task is something I would normally do with Cron, but it seems the Mac way is to use LaunchD, however I can't seem to make my script run. Anyone have experience with this?

Thanks in advanced!
-HackZeMac

Re: Run bash script as root on boot?
HackZeMac #18915 11/04/11 08:56 PM
Joined: Sep 2009
Offline

Joined: Sep 2009
Originally Posted By: HackZeMac
it seems the Mac way is to use LaunchD, however I can't seem to make my script run.

I assume that you've run the script manually (as root), and that part all works perfectly well... and so the only hangup here occurs when it's supposed to auto-run via launchd. Right?

If such is the case, then we would need to see the following :
  1. your entire plist (e.g., via cat)
  2. a listing showing owner/group and full pathname location of your plist (e.g., via ls)
  3. any system.log messages from launchd that appear at the time when your plist was read but refused to run.



Last edited by Hal Itosis; 11/04/11 09:00 PM.
Re: Run bash script as root on boot?
HackZeMac #19088 11/11/11 09:12 PM
Joined: Aug 2009
Offline

Joined: Aug 2009
/etc/rc.shutdown.local

runs at shutdown. I have "Self-Destruct Sequence - Activated!" from the old game of Descent play. That ought to get 'em nice and wound up at the TSA gate heh...

http://vftp.net/virtual1/temp/MFIF/shutdown%20sound/

I've never played around to see if /etc/rc.startup.local is honored in OS X, it's possible I suppose. Shutdown works on at least 10.6.


I work for the Department of Redundancy Department

Moderated by  alternaut, dkmarsh, joemikeb 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.4.33 Page Time: 0.373s Queries: 20 (0.016s) Memory: 0.5766 MB (Peak: 0.6326 MB) Data Comp: Zlib Server Time: 2024-04-25 11:44:47 UTC
Valid HTML 5 and Valid CSS