opsi/net-misc/opsipxeconfd/files/opsipxeconfd.initd
Mario Fetka 49447607cb Bump
Package-Manager: portage-2.2.0_alpha166
RepoMan-Options: --force
2013-04-16 22:14:13 +02:00

50 lines
1.2 KiB
Plaintext

#!/sbin/runscript
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
OPSIPXECONFDCONFIG=/etc/opsi/opsipxeconfd.conf
OPSIPXECONFDPROGRAM=/usr/bin/opsipxeconfd
[ -x $OPSIPXECONFDPROGRAM ] || exit 0
OPSIPXECONFDCONFIG_OPT=""
[ ! -z $OPSIPXECONFDCONFIG -a -f $OPSIPXECONFDCONFIG ] && OPSIPXECONFDCONFIG_OPT="-c $OPSIPXECONFDCONFIG"
USER=root
LOGDIR=/var/log/opsi/opsipxeconfd
PIDDIR=/var/run/opsipxeconfd
LIBDIR=/var/lib/opsipxeconfd
PIDFILE=${PIDDIR}/opsipxeconfd.pid
depend() {
need opsiconfd
}
start() {
# Make sure files are writable
[ ! -e ${LOGDIR} ] && mkdir -p ${LOGDIR}
chown -R ${USER} ${LOGDIR}
[ ! -e ${LIBDIR} ] && mkdir -p ${LIBDIR}
chown -R ${USER} ${LIBDIR}
[ ! -e ${PIDDIR} ] && mkdir -p ${PIDDIR}
chown -R ${USER} ${PIDDIR}
ebegin "Starting opsi pxe config service"
start-stop-daemon --start \
--user ${USER} \
--pidfile ${PIDFILE} \
--exec ${OPSIPXECONFDPROGRAM} -- -D ${OPSIPXECONFDCONFIG_OPT} ${OPSIPXECONFD_OPTIONS}
eend $?
}
stop() {
ebegin "Stopping opsi pxe config service"
start-stop-daemon --stop \
--pidfile ${PIDFILE} \
--exec ${OPSIPXECONFDPROGRAM} -- ${OPSIPXECONFDCONFIG_OPT}
eend $?
}