Merge pull request #542 in FS/freeswitch from ~SSINYAGIN/freeswitch:bugfix/FS-7910-systemd-service-ignores-etc-default-freeswitch to master

* commit 'b2bcc8b2dd449cbe30bdfc5428e36171762cbd3e':
  FS-8194 FS-7910 FS-7937 systemd service improvements
This commit is contained in:
William King 2015-10-10 16:45:18 -05:00
commit 42ef181e7c
7 changed files with 40 additions and 10 deletions

10
debian/bootstrap.sh vendored
View File

@ -1324,8 +1324,14 @@ for x in postinst postrm preinst prerm; do
cp -a freeswitch.$x freeswitch-all.$x
done
cp -a freeswitch-doc.docs freeswitch-all.docs
#cp -a freeswitch-systemd.freeswitch.service freeswitch-all.freeswitch.service
cp -a freeswitch-sysvinit.freeswitch.default freeswitch-all.freeswitch.default
cp -a freeswitch-systemd.freeswitch.service freeswitch-all.freeswitch.service
cp -a freeswitch-systemd.freeswitch.tmpfile freeswitch-all.freeswitch.tmpfile
cp -a freeswitch-systemd.freeswitch.default freeswitch-all.freeswitch.default
cp -a freeswitch-systemd.freeswitch.default freeswitch-sysvinit.freeswitch.default
# TODO: FS-7928 need to add a condition and skip this for jessie and onward
cp -a freeswitch-sysvinit.freeswitch.init freeswitch-all.freeswitch.init
echo "Generating additional lintian overrides..." >&2

View File

@ -8,14 +8,14 @@ After=syslog.target network.target local-fs.target
; service
Type=forking
PIDFile=/run/freeswitch/freeswitch.pid
ExecStart=/usr/bin/freeswitch -ncwait -nonat
Environment="DAEMON_OPTS=-nonat"
EnvironmentFile=-/etc/default/freeswitch
ExecStart=/usr/bin/freeswitch -u freeswitch -g freeswitch -ncwait ${DAEMON_OPTS}
TimeoutSec=45s
Restart=always
; exec
RuntimeDirectory=freeswitch
RuntimeDirectoryMode=0755
User=freeswitch
Group=freeswitch
User=root
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
@ -28,5 +28,27 @@ CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007
; 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.
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1 @@
d /var/run/freeswitch 0755 freeswitch freeswitch - -

View File

@ -1 +0,0 @@
/lib/systemd/system/freeswitch.service

View File

@ -37,6 +37,9 @@ case "$1" in
mkdir -p /etc/freeswitch/tls/
chown freeswitch:freeswitch /etc/freeswitch/tls
fi
if [ -x /bin/systemctl -a x`systemctl is-enabled freeswitch` != "xenabled" ]; then
systemctl enable freeswitch
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;

3
debian/rules vendored
View File

@ -98,12 +98,11 @@ override_dh_strip:
override_dh_auto_install:
dh_auto_install
dh_auto_install -- -C libs/esl pymod-install
mkdir -p debian/tmp/lib/systemd/system
install -m0644 debian/freeswitch-systemd.freeswitch.service debian/tmp/lib/systemd/system/freeswitch.service
rm -f debian/tmp/usr/share/freeswitch/grammar/model/communicator/COPYING
override_dh_installinit:
dh_installinit -pfreeswitch-sysvinit --name=freeswitch
dh_installinit -pfreeswitch-systemd --name=freeswitch
dh_installinit -pfreeswitch-all --name=freeswitch
override_dh_makeshlibs: