| 1 | [Unit] |
| 2 | Description=Kamailio - the Open Source SIP Server (instance %i) |
| 3 | Documentation=man:kamailio(8) |
| 4 | Wants=network-online.target |
| 5 | After=network-online.target |
| 6 | |
| 7 | [Service] |
| 8 | Type=forking |
| 9 | User=kamailio |
| 10 | Group=kamailio |
| 11 | Environment='CFGFILE=/etc/kamailio/kamailio-%i.cfg' |
| 12 | Environment='SHM_MEMORY=64' |
| 13 | Environment='PKG_MEMORY=8' |
| 14 | EnvironmentFile=-/etc/default/kamailio-%i |
| 15 | EnvironmentFile=-/etc/default/kamailio-%i.d/* |
| 16 | # PIDFile requires a full absolute path |
| 17 | PIDFile=/run/kamailio-%i/kamailio.pid |
| 18 | # ExecStart requires a full absolute path |
| 19 | ExecStart=/usr/sbin/kamailio -P /run/kamailio-%i/kamailio.pid -Y /run/kamailio-%i -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY |
| 20 | Restart=on-failure |
| 21 | # /run/kamailio in tmpfs |
| 22 | RuntimeDirectory=kamailio-%i |
| 23 | RuntimeDirectoryMode=0770 |
| 24 | # necessary for chown of control files e.g. for jsonrpcs and ctl modules |
| 25 | AmbientCapabilities=CAP_CHOWN |
| 26 | |
| 27 | [Install] |
| 28 | WantedBy=multi-user.target |