First check in
This commit is contained in:
52
SNAP/postfix.init
Executable file
52
SNAP/postfix.init
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: postfix
|
||||
# Required-Start: $syslog $local_fs $network
|
||||
# Should-Start: $remote_fs openldap saslauthd
|
||||
# Required-Stop: $network
|
||||
# Should-Stop: $remote_fs openldap saslauthd
|
||||
# Default-Start: 3 4 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
# Short-Description: Postfix MTA
|
||||
# Description: Controls the Postfix Mail Transfer Agent
|
||||
### END INIT INFO
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
BINFILE=/usr/lib/postfix/master
|
||||
PIDFILE=/var/spool/postfix/pid/master.pid
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_init_msg "Starting Postfix"
|
||||
start_daemon -p "${PIDFILE}" /usr/sbin/postfix start 2> /dev/null && \
|
||||
log_success_msg || log_failure_msg
|
||||
;;
|
||||
stop)
|
||||
log_init_msg "Stopping Postfix"
|
||||
killproc -p "${PIDFILE}" ${BINFILE} && log_success_msg || log_failure_msg
|
||||
;;
|
||||
reload)
|
||||
log_init_msg "Reloading Postfix"
|
||||
killproc -p "${PIDFILE}" ${BINFILE} -HUP && log_success_msg || \
|
||||
log_failure_msg
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
status)
|
||||
pid=$(pidofproc -p "$PIDFILE" "$BINFILE");
|
||||
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "postfix is not runing"
|
||||
else
|
||||
echo "postfix running with PID: $pid"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|reload|restart|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user