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

Re: The right way to not start daemons



Hi,

  [ Optionally not starting servers on boot, with added per server
    granularity, as well as a single action to turn off all servers ]

>>"Peter" == Peter Mathiasson <peter@mathiasson.nu> writes:

 Peter> You could do something like
 Peter> if [ -e /etc/nologin ]; then
 Peter>     exit 0
 Peter> fi

======================================================================
 progname=$(basename $0)
 check_start () {
    if [ -e /etc/defaults/no_start_any_daemon ]; then
        exit 0;
    fi
    if [ -e /etc/defaults/no_start.d/$progname ]; then
       exit 0;
    fi
 }

 case "$1" in
   start)
      check_start;
      ....
      ;;
   force-start)
      ....
      ;;
   restart)
      check_start;
      ......
      ;;
   force-restart)
      ......
      ;;
   stop)
      ...
    *)
        echo "Usage: /etc/init.d/$progname  {start|stop|restart|force-restart|force-start}"
        exit 1
    ;;
esac
======================================================================

	Put this in all /etc/init.d scripts.

	manoj
--
 My haircut is totally traditional!
Manoj Srivastava   <srivasta@debian.org>  <http://www.debian.org/%7Esrivasta/>
1024R/C7261095 print CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C



Reply to: