diff --git a/debian/ngcp-sems.default b/debian/ngcp-sems.default index f20d72b0..e6aa008e 100644 --- a/debian/ngcp-sems.default +++ b/debian/ngcp-sems.default @@ -1,27 +1,18 @@ # configuration for SEMS - SIP Express Media Server # -# this file is sourced by SEMS init script /etc/init.d/sems-pbx - -# Note: the #DEBCONF-xxx-START and DEBCONF-xxx-END lines are used for -# debconf configuration, please don't remove or alter them. +# this file is sourced by SEMS init script /etc/init.d/ngcp-sems # Don't start with default config as we need to deploy the ngcp-templates first SEMS_RUN="no" # ser configuration file -#DEBCONF-CFG_FILE-START SEMS_CFG_FILE="/etc/ngcp-sems/sems.conf" -#DEBCONF-CFG_FILE-END # user to run ser as -#DEBCONF-USER-START SEMS_USER="sems" -#DEBCONF-USER-END # group to run ser as -#DEBCONF-GROUP-START -SEMS_GROUP="sems-pbx" -#DEBCONF-GROUP-END +SEMS_GROUP="sems" SEMS_RUNDIR="/var/run/ngcp-sems" @@ -29,11 +20,9 @@ SEMS_RUNDIR="/var/run/ngcp-sems" SEMS_PIDFILE="$SEMS_RUNDIR/ngcp-sems.pid" # set if you want to create core files -#DEBCONF-CREATE_CORE-START SEMS_CREATE_CORE="yes" -#DEBCONF-CREATE_CORE-END -#DEBCONF-COREDIR-START SEMS_COREDIR="/var/cores" -#DEBCONF-COREDIR-END +SEMS_CACHEDIR="/var/cache/ngcp-sems" +SEMS_CACHEDIR_EXTRADIRS="audio_cache callingcard" diff --git a/debian/ngcp-sems.dirs b/debian/ngcp-sems.dirs index 685a6998..505ccf27 100644 --- a/debian/ngcp-sems.dirs +++ b/debian/ngcp-sems.dirs @@ -1 +1,3 @@ var/cache/ngcp-sems +var/cache/ngcp-sems/audio_cache +var/cache/ngcp-sems/callingcard diff --git a/debian/ngcp-sems.init b/debian/ngcp-sems.init index 4e360121..aa637c57 100644 --- a/debian/ngcp-sems.init +++ b/debian/ngcp-sems.init @@ -10,6 +10,7 @@ # Short-Description: Start/stop SEMS Application Server ### END INIT INFO +SEMS_CACHEDIR="/var/cache/ngcp-sems" # read configuration from /etc/default/ngcp-sems file if test -f /etc/default/ngcp-sems ; then @@ -29,10 +30,20 @@ DESC=ngcp-sems PARAMS="" +if ! test -d $SEMS_CACHEDIR ; then + mkdir -p $SEMS_CACHEDIR +fi + +for dir in $SEMS_CACHEDIR_EXTRADIRS ; do + if ! test -d ${SEMS_CACHEDIR}/${dir} ; then + mkdir -p ${SEMS_CACHEDIR}/${dir} + fi +done + if ! test -d $SEMS_RUNDIR ; then - mkdir $SEMS_RUNDIR + mkdir -p $SEMS_RUNDIR fi -chown $SEMS_USER:$SEMS_GROUP $SEMS_RUNDIR +chown -R $SEMS_USER:$SEMS_GROUP $SEMS_RUNDIR $SEMS_CACHEDIR if test "$SEMS_PIDFILE" ; then PARAMS="$PARAMS -P $SEMS_PIDFILE"