# [[pianod|Pianod Support]] #
## [[Launching pianod at boot]] ##
### Mac OS X ###
If you haven't done so yet, you'll want to first make [[build pianod|Building Pianod]] and [[configure pianod|Configuring pianod]]. To make troubleshooting easier, only set up launch at login or launch at boot after you have pianod running from the command line and configured.
#### Launching at Login ####
Rather than launch at boot, it's easier to set up OS X to launch at login.
With Finder, in your home (named for you) folder, open Library. If you don't see Library, hold Option and click Finder's "Go" menu; Library should appear in there.
Inside Library, create a folder named LaunchAgents.
Using your favorite texte editor, create com.deviousfish.pianod.plist in LaunchAgents with the document below. TextEdit can be used for this, but you must set Format->Make Plain Text mode.
'''pianod launchd.plist for OS X 10.5 or later'''
```
Label
com.deviousfish.pianod
ProgramArguments
/usr/local/bin/pianod
RunAtLoad
KeepAlive
```
pianod should now launch automatically next time you login. You can start it now with this Terminal command:
launchctl load ~/Library/LaunchAgents/com.deviousfish.pianod.plist
'''Customizing Launch Configuration'''
If you want to collect logs from pianod, use this template instead. You will need to update the locations of the log files.
```
Label
com.deviousfish.pianod
ProgramArguments
/usr/local/bin/pianod
RunAtLoad
KeepAlive
StandardOutPath
/Users/your_username/Logs/pianod.log
StandardErrorPath
/Users/your_username/Logs/pianod.log
```
#### Launch at Boot ####
In r129 and later, use the same plist file above but install it in /Library/LaunchDaemons/com.deviousfish.pianod.plist. pianod recognizes that it is invoked as root, and will use /etc/pianod.startscript and /etc/pianod.passwd as the startscript and userdata file. After establishing the listener socket (allowing it to used a reserved, well-known port) pianod will drop its root privileges by changing to user 'nobody'.
#### Launching at Boot, r128 and earlier ####
To launch at boot, as administrator (sudo vi or such) create /Library/LaunchDaemons/com.deviousfish.pianod.plist:
```
Label
com.deviousfish.pianod
ProgramArguments
/usr/local/bin/pianod
-i/etc/pianod.startscript
-u/etc/pianod.passwd
RunAtLoad
KeepAlive
UserName
nobody
```
Pianod will run as a standard-privilege user; see [[Configuring pianod]] for instructions on creating the startscript and userdata file.