Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Auto Restart



Hi Lunetta,

I think Apple migrated away from crontab and inetd on 10.4 in favour of
launchd though crontabs can still be made to work.

for comparison, here is a launchd plist which accomplishes the shutdown
you want 


to install it, copy the attached file into the directory 

/System/Library/LaunchDaemons

and give it the same access and user/group as the other plists there,
then it'll be read at each boot.

+ in terminal, type

sudo launchctl load /System/Library/LaunchDaemons/daily_reboot.plist

to make launchd notice the new task 


(The plist needs the AbandonProcessGroup and ExitTimeOut settings in
order that launchd doesn't interfere with the shutdown process when the
main shutdown forks and exits immediately - normally launchd would cull
child processes after 20 seconds)




Yours 


Richard





----[ daily_reboot.plist ] ----

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
	<key>AbandonProcessGroup</key>
	<true/>
	<key>ExitTimeOut</key>
	<integer>0</integer>
	<key>GroupName</key>
	<string>wheel</string>
	<key>Label</key>
	<string>daily_reboot</string>
	<key>Program</key>
	<string>/sbin/shutdown</string>
	<key>ProgramArguments</key>
	<array>
		<string>/sbin/shutdown</string>
		<string>-r</string>
		<string>+10</string>
	</array>
	<key>ServiceDescription</key>
	<string>Reboot the server periodically</string>
	<key>StartCalendarInterval</key>
	<dict>
		<key>Hour</key>
		<integer>3</integer>
		<key>Minute</key>
		<integer>30</integer>
	</dict>
	<key>UserName</key>
	<string>root</string>
</dict>
</plist>





On Tue, 2008-03-04 at 14:36 -0800, Lunetta, Laura wrote:
> Hello All,
> 
> In 10.3, I used to have a crontab which restarted my servers every
> evening. However, something seems to have changed in 10.4—how can I
> have my servers restart on a regular basis in 10.4?
> 
> Thanks,
> 
> Laura. 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Macos-x-server mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/macos-x-server/email@hidden
> 
> This email sent to email@hidden

Attachment: daily_reboot.plist
Description: application/xml

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/email@hidden

This email sent to email@hidden

References: 
 >Auto Restart (From: "Lunetta, Laura" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.