Move chown of /etc/freeswitch/tls to postinst

Doing a chown of something in /etc/ as part of a systemd service file
is totally broken.  It's far too large a sledgehammer to point at /etc
here.  Someone may legitimately not be using /etc/freeswitch/tls in
his configuration, in which case this chown would fail and cause FS to
fail to start.  Or someone may legitimately need /etc/freeswitch/tls
to have different ownership, in which case we would clobber it here.

The right thing to do is to create this directory in the
postinst (which we already are, assuming there is not an existing
configuration) and then perform the chown of it at the same time.

FS-7697
This commit is contained in:
Travis Cross 2015-09-22 04:53:23 +00:00
parent 12e90ce989
commit 16d0538fb5
2 changed files with 1 additions and 2 deletions

View File

@ -8,8 +8,6 @@ After=syslog.target network.target local-fs.target
; service
Type=forking
PIDFile=/run/freeswitch/freeswitch.pid
PermissionsStartOnly=true
ExecStartPre=/bin/chown freeswitch:freeswitch /etc/freeswitch/tls
ExecStart=/usr/bin/freeswitch -ncwait -nonat
TimeoutSec=45s
Restart=always

View File

@ -31,6 +31,7 @@ case "$1" in
done
if [ ! -d "/etc/freeswitch" ]; then
mkdir -p /etc/freeswitch/tls/
chown freeswitch:freeswitch /etc/freeswitch/tls
cp -a /usr/share/freeswitch/conf/vanilla/* /etc/freeswitch/
fi
;;