Module: kamailio
Branch: 5.3
Commit: 1ed796ca3813e4fde557af6a605e768b38acbf6e
URL: 
https://github.com/kamailio/kamailio/commit/1ed796ca3813e4fde557af6a605e768b38acbf6e

Author: Federico Santulli <federico.santu...@nhm.it>
Committer: Henning Westerholt <h...@skalatan.de>
Date: 2020-02-17T11:08:16+01:00

pkg: add generic files for new gento packages (GH #2220)

(cherry picked from commit d94fce63e496f1039ed6b39ce2dfc257a8e60da2)

---

Added: pkg/kamailio/gentoo/files/kamailio.confd
Added: pkg/kamailio/gentoo/files/kamailio.initd

---

Diff:  
https://github.com/kamailio/kamailio/commit/1ed796ca3813e4fde557af6a605e768b38acbf6e.diff
Patch: 
https://github.com/kamailio/kamailio/commit/1ed796ca3813e4fde557af6a605e768b38acbf6e.patch

---

diff --git a/pkg/kamailio/gentoo/files/kamailio.confd 
b/pkg/kamailio/gentoo/files/kamailio.confd
new file mode 100644
index 0000000000..a1b6c9ff7c
--- /dev/null
+++ b/pkg/kamailio/gentoo/files/kamailio.confd
@@ -0,0 +1,14 @@
+# Copyright 1999-2020 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# Additional options to start Kamailio with
+#
+# see "kamailio -h" for a list of options
+#
+# default: run Kamailio as user:group = kamailio:kamailio
+#
+KAMAILIO_OPTS="-u kamailio -g kamailio -f /etc/kamailio/kamailio.cfg"
+
+#rc_use="mysql"
+#rc_ulimit="-n 1048576"
\ No newline at end of file
diff --git a/pkg/kamailio/gentoo/files/kamailio.initd 
b/pkg/kamailio/gentoo/files/kamailio.initd
new file mode 100644
index 0000000000..1a26895e65
--- /dev/null
+++ b/pkg/kamailio/gentoo/files/kamailio.initd
@@ -0,0 +1,43 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header$
+
+extra_commands="checkconfig"
+
+depend() {
+       need net
+       use syslog
+}
+
+start() {
+       checkconfig_real || return $?
+
+       ebegin "Starting ${SVCNAME}"
+       start-stop-daemon --start --quiet --pidfile /var/run/${SVCNAME}.pid \
+               --exec /usr/sbin/kamailio -- ${KAMAILIO_OPTS} -P 
/var/run/${SVCNAME}.pid
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping ${SVCNAME}"
+       start-stop-daemon --stop --quiet --pidfile /var/run/${SVCNAME}.pid
+       eend $?
+}
+
+checkconfig() {
+        ebegin "Checking ${SVCNAME} config file"
+        checkconfig_real
+        eend $?
+}
+
+checkconfig_real() {
+       local TMPLOG=$(mktemp)
+        /usr/sbin/kamailio ${KAMAILIO_OPTS} -P /var/run/${SVCNAME}.pid -c 
>"${TMPLOG}" 2>&1
+       local ret=$?
+       if [ $ret -ne 0 ]; then
+                eerror "${SVCNAME} has detected a syntax error in your 
configuration file:"
+               cat ${TMPLOG}; rm ${TMPLOG}
+        fi
+       return $ret
+}
\ No newline at end of file


_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to