added init scripts

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@885 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 19 years ago
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 $?
}

@ -21,15 +21,17 @@ DEPEND=">=media-libs/spandsp-0.0.4_pre18
>=dev-lang/python-2.4.4-r4"
src_compile () {
if [ -x ./configure ]; then
econf
fi
if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
emake PREFIX=/usr RELEASE=${PVR} || die "emake failed"
fi
if [ -x ./configure ]; then
econf
fi
if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
emake PREFIX=/usr RELEASE=${PVR} || die "emake failed"
fi
}
src_install () {
emake PREFIX=/usr cfg-target="/etc/sems/" DESTDIR="${D}" install || die
newinitd "${FILESDIR}"/sems.rc6 sems
newconfd "${FILESDIR}"/sems.confd sems
dodoc README
}

Loading…
Cancel
Save