[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Daemontools



hi,

sorry for me to participate this thread that late,
i just want to throw in my 2cent ;)

On Tue, Jan 30, 2001 at 07:51:31PM -0500, Adam McKenna wrote:
> > Why not /etc/service?
> 
> I'm using /var/lib/svscan but I'm open to suggestions on this.  The directory
> should only be holding symlinks, so it's pretty unimportant where it goes.
yes, but that directory is holding _system configuration_ and thus should go
into /etc

> > > this probably makes it difficult to start/stop services from /etc/init.d 
> > > - perhaps it'd be better not to use svscan at all, and use init scripts 
> > > to start supervise manually on a given directory, and then start/stop 
> > > would use 'svc' to control the service. is this how it's done currently?
> 
> Yes, this is how it should be done.  That way, people can use familiar
> /etc/init.d/package scripts to control the service instead of having to learn
> daemontools.  (Not that daemontools is especially hard to learn, but most
> people are lazy.)

i don't think so

if you want /etc/init.d/service to work, do something like:
---
service=$(basename $0)
test -d /etc/$service || exit 0
set -e
case "$1" in
  start)
	echo -n "Starting $service: "
	svc -u /etc/$service
	echo "$service."
	;;
  stop)
	echo -n "Stopping $service: "
	svc -d /etc/$service
	echo "$service."
	;;
  reload)
	svc -h /etc/$service
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo 'Usage: $0 {start|stop|reload|restart}'
	exit 1
esac

exit 0
---
and create a symlink to this script for every /etc/init.d/service
(above script not tested, but should work with little modifications)


if you want to be able to have several runlevels,
use several services directories
you can add several inittab entries for svscan, one for
each runlevel/directory
(/etc/svcX.d?, or even /etc/rcX.d, as daemontools ignores regular files,
and /etc/init.d/rc ignores everything not starting with [SK], and
all service names should be lowercase)
when using /etc/rcX.d, one would have all startup configuration in the
same place, which is really what the user wants :)


if you want update-rc to work with daemontools, make it work ;)

-- 
CU,		  / Friedrich-Alexander University Erlangen, Germany
Martin Waitz	//  [Tali on IRCnet]  [tali.home.pages.de] _________
______________/// - - - - - - - - - - - - - - - - - - - - ///
dies ist eine manuell generierte mail, sie beinhaltet    //
tippfehler und ist auch ohne grossbuchstaben gueltig.   /

Attachment: pgp0BIETI9mne.pgp
Description: PGP signature


Reply to: