New rc scripts?

richard at reika.demon.co.uk richard at reika.demon.co.uk
Fri Oct 20 14:09:24 PDT 2000


Misquoted from Gerard Beekmans on Fri, Oct 20, 2000 at 12:51:49PM -0400:
> 
> 
> > I was looking through the archive mailing list and re-read
> > the thread about redesigning the rc/init.d files to handle
> > error checking better.  Are these done? being worked on?
> > 
> > I was gonna start add stuff to log the output of the rc 
> > files to syslog, but wanted to wait til the above was done.
> 
> That would be the ones found in the current LFS book. They do an
> adequate error checking if I may say so. Sure they're not perfect but I
> don't want to make them hopelessly complicated so nobody will be able
> to figure them out.
> 

To add further layers of confusion to the init scripts:


1) enable and disable options in the init.d scripts
eg:

#!/bin/bash
#/etc/init.d/proftpd

#MAINTAINER: richard at reika.demon.co.uk

. /etc/init.d/functions

case "$1" in
  enable)
    ln -s  ../init.d/proftp /etc/rc0.d/K40proftpd
    ln -s  ../init.d/proftp /etc/rc1.d/K40proftpd
    ln -s  ../init.d/proftp /etc/rc2.d/K40proftpd
    ln -s  ../init.d/proftp /etc/rc3.d/S40proftpd
    ln -s  ../init.d/proftp /etc/rc4.d/S40proftpd
    ln -s  ../init.d/proftp /etc/rc5.d/S40proftpd
    ln -s  ../init.d/proftp /etc/rc6.d/K40proftpd
    ;;
  disable)
    rm -f /etc/rc?.d/[SK][0-9][0-9]proftpd
    ;;
...


2) Who you gonna blame

If I put a mistake in one of my scripts, I get a
nice message recommending I e-mail lfs-discuss...

How about putting something like this in 
/etc/init.d/rc, print_error_msg():

grep "MAINTAINER:" $i



Richard Lightman
I know there is an easier way, that way would not be so much fun.

-- 
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message




More information about the lfs-dev mailing list