summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-proxy/havp/files/havp.initd')
-rw-r--r--net-proxy/havp/files/havp.initd24
1 files changed, 9 insertions, 15 deletions
diff --git a/net-proxy/havp/files/havp.initd b/net-proxy/havp/files/havp.initd
index cfdec6eda99d..44b00fcd0fbe 100644
--- a/net-proxy/havp/files/havp.initd
+++ b/net-proxy/havp/files/havp.initd
@@ -14,15 +14,6 @@ get_havp_opt() {
}
checkconfig() {
- if [ ! -d /var/run/havp ] && ! mkdir -p /var/run/havp; then
- eeror "Failed to create /var/run/havp"
- return 1
- fi
- if [ ! -d /var/tmp/havp ] && ! mkdir /var/tmp/havp; then
- eeror "Failed to create /var/tmp/havp"
- return 1
- fi
-
if [ ! -f /etc/havp/havp.config ] ; then
eerror "No /etc/havp/havp.config file exists!"
return 1
@@ -40,17 +31,20 @@ checkconfig() {
eerror "${HAVP_GROUP} group is missing!"
return 1
fi
-
- chown -R "${HAVP_USER:-havp}:${HAVP_GROUP:-havp}" /var/run/havp /var/tmp/havp /var/log/havp && \
- chmod -R 0755 /var/run/havp &&
- chmod -R 0750 /var/tmp/havp
}
start() {
checkconfig || return 1
- ebegin "Starting HTTP AntiVirus proxy"
+ checkpath --directory \
+ --owner "${HAVP_USER:-havp}:${HAVP_GROUP:-havp}" --mode 0755 /run/havp
+ checkpath --directory \
+ --owner "${HAVP_USER:-havp}:${HAVP_GROUP:-havp}" --mode 0700 /var/log/havp
+ checkpath --directory \
+ --owner "${HAVP_USER:-havp}:${HAVP_GROUP:-havp}" --mode 0750 /var/tmp/havp
+
+ ebegin "Starting HTTP AntiVirus Proxy"
start-stop-daemon --start --exec /usr/sbin/havp > /dev/null
eend $?
}
@@ -59,7 +53,7 @@ stop() {
local HAVP_PIDFILE
get_havp_opt PIDFILE
- ebegin "Stopping HTTP AntiVirus proxy"
+ ebegin "Stopping HTTP AntiVirus Proxy"
start-stop-daemon --stop --pidfile=${HAVD_PIDFILE:-/var/run/havp/havp.pid}
eend $?
}