Right now kamailio.service is available in pkg/kamailio/fedora/17 but not in pkg/kamailio/deb. With both Ubuntu and Debian switched to systemd it would make sense to unify packaging and use .service for deb packages as well.
In addition to give users chance to better test this before next LTS release it might make sense to add builds for ubuntu 15.04 too.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/294
I've spent some time on a debian jessie host, adapting a systemd script I've been using (please see below).
Some notes: - As you probably know, sh_installinit already takes care of installing a .service file found in the debian folder, so it's sufficient to remove the kamailio.init and add the kamailio.service file. - After dh_installinit, you should add dh_systemd_enable and dh_systemd_start (both provided by 'dh-systemd' package) - The script has some default values, but those variables can be overwritten by the variables in /etc/default/kamailio (I made this in order not to deviate too much in respect to the current approach of the init.d script).
I hope this helps, and I'm available for any question or to perform specific tests.
``` [Unit] Description=Kamailio (OpenSER) - the Open Source SIP Server After=syslog.target network.target
[Service] Type=forking Environment='PIDFILE=/var/run/kamailio/kamailio.pid' Environment='CFGFILE=/etc/kamailio/kamailio.cfg' Environment='SHM_MEMORY=64' Environment='PKG_MEMORY=8' Environment='USER=kamailio' Environment='GROUP=kamailio' Environment='DAEMON=/usr/sbin/kamailio' EnvironmentFile=/etc/default/kamailio PIDFile=$PIDFILE # ExecStart requires a full absolute path ExecStart=/usr/sbin/kamailio -P $PIDFILE -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP ExecStopPost=/bin/rm -f $PIDFILE Restart=on-abort
[Install] WantedBy=multi-user.target ```
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/294#issuecomment-138590939
Don't forget to build out unit files for systemd-rtc-server as well.
For Fedora 22, I use the following: https://messinet.com/rpms/browser/kamailio/kamailio.service https://messinet.com/rpms/browser/kamailio/kamailio.sysconfig
For EL7, I use the same sysconfig file, but the service unit is is adapted, and a tmpfiles.d snippet is used, as systemd-208 doesn't have support for RuntimeDirectory: https://messinet.com/rpms/browser/kamailio/kamailio.service.208 https://messinet.com/rpms/browser/kamailio/kamailio.tmpfiles.208
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/294#issuecomment-138877860
Note: when #293 is implemented units could be simplified further.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/294#issuecomment-148371779
https://wiki.debian.org/Teams/pkg-systemd/Packaging
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/294#issuecomment-151666272
Closed #294 via 112406d8fa05b5d739bdf06565b77e3974200652.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/294#event-453786717
FTR I didn't had time to actually check the kamailio.service file. This is WIP but the debian package should provide both sysv and systemd
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/294#issuecomment-153511283