First check in

This commit is contained in:
2018-06-02 14:05:50 -05:00
commit 11fd07811b
7 changed files with 238 additions and 0 deletions

52
SNAP/postfix.init Executable file
View 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