Skip to content

Commit

Permalink
pkg: create /var/run/kamailio with user permissions in centos 7 spec
Browse files Browse the repository at this point in the history
(cherry picked from commit 8f407a9)
  • Loading branch information
miconda committed Apr 4, 2017
1 parent 30668ab commit 0c2a5b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/kamailio/centos/7/kamailio.init
Expand Up @@ -23,7 +23,8 @@
KAM=/usr/sbin/kamailio
KAMCFG=/etc/kamailio/kamailio.cfg
PROG=kamailio
PID_FILE=/var/run/kamailio.pid
HOMEDIR=/var/run/$PROG
PID_FILE=/var/run/$PROG/kamailio.pid
LOCK_FILE=/var/lock/subsys/kamailio
RETVAL=0
DEFAULTS=/etc/sysconfig/kamailio
Expand Down Expand Up @@ -101,6 +102,12 @@ if test "$DUMP_CORE" = "yes" ; then
echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
fi

# /var/run can be a tmpfs
if [ ! -d $HOMEDIR ]; then
mkdir -p $HOMEDIR
chown ${USER}:${GROUP} $HOMEDIR
fi

OPTIONS="-P $PID_FILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP $EXTRA_OPTIONS"


Expand Down
2 changes: 2 additions & 0 deletions pkg/kamailio/centos/7/kamailio.spec
Expand Up @@ -622,6 +622,8 @@ install -m644 pkg/kamailio/centos/%{?centos}/kamailio.sysconfig \
/usr/sbin/groupadd -r kamailio 2> /dev/null || :
/usr/sbin/useradd -r -g kamailio -s /bin/false -c "Kamailio daemon" -d \
%{_libdir}/kamailio kamailio 2> /dev/null || :
mkdir -p %{_var}/run/kamailio 2> /dev/null || :
chown kamailio:kamailio %{_var}/run/kamailio 2> /dev/null || :



Expand Down

0 comments on commit 0c2a5b7

Please sign in to comment.