diff options
author | schmonz <schmonz@pkgsrc.org> | 2007-02-27 00:18:46 +0000 |
---|---|---|
committer | schmonz <schmonz@pkgsrc.org> | 2007-02-27 00:18:46 +0000 |
commit | de351f22789e3bc31971cec5214516542421f8aa (patch) | |
tree | f91dc46010bec010e38d5be3cf2294173559c982 /mail/tmda/files | |
parent | 352d0068f90b6a38f48128b9c25581a5610527fd (diff) | |
download | pkgsrc-de351f22789e3bc31971cec5214516542421f8aa.tar.gz |
Improve interface to tofmipd rc.d script, akin to that of qmail-run.
Now one sets the host and port in rc.conf with tofmipd_tcp{host,port}
(default "localhost:8025") and manages logging with tofmipd_log
(default: "YES", to syslog) and friends. tofmipd_flags is still
useful for authentication and miscellaneous other options.
Bump PKGREVISION.
Diffstat (limited to 'mail/tmda/files')
-rwxr-xr-x | mail/tmda/files/tofmipd.sh | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/mail/tmda/files/tofmipd.sh b/mail/tmda/files/tofmipd.sh index e39d900e302..e3466a39bac 100755 --- a/mail/tmda/files/tofmipd.sh +++ b/mail/tmda/files/tofmipd.sh @@ -1,18 +1,34 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: tofmipd.sh,v 1.2 2004/06/10 16:33:40 schmonz Exp $ +# $NetBSD: tofmipd.sh,v 1.3 2007/02/27 00:18:46 schmonz Exp $ # # PROVIDE: mail # REQUIRE: LOGIN +name="tofmipd" + +# User-settable rc.conf variables and their default values: +: ${tofmipd_tcphost:="localhost"} +: ${tofmipd_tcpport:="8025"} +: ${tofmipd_log:="YES"} +: ${tofmipd_logcmd:="logger -t nb${name} -p mail.info"} +: ${tofmipd_nologcmd:="@CAT@ >/dev/null"} + . /etc/rc.subr -name="tofmipd" -rcvar=$name +rcvar=${name} command="@PREFIX@/bin/tmda-ofmipd" -command_args="-b" command_interpreter="@PYTHONBIN@" +start_precmd="tofmipd_precmd" + +tofmipd_precmd() +{ + checkyesno tofmipd_log || tofmipd_logcmd=${tofmipd_nologcmd} + command="@SETENV@ - ${command} ${tofmipd_flags} -p ${tofmipd_tcphost}:${tofmipd_tcpport} -f -L 2>&1 | @SU@ -m tofmipd -c '${tofmipd_logcmd}'" + command_args="&" + rc_flags="" +} load_rc_config $name run_rc_command "$1" |