mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-15 13:58:32 +00:00
Use systemd RuntimeDirectory for /run/freeswitch
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. Originally for the FS systemd unit we created /run/freeswitch using ExecStartPre and mkdir. With commitadb5f0dthis was changed to use the tmpfiles.d(5) mechanism (but the ExecStartPre/mkdir code was not removed). 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 is actually what we want here as compared to the more general tmpfiles.d(5) mechanism. This commit moves to using the RuntimeDirectory= mechanism and removes the obsolete ExecStartPre/mkdir code. References-commit:adb5f0d278
This commit is contained in:
1 parent
e7e79c213d
commit
12e90ce989
4 files changed
+2
-8
No files matched your search
+2
-2
@@ -9,13 +9,13 @@ 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
|
||||
ExecStartPre=/bin/chown freeswitch:freeswitch /etc/freeswitch/tls
|
||||
ExecStart=/usr/bin/freeswitch -ncwait -nonat
|
||||
TimeoutSec=45s
|
||||
Restart=always
|
||||
; exec
|
||||
RuntimeDirectory=freeswitch
|
||||
RuntimeDirectoryMode=0755
|
||||
WorkingDirectory=/var/log/freeswitch
|
||||
User=freeswitch
|
||||
Group=freeswitch
|
||||
|
||||
Reference in new issue
Block a user