mirror of https://github.com/sipwise/sems.git
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@885 8eb893ce-cfd4-0310-b710-fb5ebe64c474sayer/1.4-spce2.6
parent
4fe1476791
commit
b71eecb0c4
@ -0,0 +1,24 @@
|
||||
# /etc/conf.d/sems: config file for /etc/init.d/sems
|
||||
|
||||
# sems configuration file
|
||||
#SEMS_CFG_FILE="/etc/sems/sems.conf"
|
||||
|
||||
# user to run sems as
|
||||
#SEMS_USER="sems"
|
||||
|
||||
# group to run sems as
|
||||
#SEMS_GROUP="sems"
|
||||
|
||||
# sems pidfile
|
||||
#SEMS_PIDFILE="/var/run/sems.pid"
|
||||
|
||||
# set to true if you want to create core files
|
||||
#SEMS_CREATE_CORE="true"
|
||||
|
||||
# path to use for core files
|
||||
#SEMS_COREDIR="/var/cores"
|
||||
|
||||
# must be absolute path
|
||||
#SEMS_BINARY="/usr/sbin/sems"
|
||||
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
#!/sbin/runscript
|
||||
#
|
||||
|
||||
depend() {
|
||||
use logger dns
|
||||
need net
|
||||
}
|
||||
|
||||
SEMS_CFG_FILE=${SEMS_CFG_FILE:-/etc/sems/sems.conf}
|
||||
SEMS_PIDFILE=${SEMS_PIDFILE:-/var/run/sems.pid}
|
||||
SEMS_CREATE_CORE=${SEMS_CREATE_CORE:-true}
|
||||
SEMS_COREDIR=${SEMS_COREDIR:-/var/core}
|
||||
SEMS_BINARY=${SEMS_BINARY:-/usr/sbin/sems}
|
||||
|
||||
checkconfig() {
|
||||
if [ ! -f "${SEMS_CFG_FILE}" ] ; then
|
||||
eerror "You need a "${SEMS_CFG_FILE}" file to run sems"
|
||||
return 1;
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
start() {
|
||||
local myopts=""
|
||||
|
||||
[ "${SEMS_USER}" != "" ] && \
|
||||
myopts="${myopts} -u ${SEMS_USER}"
|
||||
|
||||
[ "${SEMS_GROUP}" != "" ] && \
|
||||
myopts="${myopts} -g ${SEMS_GROUP}"
|
||||
|
||||
|
||||
checkconfig || return 1
|
||||
|
||||
if test "$SEMS_CREATE_CORE" = "true" ; then
|
||||
# directory for the core dump files
|
||||
[ -d $SEMS_COREDIR ] || mkdir $SEMS_COREDIR
|
||||
chmod 777 $SEMS_COREDIR
|
||||
echo "$SEMS_COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
|
||||
ulimit -c unlimited
|
||||
fi
|
||||
|
||||
ebegin "Starting ${SVCNAME}"
|
||||
start-stop-daemon --start --exec "${SEMS_BINARY}" \
|
||||
--pidfile "${SEMS_PIDFILE}" \
|
||||
-- \
|
||||
-f "${SEMS_CFG_FILE}" \
|
||||
${myopts}
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
if [ "${RC_CMD}" = "restart" ] ; then
|
||||
checkconfig || return 1
|
||||
fi
|
||||
|
||||
ebegin "Stopping ${SVCNAME}"
|
||||
start-stop-daemon --stop --exec "${SEMS_BINARY}" \
|
||||
--pidfile "${SEMS_PIDFILE}" --quiet
|
||||
eend $?
|
||||
}
|
||||
Loading…
Reference in new issue