Skip to content

Commit

Permalink
pkg: add opensips_b2bua unit-file and default file
Browse files Browse the repository at this point in the history
  • Loading branch information
cruzccl committed Nov 2, 2023
1 parent 1402bdc commit 82ac206
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
30 changes: 30 additions & 0 deletions packaging/debian/opensips_b2bua.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# OpenSIPS startup options
#

# Set to yes to enable opensips, once configured properly.
RUN_OPENSIPS=no

# User to run as
USER=opensips

# Group to run as
GROUP=opensips

# Amount of shared memory to allocate for the running OpenSIPS server (in Mb)
S_MEMORY=256

# Amount of pkg memory to allocate for the running OpenSIPS server (in Mb)
P_MEMORY=128

# Enable the server to leave a core file when it crashes.
# Set this to 'yes' to enable OpenSIPS to leave a core file when it crashes
# or 'no' to disable this feature. This option is case sensitive and only
# accepts 'yes' and 'no' and only in lowercase letters.
# On some systems (e.g. Ubuntu 6.10, Debian 4.0) it is necessary to specify
# a directory for the core files to get a dump. Look into the opensips
# init file for an example configuration.
DUMP_CORE=no

# Any additional OpenSIPS options
OPTIONS=""
23 changes: 23 additions & 0 deletions packaging/debian/opensips_b2bua.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[Unit]
Description=OpenSIPS is a very fast and flexible SIP (RFC3261) server
Documentation=man:opensips
After=network.target mysqld.service postgresql.service rtpproxy.service

[Service]
Type=forking
User=opensips
Group=opensips
RuntimeDirectory=opensips_b2bua
RuntimeDirectoryMode=775
Environment=P_MEMORY=128 S_MEMORY=256
EnvironmentFile=-/etc/default/opensips_b2bua
PermissionsStartOnly=yes
PIDFile=%t/opensips_b2bua/opensips.pid
ExecStart=/usr/sbin/opensips -P %t/opensips_b2bua/opensips.pid -f /etc/opensips/b2bua/opensips.cfg -m $S_MEMORY -M $P_MEMORY $OPTIONS
ExecStop=/usr/bin/pkill --pidfile %t/opensips_b2bua/opensips.pid
Restart=always
TimeoutStopSec=30s
LimitNOFILE=262144

[Install]
WantedBy=multi-user.target

0 comments on commit 82ac206

Please sign in to comment.