# Starting a program/daemon durring boot



## kr651129 (Feb 13, 2012)

Total n00b question, but say I wrote a program that I'd like to start after my network comes up on boot.  Is there a way to do this?


----------



## monkeyboy (Feb 13, 2012)

Numerous ways to do it.:

- stick it in /etc/rc.local or (more recently) in /etc/rc.d/local
- plenty of other scripts in /etc/rc.d to stick it in depending on what run states you want to tap into. Look at /etc/netstart for hints, or look at /etc/rc.d/netif or /etc/rc.d/netoptions
- stick a shell script that starts it /usr/local/etc/rc.d (like the way Samba and apache does it)
- if it uses an IP port, you can use /etc/inetd to start it when that port is triggered


----------



## freethread (Feb 13, 2012)

I found this article useful for what *monkeyboy* referred to about rc.d
Practical rc.d scripting in BSD (rc-scripting)


----------

