wok-next annotate busybox/stuff/inetd @ rev 3272
leafpad: Add chinese name and comment to leafpad.desktop
author | Chen Yufei <tsjz@ymail.com> |
---|---|
date | Tue Jun 02 12:41:43 2009 +0800 (2009-06-02) |
parents | 73595cae4a67 |
children |
rev | line source |
---|---|
pascal@620 | 1 #!/bin/sh |
pascal@620 | 2 # /etc/init.d/inetd: Start, stop and restart Inet deamon on SliTaz, at boot |
pascal@620 | 3 # time or with the command line. |
pascal@620 | 4 # |
pascal@620 | 5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS |
pascal@620 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf. |
pascal@620 | 7 # |
pascal@620 | 8 . /etc/init.d/rc.functions |
pascal@620 | 9 . /etc/daemons.conf |
pascal@620 | 10 |
pascal@620 | 11 NAME=Inetd |
pascal@620 | 12 DESC="inetd deamon" |
pascal@620 | 13 DAEMON=/usr/sbin/inetd |
pascal@620 | 14 OPTIONS=$INETD_OPTIONS |
pascal@620 | 15 PIDFILE=/var/run/inetd.pid |
pascal@620 | 16 |
pascal@620 | 17 case "$1" in |
pascal@620 | 18 start) |
pascal@2397 | 19 if active_pidfile $PIDFILE inetd ; then |
pascal@620 | 20 echo "$NAME already running." |
pascal@620 | 21 exit 1 |
pascal@620 | 22 fi |
pascal@620 | 23 echo -n "Starting $DESC: $NAME... " |
pascal@620 | 24 $DAEMON $OPTIONS |
pascal@620 | 25 status |
pascal@620 | 26 ;; |
pascal@620 | 27 stop) |
pascal@2397 | 28 if ! active_pidfile $PIDFILE inetd ; then |
pascal@620 | 29 echo "$NAME is not running." |
pascal@620 | 30 exit 1 |
pascal@620 | 31 fi |
pascal@620 | 32 echo -n "Stopping $DESC: $NAME... " |
pascal@620 | 33 kill `cat $PIDFILE` |
pascal@620 | 34 status |
pascal@620 | 35 ;; |
pascal@620 | 36 restart) |
pascal@2397 | 37 if ! active_pidfile $PIDFILE inetd ; then |
pascal@620 | 38 echo "$NAME is not running." |
pascal@620 | 39 exit 1 |
pascal@620 | 40 fi |
pascal@620 | 41 echo -n "Restarting $DESC: $NAME... " |
pascal@620 | 42 kill `cat $PIDFILE` |
pascal@620 | 43 sleep 2 |
pascal@620 | 44 $DAEMON $OPTIONS |
pascal@620 | 45 status |
pascal@620 | 46 ;; |
pascal@620 | 47 *) |
pascal@620 | 48 echo "" |
pascal@620 | 49 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" |
pascal@620 | 50 echo "" |
pascal@620 | 51 exit 1 |
pascal@620 | 52 ;; |
pascal@620 | 53 esac |
pascal@620 | 54 |
pascal@620 | 55 exit 0 |