How to exceute a shell script when FreeBSD start

Hi guys, I have been looking for information on the forums to execute a shell script when FreeBSD starts or after a reboot, but I have not managed to do it. Can someone help with that? A link to another topic or a explain it a little.

Kind regards.
 
A common method is to start a script using /etc/rc.local (does not exist by default) or using cron with the @reboot time. If you want to go more low-level. you can use a start script in /usr/local/etc/rc.d (look there for examples), using /etc/rc.conf for settings.
 
lastofme said:
Hi guys, I have been looking for information on the forums to execute a shell script when FreeBSD starts or after a reboot, but I have not managed to do it. Can someone help with that? A link to another topic or a explain it a little.
What type of script do you want execute? If it's a user-specified you can use ~/.profile, ~/.cshrc, ~/.login files.
 
Or, if it's for a desktop, the ~/.xinitrc (xinit, startx) or ~/.xsession (xdm, gdm, etc.) might be suitable.
 
Back
Top