]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Move chown of /etc/freeswitch/tls to postinst
authorTravis Cross <tc@traviscross.com>
Tue, 22 Sep 2015 04:53:23 +0000 (04:53 +0000)
committerTravis Cross <tc@traviscross.com>
Tue, 22 Sep 2015 04:58:50 +0000 (04:58 +0000)
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

debian/freeswitch-systemd.freeswitch.service
debian/freeswitch.postinst

index ac24c49a3e147b50ae817d3baa692fcc06892aae..8713ce2531bdc8728f86178fe1bc2052cc130266 100644 (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
index 38f33b1797cf14e1f4501d79ec4608eaa5ef7127..b19277fe8be932aa6007957aa63c38684734b3c8 100644 (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
     ;;