[OpenSIPS-Users] Restart=always and After=mysql.service

Nabeel nabeelshikder at gmail.com
Mon Sep 21 03:25:45 CEST 2015

Thanks to a suggestion from Aron, I have now solved this problem.  The file
causing the permission error requires the '/usr/local' prefix in its
filepath, which the service file doesn't have.  The PID filepath is also
incorrect and the EnvironmentFile value should be '-/etc/default/opensips',
not '-/etc/sysconfig/opensips' like in the fedora package.

I am posting my working service file below for CentOS and I hope this gets
included in the future releases of OpenSIPS.

> Description=OpenSIPS is a very fast and flexible SIP (RFC3261) server
> After=network.target mariadb.service

> [Service]
> Type=forking
> User=root
> Group=root
> EnvironmentFile=-/etc/default/opensips
> PIDFile=/var/run/opensips.pid
> ExecStart=/usr/local/sbin/opensips -P /var/run/opensips.pid -f
> /usr/local/etc/opensips/opensips.cfg $OPTIONS
> ExecStartPre=/usr/local/sbin/opensips -c -f
> /usr/local/etc/opensips/opensips.cfg
> Restart=always
> TimeoutStopSec=30s
> [Install]
> WantedBy=multi-user.target
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150921/0f97ab1c/attachment.htm>

More information about the Users mailing list