Freeswitch init via SystemD on Debian Unstable

I ran into an issue when I upgraded my Debian unstable box to systemd. I have FreeSWITCH on this box and the systemd initiation is not working.


Dec 14 18:05:44 mail systemd[1]: freeswitch.service: Start operation timed out. Terminating.
Dec 14 18:05:48 mail systemd[1]: Failed to start freeswitch.
Dec 14 18:05:48 mail systemd[1]: freeswitch.service: Unit entered failed state.
Dec 14 18:05:48 mail systemd[1]: freeswitch.service: Failed with result 'timeout'.
Dec 14 18:05:48 mail systemd[1]: freeswitch.service: Service hold-off time over, scheduling restart.
Dec 14 18:05:48 mail systemd[1]: Stopped freeswitch.
Dec 14 18:05:48 mail systemd[1]: Starting freeswitch...
Dec 14 18:05:50 mail systemd[1]: freeswitch.service: PID file /run/freeswitch/freeswitch.pid not readable (yet?) after start: No such file or directory

After much research and trial and error, I finally found the solution. I had to change the PIDFile statement of the freeswitch.service file.


[Unit]
Description=freeswitch
After=syslog.target network.target local-fs.target

[Service]
; service
Type=forking
;PIDFile=/run/freeswitch/freeswitch.pid
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
;PermissionsStartOnly=true
Environment="DAEMON_OPTS=-nonat"
EnvironmentFile=-/etc/default/freeswitch
ExecStart=/usr/local/freeswitch/bin/freeswitch -u freeswitch -g freeswitch -ncwait $DAEMON_OPTS

;ExecStart=/usr/local/freeswitch/bin/freeswitch -u freeswitch -g freeswitch -ncwait -nonat -rp
TimeoutSec=45s
Restart=on-failure
; exec
WorkingDirectory=/usr/local/freeswitch
;User=freeswitch
User=root
Group=daemon
;Group=freeswitch
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
;LimitSTACK=240
LimitRTPRIO=infinity
LimitRTTIME=7000000
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007

[Install]
WantedBy=multi-user.target

Leave a Reply