osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36943?usp=email )
Change subject: contrib/systemd: use StateDirectory
......................................................................
contrib/systemd: use StateDirectory
Adjust the systemd service to be more similar to other Osmocom
projects, by using StateDirectory. This directory gets created by
systemd, so remove the ExecStartPre=/usr/bin/mkdir line.
Related: https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html
Change-Id: I83c7749ca1277b71e25c41b4dc943e83608bd442
---
M contrib/systemd/osmo-epdg.service
1 file changed, 16 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg refs/changes/43/36943/1
diff --git a/contrib/systemd/osmo-epdg.service b/contrib/systemd/osmo-epdg.service
index 48ced12..40318c1 100644
--- a/contrib/systemd/osmo-epdg.service
+++ b/contrib/systemd/osmo-epdg.service
@@ -6,10 +6,10 @@
[Service]
Type=simple
Restart=always
-WorkingDirectory=/var/lib/osmo-epdg
+StateDirectory=osmo-epdg
+WorkingDirectory=%S/osmo-epdg
Environment="ERL_FLAGS=-config /etc/osmocom/osmo-epdg.config"
ExecStartPre=-/usr/bin/ip link del gtp0
-ExecStartPre=/usr/bin/mkdir -p /var/lib/osmo-epdg
ExecStart=/usr/bin/osmo-epdg
RestartSec=2
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36943?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: erlang/osmo-epdg
Gerrit-Branch: master
Gerrit-Change-Id: I83c7749ca1277b71e25c41b4dc943e83608bd442
Gerrit-Change-Number: 36943
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36944?usp=email )
Change subject: contrib/systemd: run as osmocom user
......................................................................
contrib/systemd: run as osmocom user
Related: OS#4107
Change-Id: I6c8f3b316f13d497a15fcb4fe904fe0628ee2d13
---
M contrib/systemd/osmo-epdg.service
A debian/postinst
2 files changed, 36 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg refs/changes/44/36944/1
diff --git a/contrib/systemd/osmo-epdg.service b/contrib/systemd/osmo-epdg.service
index 40318c1..df06a4f 100644
--- a/contrib/systemd/osmo-epdg.service
+++ b/contrib/systemd/osmo-epdg.service
@@ -8,10 +8,14 @@
Restart=always
StateDirectory=osmo-epdg
WorkingDirectory=%S/osmo-epdg
+User=osmocom
+Group=osmocom
Environment="ERL_FLAGS=-config /etc/osmocom/osmo-epdg.config"
ExecStartPre=-/usr/bin/ip link del gtp0
ExecStart=/usr/bin/osmo-epdg
RestartSec=2
+# For setting up the gtp device
+AmbientCapabilities=CAP_NET_ADMIN
[Install]
WantedBy=multi-user.target
diff --git a/debian/postinst b/debian/postinst
new file mode 100755
index 0000000..d4857a2
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,22 @@
+#!/bin/sh -e
+case "$1" in
+ configure)
+ # Create the osmocom group and user (if it doesn't exist yet)
+ if ! getent group osmocom >/dev/null; then
+ groupadd --system osmocom
+ fi
+ if ! getent passwd osmocom >/dev/null; then
+ useradd \
+ --system \
+ --gid osmocom \
+ --home-dir /var/lib/osmocom \
+ --shell /sbin/nologin \
+ --comment "Open Source Mobile Communications" \
+ osmocom
+ fi
+ ;;
+esac
+
+# dh_installdeb(1) will replace this with shell code automatically
+# generated by other debhelper scripts.
+#DEBHELPER#
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36944?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: erlang/osmo-epdg
Gerrit-Branch: master
Gerrit-Change-Id: I6c8f3b316f13d497a15fcb4fe904fe0628ee2d13
Gerrit-Change-Number: 36944
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: fixeria, msuraev, pespin.
osmith has uploaded a new patch set (#6) to the change originally created by msuraev. ( https://gerrit.osmocom.org/c/osmo-pcap/+/29724?usp=email )
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: contrib/systemd: run as osmocom user
......................................................................
contrib/systemd: run as osmocom user
Related: OS#4107
Co-Developed-By: Oliver Smith <osmith(a)sysmocom.de>
Change-Id: Iccea921f0d3e92dd7ca2f4810932568121260a2a
---
M contrib/osmo-pcap.spec.in
M contrib/systemd/osmo-pcap-client.service
M contrib/systemd/osmo-pcap-server.service
A debian/osmo-pcap-client.postinst
A debian/osmo-pcap-server.postinst
5 files changed, 98 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/24/29724/6
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/29724?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: Iccea921f0d3e92dd7ca2f4810932568121260a2a
Gerrit-Change-Number: 29724
Gerrit-PatchSet: 6
Gerrit-Owner: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: msuraev <msuraev(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-gbproxy/+/36941?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: contrib/systemd: run as osmocom user
......................................................................
contrib/systemd: run as osmocom user
Related: OS#4107
Change-Id: I13529cd8c6ca94c43a9a81e2ea60bafc3f189ab4
---
M contrib/systemd/osmo-gbproxy.service
A debian/postinst
2 files changed, 51 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/41/36941/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/36941?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I13529cd8c6ca94c43a9a81e2ea60bafc3f189ab4
Gerrit-Change-Number: 36941
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset
Attention is currently required from: fixeria, msuraev, pespin.
osmith has uploaded a new patch set (#5) to the change originally created by msuraev. ( https://gerrit.osmocom.org/c/osmo-pcap/+/29724?usp=email )
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: contrib/systemd: run as osmocom user
......................................................................
contrib/systemd: run as osmocom user
Related: OS#4107
Co-Developed-By: Oliver Smith <osmith(a)sysmocom.de>
Change-Id: Iccea921f0d3e92dd7ca2f4810932568121260a2a
---
M contrib/osmo-pcap.spec.in
M contrib/systemd/osmo-pcap-client.service
M contrib/systemd/osmo-pcap-server.service
A debian/osmo-pcap-client.postinst
A debian/osmo-pcap-server.postinst
5 files changed, 98 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/24/29724/5
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/29724?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: Iccea921f0d3e92dd7ca2f4810932568121260a2a
Gerrit-Change-Number: 29724
Gerrit-PatchSet: 5
Gerrit-Owner: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: msuraev <msuraev(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-gbproxy/+/36941?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: contrib/systemd: run as osmocom user
......................................................................
contrib/systemd: run as osmocom user
Related: OS#4107
Change-Id: I13529cd8c6ca94c43a9a81e2ea60bafc3f189ab4
---
M contrib/systemd/osmo-gbproxy.service
A debian/postinst
2 files changed, 51 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/41/36941/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/36941?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I13529cd8c6ca94c43a9a81e2ea60bafc3f189ab4
Gerrit-Change-Number: 36941
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-gbproxy/+/36942?usp=email )
Change subject: debian/osmo-gbproxy.init: delete
......................................................................
debian/osmo-gbproxy.init: delete
Remove SysV init scripts. These are not really maintained anymore and
this makes it consistent with other Osmocom projects.
Avoids synchronizing with SysV scripts on debian:
# systemctl enable osmo-gbproxy
Synchronizing state of osmo-gbproxy.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable osmo-gbproxy
Change-Id: I890b1ee9c201f09dcef968482c0bc5ed65ea7def
---
D debian/osmo-gbproxy.init
1 file changed, 17 insertions(+), 151 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/42/36942/1
diff --git a/debian/osmo-gbproxy.init b/debian/osmo-gbproxy.init
deleted file mode 100755
index 924f32d..0000000
--- a/debian/osmo-gbproxy.init
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides: osmo-gbproxy
-# Required-Start: $network $local_fs
-# Required-Stop:
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Osmocom GBproxy
-# Description: A tool to proxy the GPRS Gb interface.
-### END INIT INFO
-
-# Author: Harald Welte <laforge(a)gnumonks.org>
-
-# PATH should only include /usr/* if it runs after the mountnfs.sh script
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-NAME=osmo-gbproxy # Introduce the short server's name here
-DESC="Osmocom GBProxy" # Introduce a short description here
-DAEMON=/usr/bin/osmo-gbproxy # Introduce the server's location here
-SCRIPTNAME=/etc/init.d/osmocom-gbproxy
-CONFIG_FILE=/etc/osmocom/osmocom-gbproxy.cfg
-
-# Exit if the package is not installed
-[ -x $DAEMON ] || exit 0
-
-# Read configuration variable file if it is present
-[ -r /etc/default/osmocom-gbproxy ] && . /etc/default/osmocom-gbproxy
-
-# Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
-
-# Define LSB log_* functions.
-# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
-. /lib/lsb/init-functions
-
-DAEMON_ARGS="-D -c $CONFIG_FILE"
-
-#
-# Function that starts the daemon/service
-#
-do_start()
-{
- # Return
- # 0 if daemon has been started
- # 1 if daemon was already running
- # 2 if daemon could not be started
- start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
- || return 1
- start-stop-daemon --start --quiet --exec $DAEMON -- \
- $DAEMON_ARGS \
- || return 2
- # Add code here, if necessary, that waits for the process to be ready
- # to handle requests from services started subsequently which depend
- # on this one. As a last resort, sleep for some time.
-}
-
-#
-# Function that stops the daemon/service
-#
-do_stop()
-{
- # Return
- # 0 if daemon has been stopped
- # 1 if daemon was already stopped
- # 2 if daemon could not be stopped
- # other if a failure occurred
- start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
- RETVAL="$?"
- [ "$RETVAL" = 2 ] && return 2
- # Wait for children to finish too if this is a daemon that forks
- # and if the daemon is only ever run from this initscript.
- # If the above conditions are not satisfied then add some other code
- # that waits for the process to drop all resources that could be
- # needed by services started subsequently. A last resort is to
- # sleep for some time.
- start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
- [ "$?" = 2 ] && return 2
- return "$RETVAL"
-}
-
-#
-# Function that sends a SIGHUP to the daemon/service
-#
-do_reload() {
- #
- # If the daemon can reload its configuration without
- # restarting (for example, when it is sent a SIGHUP),
- # then implement that here.
- #
- start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
- return 0
-}
-
-case "$1" in
- start)
- [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
- do_start
- case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
- esac
- ;;
- stop)
- [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
- do_stop
- case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
- esac
- ;;
- status)
- status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
- ;;
- #reload|force-reload)
- #
- # If do_reload() is not implemented then leave this commented out
- # and leave 'force-reload' as an alias for 'restart'.
- #
- #log_daemon_msg "Reloading $DESC" "$NAME"
- #do_reload
- #log_end_msg $?
- #;;
- restart|force-reload)
- #
- # If the "reload" option is implemented then remove the
- # 'force-reload' alias
- #
- log_daemon_msg "Restarting $DESC" "$NAME"
- do_stop
- case "$?" in
- 0|1)
- do_start
- case "$?" in
- 0) log_end_msg 0 ;;
- 1) log_end_msg 1 ;; # Old process is still running
- *) log_end_msg 1 ;; # Failed to start
- esac
- ;;
- *)
- # Failed to stop
- log_end_msg 1
- ;;
- esac
- ;;
- *)
- #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
- echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
- exit 3
- ;;
-esac
-
-:
--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/36942?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I890b1ee9c201f09dcef968482c0bc5ed65ea7def
Gerrit-Change-Number: 36942
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: fixeria, msuraev, pespin.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcap/+/29724?usp=email )
Change subject: contrib/systemd: run as osmocom user
......................................................................
Patch Set 4:
This change is ready for review.
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/29724?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: Iccea921f0d3e92dd7ca2f4810932568121260a2a
Gerrit-Change-Number: 29724
Gerrit-PatchSet: 4
Gerrit-Owner: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: msuraev <msuraev(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 28 May 2024 11:43:06 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment