diff options
author | plunky <plunky> | 2009-10-14 21:13:41 +0000 |
---|---|---|
committer | plunky <plunky> | 2009-10-14 21:13:41 +0000 |
commit | 17a0d70d5fc5b234258171fa24a38c07c6eea5d3 (patch) | |
tree | fcf44a9d43b072a7fa246c16e6aede84346a5093 /mail/nullmailer/files | |
parent | cdcab48dcce94472333ef6442edca9327e2f7b23 (diff) | |
download | pkgsrc-17a0d70d5fc5b234258171fa24a38c07c6eea5d3.tar.gz |
fix the DESTDIR support by removing the install-root target which
would otherwise cause a chown of the trigger file. (with DESTDIR,
the "nullmail" user & group are not yet created)
Because this leaves the trigger file possibly owned by root, add
a test in the rc "start" path to [re]make it when necessary.
put this test and the daemon background and logging into a
separate script so that it can be run by the rc framework as the
nullmail user in the normal way, and add a procname argument to
allow the "status" and "stop" rc commands to work properly.
bump PKGREVISION
Diffstat (limited to 'mail/nullmailer/files')
-rw-r--r-- | mail/nullmailer/files/nullmailer-daemon | 13 | ||||
-rw-r--r-- | mail/nullmailer/files/nullmailer.sh | 13 |
2 files changed, 16 insertions, 10 deletions
diff --git a/mail/nullmailer/files/nullmailer-daemon b/mail/nullmailer/files/nullmailer-daemon new file mode 100644 index 00000000000..468b146cf9c --- /dev/null +++ b/mail/nullmailer/files/nullmailer-daemon @@ -0,0 +1,13 @@ +#!/bin/sh +# +# ensure that the trigger fifo exists and we own it, then start up +# nullmailer-send with logging and detach + +trigger="@VARBASE@/spool/nullmailer/trigger" + +if [ ! -p ${trigger} -o ! -O ${trigger} -o ! -G ${trigger} ]; then + rm -f ${trigger} + mkfifo -m 0600 ${trigger} +fi + +@PREFIX@/libexec/nullmailer/nullmailer-send 2>&1 | logger -t nullmailer -p mail.info & diff --git a/mail/nullmailer/files/nullmailer.sh b/mail/nullmailer/files/nullmailer.sh index cccf19ff943..b03682f50f3 100644 --- a/mail/nullmailer/files/nullmailer.sh +++ b/mail/nullmailer/files/nullmailer.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: nullmailer.sh,v 1.3 2009/10/11 10:22:51 plunky Exp $ +# $NetBSD: nullmailer.sh,v 1.4 2009/10/14 21:13:41 plunky Exp $ # # PROVIDE: mail # REQUIRE: LOGIN @@ -12,20 +12,13 @@ fi name="nullmailer" rcvar=${name} required_files="@PKG_SYSCONFDIR@/nullmailer/remotes" -required_files="${required_files} @VARBASE@/spool/nullmailer/trigger" required_dirs="@VARBASE@/spool/nullmailer/queue @VARBASE@/spool/nullmailer/tmp" -command="@PREFIX@/libexec/nullmailer/nullmailer-send" -start_cmd="nullmailer_start" +command="@PREFIX@/libexec/nullmailer/nullmailer-daemon" +procname="@PREFIX@/libexec/nullmailer/nullmailer-send" nullmailer_user="@NULLMAILER_USER@" nullmailer_group="@NULLMAILER_GROUP@" -nullmailer_start() -{ - - ${command} 2>&1 | logger -t ${name} -p mail.info & -} - if [ -f /etc/rc.subr ]; then load_rc_config $name run_rc_command "$1" |