diff options
Diffstat (limited to 'net-proxy/c-icap/files/c-icap.init.3')
-rw-r--r-- | net-proxy/c-icap/files/c-icap.init.3 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/net-proxy/c-icap/files/c-icap.init.3 b/net-proxy/c-icap/files/c-icap.init.3 new file mode 100644 index 000000000000..4a3e0269bae1 --- /dev/null +++ b/net-proxy/c-icap/files/c-icap.init.3 @@ -0,0 +1,27 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +: ${configfile:=/etc/c-icap/c-icap.conf} + +get_config() { + local value=$(awk '$1 == "'$1'" { print $2 }' ${configfile}) + echo ${value:-$2} +} + +command="/usr/libexec/c-icap" +command_arguments="${EXTRA_OPTS} -f ${configfile}" +pidfile=$(get_config PidFile /var/run/c-icap/c-icap.pid) + +depend() { + need localmount + config ${configfile} + [ "$(get_config Logger file_logger)" = "sys_logger" ] && use logger +} + +start_pre() { + local cmdsocket=$(get_config CommandsSocket /var/run/c-icap/c-icap.ctl) + + checkpath -d "$(dirname "${cmdsocket}")" "$(dirname "${pidfile}")" +} |