wok annotate dovecot/stuff/init.d/dovecot @ rev 22506

updated asterisk-sound-fr (1.4.16 -> 1.6.1)
author Hans-G?nter Theisgen
date Wed Jan 01 13:38:34 2020 +0100 (2020-01-01)
parents 0d8a1a3edc72
children 1c049ccf6c26
rev   line source
erjo@12043 1 #!/bin/sh
al@19159 2 # /etc/init.d/dovecot : Start, stop and restart Dovecotserver on SliTaz, at
erjo@12043 3 # boot time or with the command line.
erjo@12043 4 #
erjo@12043 5 # To start SSH server at boot time, just put dovecot in the $RUN_DAEMONS
erjo@12043 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
erjo@12043 7 #
erjo@12043 8 . /etc/init.d/rc.functions
erjo@12043 9 . /etc/daemons.conf
erjo@12043 10
erjo@12043 11 NAME=dovecot
al@19159 12 DESC="$(_ '%s daemon' Dovecot)"
erjo@12043 13 DAEMON=/usr/sbin/dovecot
erjo@12043 14 OPTIONS=$dovecot_OPTIONS
erjo@12060 15 PIDFILE=/var/run/dovecot/master.pid
erjo@12043 16
pascal@16681 17 if [ ! -d /var/run/dovecot ]; then
pascal@16681 18 mkdir -p /var/run/dovecot
pascal@16681 19 chown dovecot.dovecot /var/run/dovecot
pascal@16681 20 fi
erjo@12043 21 case "$1" in
erjo@12043 22 start)
erjo@12043 23 if active_pidfile $PIDFILE dovecot ; then
al@19159 24 _ '%s is already running.' $NAME
erjo@12043 25 exit 1
erjo@12043 26 fi
al@19159 27 action 'Starting %s: %s...' "$DESC" $NAME
erjo@12043 28 $DAEMON $OPTIONS
erjo@12043 29 status
erjo@12043 30 ;;
erjo@12043 31 stop)
erjo@12043 32 if ! active_pidfile $PIDFILE dovecot ; then
al@19159 33 _ '%s is not running.' $NAME
erjo@12043 34 exit 1
erjo@12043 35 fi
al@19159 36 action 'Stopping %s: %s...' "$DESC" $NAME
al@19159 37 kill $(cat $PIDFILE)
erjo@12043 38 status
erjo@12043 39 ;;
erjo@12043 40 restart)
erjo@12043 41 if ! active_pidfile $PIDFILE dovecot ; then
al@19159 42 _ '%s is not running.' $NAME
erjo@12043 43 exit 1
erjo@12043 44 fi
al@19159 45 action 'Restarting %s: %s...' "$DESC" $NAME
al@19159 46 kill $(cat $PIDFILE)
erjo@12043 47 sleep 2
erjo@12043 48 $DAEMON $OPTIONS
erjo@12043 49 status
erjo@12043 50 ;;
erjo@12043 51 *)
al@19159 52 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
al@19159 53 newline
erjo@12043 54 exit 1
erjo@12043 55 ;;
erjo@12043 56 esac
erjo@12043 57
erjo@12043 58 exit 0