Hello,
I've just installed Kamailio 4.3 on Debian 8.2, but starting kamailio does not work since Debian requires systemctl to be setup.
I've tried the below config but it didn't work (https://github.com/kamailio/kamailio/issues/294#issuecomment-138590939)
usr/local/src/kamailio# systemctl status kamailio.service â kamailio.service - Kamailio SIP Server Loaded: loaded (/etc/systemd/system/kamailio.service; disabled) Active: failed (Result: resources)
systemd[1]: [/etc/systemd/system/kamailio.service:14] Not an absolute path, ignoring: $PIDFILE systemd[1]: Failed to load environment files: No such file or directory systemd[1]: kamailio.service failed to run 'start' task: No such file or directory systemd[1]: Failed to start Kamailio SIP Server. systemd[1]: Unit kamailio.service entered failed state.
[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' 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
Does anyone have a working kamailio.service file?
Regards,
Grant
Hello,
On 21/10/15 10:20, Grant Bagdasarian wrote:
Hello,
I’ve just installed Kamailio 4.3 on Debian 8.2, but starting kamailio does not work since Debian requires systemctl to be setup.
I’ve tried the below config but it didn’t work (https://github.com/kamailio/kamailio/issues/294#issuecomment-138590939)
usr/local/src/kamailio# systemctl status kamailio.service
â kamailio.service - Kamailio SIP Server
Loaded: loaded (/etc/systemd/system/kamailio.service; disabled)
Active: failed (Result: resources)
systemd[1]: [/etc/systemd/system/kamailio.service:14] Not an absolute path, ignoring: $PIDFILE
systemd[1]: Failed to load environment files: No such file or directory
systemd[1]: kamailio.service failed to run 'start' task: No such file or directory
systemd[1]: Failed to start Kamailio SIP Server.
systemd[1]: Unit kamailio.service entered failed state.
[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'
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
Does anyone have a working kamailio.service file?
Can you try to replace:
PIDFile=$PIDFILE
with
PIDFILE=/var/run/kamailio/kamailio.pid
Cheers, Daniel
Hi,
Could you solve this? I had the same problem on Ubuntu 15 and I solved as follows:
a separate directory /var/run/kamailio for pid does not work. Because after reboot the directory is gone. One thought was to create the directory and give the necessary permission before starting the service with "ExecStart". But unfortunately systemd fails and cannot run "/bin/mkdir" to create the directory. So I come up with the following setup that works fine:
/etc/systemd/system/kamailio.service:
[Unit] Description=Kamailio (OpenSER) - the Open Source SIP Server After=syslog.target network.target
[Service] Type=forking EnvironmentFile=/etc/kamailio/kamailio.sysconfig PermissionsStartOnly=true ExecStart=/usr/local/sbin/kamailio -P /var/run/kamailio.pid $OPTIONS ExecStopPost=/bin/rm -f /var/run/kamailio.pid Restart=on-abort ; exec WorkingDirectory=/var/log/kamailio LimitCORE=infinity LimitNOFILE=100000 LimitNPROC=60000 LimitRTPRIO=infinity LimitRTTIME=7000000 IOSchedulingClass=realtime IOSchedulingPriority=2 CPUSchedulingPolicy=rr CPUSchedulingPriority=89 UMask=0007
[Install] WantedBy=multi-user.target
/etc/kamailio/kamailio.sysconfig:
OPTIONS="-m 32 -M 4 -u kamailio -g kamailio -f /etc/kamailio/kamailio.cfg"
Make sure to create /var/log/kamailio and give the user "kamailio" proper permission on this directory. If you want to use some other working directory for kamailio, do the same on that directory.
Cheers, Adnan
-- View this message in context: http://sip-router.1086192.n5.nabble.com/Kamailio-4-3-and-Debian-8-2-systemct... Sent from the Users mailing list archive at Nabble.com.