summaryrefslogtreecommitdiff
path: root/mail/courier-authlib-vchkpw/files
diff options
context:
space:
mode:
authorOliver Lehmann <oliver@FreeBSD.org>2005-03-15 19:41:41 +0000
committerOliver Lehmann <oliver@FreeBSD.org>2005-03-15 19:41:41 +0000
commit10eea892ddb3b6ebdb06833bfc950d02c6635c48 (patch)
tree61c394acdd9c61261f5eed70ec286dc9dd184ba0 /mail/courier-authlib-vchkpw/files
parentNote that recent Quake2-LNX is fixed. (diff)
- stop creatng /var/run/authdaemond during the package installation
- create /var/run/authdaemond within the rc.subr Script in case the directory doesn't exist. - Bump PORTREVISION Suggested By: brooks
Notes
Notes: svn path=/head/; revision=131330
Diffstat (limited to 'mail/courier-authlib-vchkpw/files')
-rw-r--r--mail/courier-authlib-vchkpw/files/courier-authdaemond.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/mail/courier-authlib-vchkpw/files/courier-authdaemond.sh b/mail/courier-authlib-vchkpw/files/courier-authdaemond.sh
index 88c9b91fa74e..c13b5d921c40 100644
--- a/mail/courier-authlib-vchkpw/files/courier-authdaemond.sh
+++ b/mail/courier-authlib-vchkpw/files/courier-authdaemond.sh
@@ -24,7 +24,8 @@ command="%%PREFIX%%/sbin/authdaemond"
start_cmd="authdaemond_cmd start"
stop_cmd="authdaemond_cmd stop"
restart_cmd="authdaemond_cmd stop && authdaemond_cmd start"
-pidfile="/var/run/authdaemond/pid"
+rundir=/var/run/authdaemond
+pidfile="${rundir}/pid"
procname="%%PREFIX%%/sbin/courierlogger"
load_rc_config $name
@@ -32,6 +33,13 @@ load_rc_config $name
authdaemond_cmd () {
case $1 in
start)
+ if [ ! -d "${rundir}" ] ; then
+ mkdir -p -m 0750 "${rundir}" && chown %%MAILUSER%%:%%MAILGROUP%% "${rundir}"
+ if [ $? -ne 0 ] ; then
+ echo "creating ${rundir} with the correct permissions was not possible!"
+ return 1
+ fi
+ fi
echo "Starting ${name}."
${command} start
;;
@@ -39,9 +47,9 @@ authdaemond_cmd () {
echo "Stopping ${name}."
${command} stop
if [ $? -eq 0 ] ; then
- [ -f "$pidfile" ] && rm -f "$pidfile"
- [ -f "$pidfile".lock ] && rm -f "$pidfile".lock
- [ -S /var/run/authdaemond/socket ] && rm -f /var/run/authdaemond/socket
+ [ -f "${pidfile}" ] && rm -f "$pidfile"
+ [ -f "${pidfile}.lock" ] && rm -f "${pidfile}.lock"
+ [ -S "${rundir}/socket" ] && rm -f "${rundir}/socket"
return 0
fi
;;