From 16d0538fb577ecac6c28a2503415cf6e698c161d Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Tue, 22 Sep 2015 04:53:23 +0000 Subject: [PATCH] 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 --- debian/freeswitch-systemd.freeswitch.service | 2 -- debian/freeswitch.postinst | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/freeswitch-systemd.freeswitch.service b/debian/freeswitch-systemd.freeswitch.service index ac24c49a3e..8713ce2531 100644 --- a/debian/freeswitch-systemd.freeswitch.service +++ b/debian/freeswitch-systemd.freeswitch.service @@ -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 diff --git a/debian/freeswitch.postinst b/debian/freeswitch.postinst index 38f33b1797..b19277fe8b 100644 --- a/debian/freeswitch.postinst +++ b/debian/freeswitch.postinst @@ -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 ;;