Merge pull request #244 in FS/freeswitch from ~ARTURZ/freeswitch:FS-7495-systemd-centos7 to master
* commit 'a1fe44a8b149f5b34eb0ff694dfa83bc0e7888b0': FS-7495 Add systemd unit configuration file for CentOS 7
This commit is contained in:
commit
928f973500
|
@ -0,0 +1 @@
|
||||||
|
d /run/freeswitch 0750 freeswitch daemon -
|
|
@ -0,0 +1,17 @@
|
||||||
|
[Unit]
|
||||||
|
Description=FreeSWITCH
|
||||||
|
After=syslog.target network.target
|
||||||
|
After=postgresql.service postgresql-9.3.service postgresql-9.4.service mysqld.service httpd.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=freeswitch
|
||||||
|
EnvironmentFile=-/etc/sysconfig/freeswitch
|
||||||
|
# RuntimeDirectory is not yet supported in CentOS 7. A workaround is to use /etc/tmpfiles.d/freeswitch.conf
|
||||||
|
#RuntimeDirectory=/run/freeswitch
|
||||||
|
#RuntimeDirectoryMode=0750
|
||||||
|
WorkingDirectory=/run/freeswitch
|
||||||
|
ExecStart=/usr/bin/freeswitch -nc -nf $FREESWITCH_PARAMS
|
||||||
|
ExecReload=/usr/bin/kill -HUP $MAINPID
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -1670,8 +1670,14 @@ cd ../..
|
||||||
%if 0%{?suse_version} > 100
|
%if 0%{?suse_version} > 100
|
||||||
%{__install} -D -m 744 build/freeswitch.init.suse %{buildroot}/etc/rc.d/init.d/freeswitch
|
%{__install} -D -m 744 build/freeswitch.init.suse %{buildroot}/etc/rc.d/init.d/freeswitch
|
||||||
%else
|
%else
|
||||||
|
%if "%{?_unitdir}" == ""
|
||||||
# On RedHat like
|
# On RedHat like
|
||||||
%{__install} -D -m 0755 build/freeswitch.init.redhat %{buildroot}/etc/rc.d/init.d/freeswitch
|
%{__install} -D -m 0755 build/freeswitch.init.redhat %{buildroot}/etc/rc.d/init.d/freeswitch
|
||||||
|
%else
|
||||||
|
# systemd
|
||||||
|
%{__install} -Dpm 0644 build/freeswitch.service %{buildroot}%{_unitdir}/freeswitch.service
|
||||||
|
%{__install} -Dpm 0644 build/freeswitch-tmpfiles.conf %{buildroot}%{_tmpfilesdir}/freeswitch.conf
|
||||||
|
%endif
|
||||||
%endif
|
%endif
|
||||||
# On SuSE make /usr/sbin/rcfreeswitch a link to /etc/rc.d/init.d/freeswitch
|
# On SuSE make /usr/sbin/rcfreeswitch a link to /etc/rc.d/init.d/freeswitch
|
||||||
%if 0%{?suse_version} > 100
|
%if 0%{?suse_version} > 100
|
||||||
|
@ -1723,9 +1729,18 @@ fi
|
||||||
|
|
||||||
chown freeswitch:daemon /var/log/freeswitch /var/run/freeswitch
|
chown freeswitch:daemon /var/log/freeswitch /var/run/freeswitch
|
||||||
|
|
||||||
|
%if "%{?_unitdir}" == ""
|
||||||
chkconfig --add freeswitch
|
chkconfig --add freeswitch
|
||||||
|
%else
|
||||||
|
%tmpfiles_create freeswitch
|
||||||
|
/usr/bin/systemctl -q enable freeswitch.service
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%preun
|
||||||
|
%{?systemd_preun freeswitch.service}
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
|
%{?systemd_postun freeswitch.service}
|
||||||
######################################################################################################################
|
######################################################################################################################
|
||||||
#
|
#
|
||||||
# On uninstallation get rid of the freeswitch user
|
# On uninstallation get rid of the freeswitch user
|
||||||
|
@ -1794,7 +1809,12 @@ fi
|
||||||
######################################################################################################################
|
######################################################################################################################
|
||||||
%config(noreplace) %attr(0644,-,-) %{HTDOCSDIR}/*
|
%config(noreplace) %attr(0644,-,-) %{HTDOCSDIR}/*
|
||||||
%ifos linux
|
%ifos linux
|
||||||
|
%if "%{?_unitdir}" == ""
|
||||||
/etc/rc.d/init.d/freeswitch
|
/etc/rc.d/init.d/freeswitch
|
||||||
|
%else
|
||||||
|
%{_unitdir}/freeswitch.service
|
||||||
|
%{_tmpfilesdir}/freeswitch.conf
|
||||||
|
%endif
|
||||||
%config(noreplace) /etc/sysconfig/freeswitch
|
%config(noreplace) /etc/sysconfig/freeswitch
|
||||||
%if 0%{?suse_version} > 100
|
%if 0%{?suse_version} > 100
|
||||||
/usr/sbin/rcfreeswitch
|
/usr/sbin/rcfreeswitch
|
||||||
|
@ -2482,6 +2502,8 @@ fi
|
||||||
#
|
#
|
||||||
######################################################################################################################
|
######################################################################################################################
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jul 09 2015 - Artur Zaprzała
|
||||||
|
- add systemd service file for CentOS 7
|
||||||
* Thu Jun 25 2015 - s.safarov@gmail.com
|
* Thu Jun 25 2015 - s.safarov@gmail.com
|
||||||
- Dependencies of mod_shout were declared
|
- Dependencies of mod_shout were declared
|
||||||
* Mon Jun 22 2015 - krice@freeswitch.org
|
* Mon Jun 22 2015 - krice@freeswitch.org
|
||||||
|
|
Loading…
Reference in New Issue