Created
October 8, 2016 15:35
-
-
Save j0inty/2a62af892758d65bd2d19fa36309cf49 to your computer and use it in GitHub Desktop.
/etc/init.d/amavisd-milter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/sbin/openrc-run | |
| # Copyright 1999-2012 Gentoo Foundation | |
| # Distributed under the terms of the GNU General Public License v2 | |
| # $Id$ | |
| NAME="amavisd-milter" | |
| DAEMON="/usr/sbin/${NAME}" | |
| depend() { | |
| before postfix | |
| use logger dns sendmail | |
| need amavisd | |
| } | |
| command="${DAEMON:-/usr/sbin/amavisd-milter}" | |
| pidfile="${PIDFILE:-/run/amavis/amavisd-milter.pid}" | |
| name="Amavis Milter Daemon" | |
| description="" | |
| description_reload="Send the SIGHUP to the daemon and the process id of running daemon can be found in ${pidfile}" | |
| #required_files="${CONFIG_FILE}" | |
| command_args="${DOPTIONS:-"-D server"}" | |
| command_background="false" | |
| # onlyy need for ackground | |
| start_stop_daemon_args="--user ${RUNAS_USER} --group ${RUNAS_GROUP}" | |
| extra_started_commands="reload" | |
| #start() { | |
| # ebegin "Starting ${NAME}" | |
| # start-stop-daemon --start --quiet --exec "${DAEMON}" \ | |
| # --stdout ${LOG_FILE} --stderr ${LOG_FILE} \ | |
| # --user ${RUNAS_USER} --group ${RUNAS_GROUP} \ | |
| # --pidfile "${PIDFILE}" -- ${DOPTIONS} | |
| # eend $? "Failed to start ${NAME}" | |
| #} | |
| # | |
| #stop() { | |
| # ebegin "Stopping ${NAME}" | |
| # start-stop-daemon --stop --name "${NAME}" | |
| # eend $? "Failed to stop ${NAME}" | |
| #} | |
| restart() { | |
| svc_stop | |
| # needed to avoid potential mi_stop errors | |
| sleep 4 | |
| svc_start | |
| } | |
| start_pre() { | |
| # Creating the pid file directory | |
| checkpath --directory --owner ${RUNAS_USER}:${RUNAS_GROUP} --mode 0775 "$(dirname "${PIDFILE}")" | |
| # Creating the temp directory | |
| checkpath --directory --owner ${RUNAS_USER}:${RUNAS_GROUP} --mode 0777 "$(dirname "${AM_TMP}")" | |
| if [ ${DEBUG_LEVEL} -gt 0 ]; then | |
| command_args="${command_args} -d${DEBUG_LEVEL}" | |
| fi | |
| } | |
| start_post() { | |
| # only get the path to file from ${SOCKET} if "local:" or "unix:" | |
| checkpath --file --mode 0777 ${SOCKET##*:} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment