Search
j0ke.net Open Build Service
>
Projects
>
internetx
:
projects
:
mail
>
nullmailer
> nullmailer.init
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File nullmailer.init of Package nullmailer
#!/bin/bash # # nullmailer MTA # # chkconfig: - 85 15 # description: nullmailer centos init @iceburg_net ### BEGIN INIT INFO # Provides: smtpdaemon # Required-Start: $local_fs $network # Required-Stop: $local_fs $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: # Description: ### END INIT INFO # Source function library. . /etc/init.d/functions RETVAL=0 prog=nullmailer exec=/usr/sbin/nullmailer-send lockfile=/var/lock/subsys/$prog run_as=nullmail logfile=/var/log/nullmailer/nullmailer.log # Source config if [ -f /etc/sysconfig/$prog ] ; then . /etc/sysconfig/$prog fi start() { [ -x $exec ] || exit 5 echo -n "Starting $prog: " PIDS=`pidof -c $exec` if [ -z "$PIDS" ]; then # modified to use a double-fork technique in absence of start-stop-daemon... runuser -s /bin/bash $run_as -c "((exec $exec >> $logfile 2>&1)&)" RETVAL=$? else echo -n "$prog is already running" RETVAL=1 fi [ $RETVAL -eq 0 ] && touch $lockfile && success || failure echo return $RETVAL } stop() { echo -n "Stopping $prog: " PIDS=`pidof -c $exec` if [ -n "$PIDS" ]; then killall $exec return $? else echo -n "$prog is not running" RETVAL=1 fi [ $RETVAL -eq 0 ] && rm -f $lockfile && success || failure echo return $RETVAL } status() { echo -n "status not supported " return 0 } case "$1" in start) start ;; stop) stop ;; status) status ;; restart) stop start ;; *) echo "Usage: $NAME {start|stop|status|restart}" exit 1 ;; esac exit $?