Re: chkconfig for Debian
>> Petter Reinholdtsen <petter.reinholdtsen@usit.uio.no> writes:
> (and of course, it is available on RedHat, Irix and probably a few
> others, making it a candidate for sysadm tool standardization.)
The IRIX version does a quite different (and much more sensible) thing.
$ /sbin/chkconfig verbose ; echo $?
1
$ /sbin/chkconfig xntpd ; echo $?
0
IRIX's "registry" is /etc/config/
$ cat /etc/config/xntpd
on
$ cat /etc/config/verbose
off
It's quite simplistic. /etc/rc2.d/NNxntpd links to /etc/init.d/xntpd,
which uses chkconfig to check if it should start or not. IOW, the
links in /etc/rcN.d determine the runlevels, the contents of
/etc/config/flag determine if the service should actually start or not.
Something like:
/etc/init.d/myservice:
if [ $action = start ] && ! chkconfig service ; then
exit 0
fi
bonus points for:
if [ $force != yes ] ; then
if [ $action = start ] && ! chkconfig service ; then
exit 0
fi
fi
that is, allow for '/etc/init.d/myservice start' to work even if the
configuration says it shouldn't, e.g., '/etc/init.d/myservice --force
start'.
This merges nicely with that whereami|guessnet|netenv thread.
--
Marcelo | This signature was automatically generated with
mmagallo@debian.org | Signify v1.07. For this and other cool products,
| check out http://www.debian.org/
Reply to: