2012-02-23 20:03:09 -05:00
|
|
|
;;;;; Author: Travis Cross <tc@traviscross.com>
|
|
|
|
|
|
|
|
[Unit]
|
|
|
|
Description=freeswitch
|
2019-01-16 16:44:19 -05:00
|
|
|
Wants=network-online.target
|
2019-01-25 17:14:27 -05:00
|
|
|
Requires=network.target local-fs.target
|
|
|
|
After=network.target network-online.target local-fs.target
|
2012-02-23 20:03:09 -05:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
; service
|
|
|
|
Type=forking
|
|
|
|
PIDFile=/run/freeswitch/freeswitch.pid
|
2019-03-12 14:13:19 -04:00
|
|
|
Environment="DAEMON_OPTS=-nonat"
|
2019-02-05 11:59:54 -05:00
|
|
|
Environment="USER=freeswitch"
|
|
|
|
Environment="GROUP=freeswitch"
|
2015-10-09 09:30:14 -04:00
|
|
|
EnvironmentFile=-/etc/default/freeswitch
|
2019-02-05 11:59:54 -05:00
|
|
|
ExecStartPre=/bin/chown -R ${USER}:${GROUP} /var/lib/freeswitch /var/log/freeswitch /etc/freeswitch /usr/share/freeswitch /var/run/freeswitch
|
2019-03-12 14:13:19 -04:00
|
|
|
ExecStart=/usr/bin/freeswitch -u ${USER} -g ${GROUP} -ncwait ${DAEMON_OPTS}
|
2012-02-23 20:03:09 -05:00
|
|
|
TimeoutSec=45s
|
|
|
|
Restart=always
|
|
|
|
; exec
|
2019-03-12 14:13:19 -04:00
|
|
|
;User=${USER}
|
|
|
|
;Group=${GROUP}
|
2012-02-23 20:03:09 -05:00
|
|
|
LimitCORE=infinity
|
|
|
|
LimitNOFILE=100000
|
|
|
|
LimitNPROC=60000
|
2016-05-25 09:27:12 -04:00
|
|
|
LimitSTACK=250000
|
2012-02-23 20:03:09 -05:00
|
|
|
LimitRTPRIO=infinity
|
2016-10-20 11:57:26 -04:00
|
|
|
LimitRTTIME=infinity
|
2012-02-23 20:03:09 -05:00
|
|
|
IOSchedulingClass=realtime
|
|
|
|
IOSchedulingPriority=2
|
|
|
|
CPUSchedulingPolicy=rr
|
|
|
|
CPUSchedulingPriority=89
|
|
|
|
UMask=0007
|
2019-01-16 16:44:19 -05:00
|
|
|
NoNewPrivileges=false
|
2012-02-23 20:03:09 -05:00
|
|
|
|
2015-10-09 09:30:14 -04:00
|
|
|
; alternatives which you can enforce by placing a unit drop-in into
|
|
|
|
; /etc/systemd/system/freeswitch.service.d/*.conf:
|
|
|
|
;
|
|
|
|
; User=freeswitch
|
|
|
|
; Group=freeswitch
|
|
|
|
; ExecStart=
|
|
|
|
; ExecStart=/usr/bin/freeswitch -ncwait -nonat -rp
|
|
|
|
;
|
|
|
|
; empty ExecStart is required to flush the list.
|
|
|
|
;
|
|
|
|
; if your filesystem supports extended attributes, execute
|
|
|
|
; setcap 'cap_net_bind_service,cap_sys_nice=+ep' /usr/bin/freeswitch
|
|
|
|
; this will also allow socket binding on low ports
|
|
|
|
;
|
|
|
|
; otherwise, remove the -rp option from ExecStart and
|
|
|
|
; add these lines to give real-time priority to the process:
|
|
|
|
;
|
|
|
|
; PermissionsStartOnly=true
|
|
|
|
; ExecStartPost=/bin/chrt -f -p 1 $MAINPID
|
|
|
|
;
|
|
|
|
; execute "systemctl daemon-reload" after editing the unit files.
|
|
|
|
|
2012-02-23 20:03:09 -05:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|