diff options
Diffstat (limited to 'testing/nullmailer/nullmailer.initd')
-rw-r--r-- | testing/nullmailer/nullmailer.initd | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/testing/nullmailer/nullmailer.initd b/testing/nullmailer/nullmailer.initd index cab49d8bfc7..5d1353a072e 100644 --- a/testing/nullmailer/nullmailer.initd +++ b/testing/nullmailer/nullmailer.initd @@ -1,10 +1,11 @@ #!/sbin/openrc-run -supervisor=supervise-daemon - name=nullmailer description="Nullmailer relay-only MTA" command=/usr/sbin/nullmailer-send +command_user=nullmailer:nullmailer +command_background=true +pidfile=/run/nullmailer.pid depend() { use net logger @@ -12,27 +13,14 @@ depend() { checkconfig() { local error=0 - local f=/etc/nullmailer/me - if [ ! -s ${f} ]; then - eerror "${f} does not exist" - error=1 - fi - f=/etc/nullmailer/defaultdomain - if [ ! -s ${f} ]; then - eerror "${f} does not exist" - error=1 - fi - if [ ${error} -eq 1 ]; then - einfo "You need to run 'emerge --config nullmailer'!" - fi - if [ -e /service/nullmailer ]; then - eerror "Nullmailer is already running under svscan!" - error=2 - fi - if [ ${error} -ne 0 ]; then - return 1 - else - return 0 + local f + for f in failed queue tmp; do + install -dm 0750 -o nullmailer /var/spool/nullmailer/$f + done + local f=/var/spool/nullmailer/trigger + if [ ! -p "$f" ]; then + mkfifo -m660 "$f" + chown nullmailer:mail "$f" fi } @@ -40,6 +28,3 @@ start_pre() { checkconfig } -stop_pre() { - checkconfig # to avoid init.d stopping svscan instance -} |