]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Use systemd RuntimeDirectory for /run/freeswitch
authorTravis Cross <tc@traviscross.com>
Tue, 22 Sep 2015 04:23:20 +0000 (04:23 +0000)
committerTravis Cross <tc@traviscross.com>
Tue, 22 Sep 2015 05:50:41 +0000 (05:50 +0000)
This changes how we create the temporary directory /run/freeswitch
when starting FS with systemd.  The /run directory starts empty after
a system reboot, so we need to ensure this directory is present.

As part of systemd.exec(5), systemd provides a mechanism to
automatically manage these directories under /run and to bind their
lifetime to the lifetime of the process.

This commit moves to using the RuntimeDirectory= mechanism and removes
the obsolete ExecStartPre/mkdir code.

FS-7130

debian/freeswitch-systemd.freeswitch.service

index c96f1c2b3faa7ba06ea5431bc6ab540f0a74f25c..688af6a5aebde5b1a5db2b28b3a09d8ec28abdc9 100644 (file)
@@ -9,12 +9,12 @@ After=syslog.target network.target local-fs.target
 Type=forking
 PIDFile=/run/freeswitch/freeswitch.pid
 PermissionsStartOnly=true
-ExecStartPre=/bin/mkdir -p /run/freeswitch
-ExecStartPre=/bin/chown freeswitch:freeswitch /run/freeswitch
 ExecStart=/usr/bin/freeswitch -ncwait -nonat
 TimeoutSec=45s
 Restart=always
 ; exec
+RuntimeDirectory=freeswitch
+RuntimeDirectoryMode=0755
 WorkingDirectory=/run/freeswitch
 User=freeswitch
 Group=freeswitch