Startup & Login

Revised: 2014-01-27 richard

Class Videos

March 28th, 2008

September 19th, 2008

Mac Managers presentations:

startup/login/logout items - February 19th, 2003 (still applicable)

launchd - June 15th, 2005 (still applicable)

Class notes

cron
/etc/crontab

crontab -e
/var/at/tabs

machinit.d
mach_init_per_user.d

/Library/StartupItems
/System/Library/StartupItems

StartupParameters.plist
/etc/hostconfig
/etc/rc.common

Increased security - it wont work without correct permissions

Create one - have it log something, and try say something

StartServerice ()
{
    date >> /Users/bla/Desktop/log
    while [ 1 -eq 1 ]; do
        say hi
        sleep 5
    done
}
StopService ()
{
    killall sh
}

SystemStarter start Test
SystemStarter stop Test

/Library/LaunchDaemons
/System/Library/LaunchDaemons
no gui

/Library/LaunchAgents
/System/Library/LaunchAgents
uses gui

man launchd
man launchd.plist

launchctl list
launchctl load
launchctl unload


Loginhook
Logouthook
/var/root/Library/Preferences/com.apple.loginwindow.plist
<key>LoginHook</key>
<string>/path</string>
<key>LogoutHook</key>
<string>/path</string>

Running things before loginwindow shows up
/etc/rc.local in 10.4