Subject: Re: Howto start services with rc.d scripts?
To: Ralf Schmitt <>
From: Jeremy C. Reed <>
List: tech-pkg
Date: 11/02/2005 08:48:09
On Wed, 2 Nov 2005, Ralf Schmitt wrote:

> I've installed mail/courier-imap and would like to have it start 
> automatically on reboot (this isn't a netbsd box, it's a debian machine, 
> which had a lot of outdated packages installed, and has been brought back to 
> life thanks to pkgsrc. great work!).
> I have
> courierimap="YES"
> authdaemond="YES"
> in /etc/rc.conf and can start imap with /etc/rc.d/courierimap
> /etc/rc.d/ also contains DAEMON, LOGIN, etc.
> How should I start my /etc/rc.d scripts?

I assume you have /etc/rc.subr already in place. If not install it (from 
pkgtools/rc.subr or wip/rc.subr) and copy into place.

And install sysutils/rcorder.

Then have one of your Debian startup scripts (/etc/init.d/whatever) with 
symlink for your runlevel run something like:

umask 022
. /etc/rc.subr
. /etc/rc.conf
files=$(rcorder -s nostart ${rc_rcorder_flags} /etc/rc.d/*)
for _rc_elem in $files; do
# debugging for now, maybe add an option for this
echo Running script \"$_rc_elem start\"
         run_rc_script $_rc_elem start

(That is basically what I use on my PkgLinux boxes. I have a package that 
provides this using CONF_FILES_PERMS. I have not imported this package 
anywhere yet.)

  Jeremy C. Reed

  	  	 	 technical support & remote administration