On Wednesday 12 November 2003 01:03 am, Fajar Priyanto wrote:
> Dear all,
> After abandoning effort to install esmtp, now I've installed null-mailer.
> It asked for daemontools, so I installed it too.
>
> There are 3 main programs in null-mailer:
> nullmailer-inject
> nullmailer-send
> nullmailer-queue
>
> The installation program said that I should make a script, so that
> daemontools will run nullmailer-send in background. The script is:
> #!/bin/sh
> exec setuidgid nullmail nullmailer-send 2>&1
>
> What I don't understand is, how do I run the script? Should I put it in
> rc.local or what.
Copy the script to /usr/sbin and then you can create a startup script in
/etc/init.d . I would model it after some of the others that are there to
make sure that you have a nice value set, and start and stop commands and
that it loads on the right init levels. You can use Webmin to look at your
startup and shutdown scripts and simply copy one and add the values for
nullmailer to create a startup and shutdown script for that.
Example:
#!/bin/sh
#
# nullmailer This shell script takes care of starting and stopping
# nullmailer.
#
# chkconfig: 2345 99 10
# description: nullmailer provides support for injecting mail.
[ -f /etc/nullmailer.conf ] || exit 0
. /etc/rc.d/init.d/functions
# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting nullmailer: "
touch /var/lock/subsys/nullmailer
/usr/sbin/nullmailer
echo
;;
stop)
# Stop daemons.
echo -n "Shutting down nullmailer: "
killproc nullmailer
#killall nullmailer
echo
rm -f /var/lock/subsys/nullmailer
;;
restart)
$0 stop
$0 start
;;
status)
status nullmailer
;;
*)
echo "Usage: nullmailer {start|stop|restart|status}"
exit 1
esac
exit 0
--
Bryan Phinney
Software Test Engineer
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com