lists.osmocom.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
List overview
Download
gerrit-log
April 2024
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
gerrit-log@lists.osmocom.org
1 participants
1128 discussions
Start a n
N
ew thread
[M] Change in osmo-msc[master]: .deb/.rpm: add osmocom user during package install
by osmith
osmith has submitted this change. (
https://gerrit.osmocom.org/c/osmo-msc/+/29709?usp=email
) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... .deb/.rpm: add osmocom user during package install Created osmocom user & group during package installation. Fix the configuration dir/files permission to match. Related: OS#4107 Tweaked-By: Oliver Smith <osmith(a)sysmocom.de> Change-Id: I41d47c0884d09d4674ec806d77e43bc8f08d9b64 --- M contrib/osmo-msc.spec.in M contrib/systemd/osmo-msc.service M debian/control A debian/postinst 4 files changed, 70 insertions(+), 2 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve osmith: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/contrib/osmo-msc.spec.in b/contrib/osmo-msc.spec.in index de93149..e6e323a 100644 --- a/contrib/osmo-msc.spec.in +++ b/contrib/osmo-msc.spec.in @@ -85,19 +85,32 @@ %install %make_install -%if 0%{?suse_version} %preun +%if 0%{?suse_version} %service_del_preun %{name}.service +%endif %postun +%if 0%{?suse_version} %service_del_postun %{name}.service +%endif %pre +getent group osmocom >/dev/null || groupadd --system osmocom +getent passwd osmocom >/dev/null || useradd --system --gid osmocom --home-dir /var/lib/osmocom \ + --shell /sbin/nologin --comment "Open Source Mobile Communications" osmocom +%if 0%{?suse_version} %service_add_pre %{name}.service +%endif %post +%if 0%{?suse_version} %service_add_post %{name}.service %endif +chown osmocom:osmocom /etc/osmocom/osmo-msc.cfg +chmod 0660 /etc/osmocom/osmo-msc.cfg +chown root:osmocom /etc/osmocom +chmod 2775 /etc/osmocom %check make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +) diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service index f21aec7..f0e18e6 100644 --- a/contrib/systemd/osmo-msc.service +++ b/contrib/systemd/osmo-msc.service @@ -12,6 +12,8 @@ Restart=always StateDirectory=osmocom WorkingDirectory=%S/osmocom +User=osmocom +Group=osmocom ExecStart=/usr/bin/osmo-msc -c /etc/osmocom/osmo-msc.cfg RestartSec=2 diff --git a/debian/control b/debian/control index 64bb73c..00c1b26 100644 --- a/debian/control +++ b/debian/control @@ -31,7 +31,7 @@ Package: osmo-msc Architecture: any Multi-Arch: foreign -Depends: ${misc:Depends}, ${shlibs:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, adduser Recommends: osmo-mgw Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks The Mobile Switching Center (MSC) is the heart of 2G/3G diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..866c31a --- /dev/null +++ b/debian/postinst @@ -0,0 +1,39 @@ +#!/bin/sh -e +# Create 'osmocom' user and group (if it doesn't exist yet) and adjust permissions +# of directories which are not automatically adjusted by systemd from previous (root-owned) +# install. + +# N. B: the user is intentionally NOT removed during package uninstall: +# see
https://wiki.debian.org/AccountHandlingInMaintainerScripts
for reasoning. +chperms() { + # chperms <user> <group> <perms> <file> + if ! OVERRIDE=`dpkg-statoverride --list $4 2>&1`; then + if [ -e $4 ]; then + chown $1:$2 $4 + chmod $3 $4 + fi + fi +} + +case "$1" in + configure) + if ! getent passwd osmocom > /dev/null; then + adduser --quiet \ + --system \ + --group \ + --no-create-home \ + --disabled-password \ + --home /var/lib/osmocom \ + --gecos "Open Source Mobile Communications" \ + osmocom + fi +# Set permissions according to
https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
+ chperms osmocom osmocom 0660 /etc/osmocom/osmo-msc.cfg + chperms root osmocom 2775 /etc/osmocom + + ;; +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/osmo-msc/+/29709?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I41d47c0884d09d4674ec806d77e43bc8f08d9b64 Gerrit-Change-Number: 29709 Gerrit-PatchSet: 2 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 year, 2 months
1
0
0
0
[M] Change in osmo-msc[master]: .deb/.rpm: add osmocom user during package install
by osmith
Attention is currently required from: msuraev. osmith has posted comments on this change. (
https://gerrit.osmocom.org/c/osmo-msc/+/29709?usp=email
) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/osmo-msc/+/29709?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I41d47c0884d09d4674ec806d77e43bc8f08d9b64 Gerrit-Change-Number: 29709 Gerrit-PatchSet: 2 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Thu, 25 Apr 2024 08:36:06 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 year, 2 months
1
0
0
0
[M] Change in osmo-sip-connector[master]: .deb/.rpm: add osmocom user during package install
by osmith
osmith has submitted this change. (
https://gerrit.osmocom.org/c/osmo-sip-connector/+/29721?usp=email
) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... .deb/.rpm: add osmocom user during package install Create osmocom user & group during package installation. Fix the configuration dir/files permission to match. Related: OS#4107 Tweaked-By: Oliver Smith <osmith(a)sysmocom.de> Change-Id: I7826fedb1b055a282954e5774615245092ddae5d --- M contrib/osmo-sip-connector.spec.in M contrib/systemd/osmo-sip-connector.service M debian/control A debian/postinst 4 files changed, 70 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve osmith: Looks good to me, approved pespin: Looks good to me, but someone else must approve diff --git a/contrib/osmo-sip-connector.spec.in b/contrib/osmo-sip-connector.spec.in index 3548e28..6b65800 100644 --- a/contrib/osmo-sip-connector.spec.in +++ b/contrib/osmo-sip-connector.spec.in @@ -50,19 +50,32 @@ %install %make_install -%if 0%{?suse_version} %preun +%if 0%{?suse_version} %service_del_preun %{name}.service +%endif %postun +%if 0%{?suse_version} %service_del_postun %{name}.service +%endif %pre +getent group osmocom >/dev/null || groupadd --system osmocom +getent passwd osmocom >/dev/null || useradd --system --gid osmocom --home-dir /var/lib/osmocom \ + --shell /sbin/nologin --comment "Open Source Mobile Communications" osmocom +%if 0%{?suse_version} %service_add_pre %{name}.service +%endif %post +%if 0%{?suse_version} %service_add_post %{name}.service %endif +chown osmocom:osmocom /etc/osmocom/osmo-sip-connector.cfg +chmod 0660 /etc/osmocom/osmo-sip-connector.cfg +chown root:osmocom /etc/osmocom +chmod 2775 /etc/osmocom %check make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +) diff --git a/contrib/systemd/osmo-sip-connector.service b/contrib/systemd/osmo-sip-connector.service index 27688af..69e628e 100644 --- a/contrib/systemd/osmo-sip-connector.service +++ b/contrib/systemd/osmo-sip-connector.service @@ -8,6 +8,8 @@ Restart=always StateDirectory=osmocom WorkingDirectory=%S/osmocom +User=osmocom +Group=osmocom ExecStart=/usr/bin/osmo-sip-connector -c /etc/osmocom/osmo-sip-connector.cfg RestartSec=2 diff --git a/debian/control b/debian/control index 4c7e4b0..b1a7580 100644 --- a/debian/control +++ b/debian/control @@ -17,7 +17,7 @@ Package: osmo-sip-connector Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser Description: MNCC to SIP bridge for osmo-nitb Use the osmo-nitb MNCC interface and bridge it to SIP. diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..83be547 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,39 @@ +#!/bin/sh -e +# Create 'osmocom' user and group (if it doesn't exist yet) and adjust permissions +# of directories which are not automatically adjusted by systemd from previous (root-owned) +# install. + +# N. B: the user is intentionally NOT removed during package uninstall: +# see
https://wiki.debian.org/AccountHandlingInMaintainerScripts
for reasoning. +chperms() { + # chperms <user> <group> <perms> <file> + if ! OVERRIDE=`dpkg-statoverride --list $4 2>&1`; then + if [ -e $4 ]; then + chown $1:$2 $4 + chmod $3 $4 + fi + fi +} + +case "$1" in + configure) + if ! getent passwd osmocom > /dev/null; then + adduser --quiet \ + --system \ + --group \ + --no-create-home \ + --disabled-password \ + --home /var/lib/osmocom \ + --gecos "Open Source Mobile Communications" \ + osmocom + fi +# Set permissions according to
https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
+ chperms osmocom osmocom 0660 /etc/osmocom/osmo-sip-connector.cfg + chperms root osmocom 2775 /etc/osmocom + + ;; +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/osmo-sip-connector/+/29721?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Change-Id: I7826fedb1b055a282954e5774615245092ddae5d Gerrit-Change-Number: 29721 Gerrit-PatchSet: 2 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 year, 2 months
1
0
0
0
[M] Change in osmo-sip-connector[master]: .deb/.rpm: add osmocom user during package install
by osmith
Attention is currently required from: msuraev. osmith has posted comments on this change. (
https://gerrit.osmocom.org/c/osmo-sip-connector/+/29721?usp=email
) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/osmo-sip-connector/+/29721?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Change-Id: I7826fedb1b055a282954e5774615245092ddae5d Gerrit-Change-Number: 29721 Gerrit-PatchSet: 2 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Thu, 25 Apr 2024 08:35:56 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 year, 2 months
1
0
0
0
[M] Change in osmo-sgsn[master]: .deb/.rpm: add osmocom user during package install
by osmith
osmith has submitted this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/29711?usp=email
) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... .deb/.rpm: add osmocom user during package install Create osmocom user & group during package installation. Fix the configuration dir/files permission to match. Related: OS#4107 Tweaked-By: Oliver Smith <osmith(a)sysmocom.de> Change-Id: I55ce205d4b314d01b2641c8f3d52455c051d6282 --- M contrib/osmo-sgsn.spec.in M contrib/systemd/osmo-gtphub.service M contrib/systemd/osmo-sgsn.service M debian/control A debian/postinst 5 files changed, 78 insertions(+), 5 deletions(-) Approvals: osmith: Looks good to me, approved Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve diff --git a/contrib/osmo-sgsn.spec.in b/contrib/osmo-sgsn.spec.in index 7ba994f..d1382cb 100644 --- a/contrib/osmo-sgsn.spec.in +++ b/contrib/osmo-sgsn.spec.in @@ -81,13 +81,29 @@ %if 0%{?suse_version} %preun %service_del_preun %{name}.service %postun %service_del_postun %{name}.service -%pre %service_add_pre %{name}.service -%post %service_add_post %{name}.service +%endif + +%pre +getent group osmocom >/dev/null || groupadd --system osmocom +getent passwd osmocom >/dev/null || useradd --system --gid osmocom --home-dir /var/lib/osmocom \ + --shell /sbin/nologin --comment "Open Source Mobile Communications" osmocom +%if 0%{?suse_version} +%service_add_pre %{name}.service +%endif + +%post +%if 0%{?suse_version} +%service_add_post %{name}.service +%endif +chown osmocom:osmocom /etc/osmocom/osmo-sgsn.cfg +chmod 0660 /etc/osmocom/osmo-sgsn.cfg +chown root:osmocom /etc/osmocom +chmod 2775 /etc/osmocom + %preun -n osmo-gtphub %service_del_preun osmo-gtphub.service %postun -n osmo-gtphub %service_del_postun osmo-gtphub.service %pre -n osmo-gtphub %service_add_pre osmo-gtphub.service %post -n osmo-gtphub %service_add_post osmo-gtphub.service -%endif %check make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +) diff --git a/contrib/systemd/osmo-gtphub.service b/contrib/systemd/osmo-gtphub.service index 9ade246..1e1a8a0 100644 --- a/contrib/systemd/osmo-gtphub.service +++ b/contrib/systemd/osmo-gtphub.service @@ -5,6 +5,8 @@ [Service] Type=simple +User=osmocom +Group=osmocom ExecStart=/usr/bin/osmo-gtphub -c /etc/osmocom/osmo-gtphub.cfg StateDirectory=osmocom WorkingDirectory=%S/osmocom diff --git a/contrib/systemd/osmo-sgsn.service b/contrib/systemd/osmo-sgsn.service index 21ecbb7..1cc962b 100644 --- a/contrib/systemd/osmo-sgsn.service +++ b/contrib/systemd/osmo-sgsn.service @@ -11,6 +11,8 @@ StateDirectory=osmocom WorkingDirectory=%S/osmocom Restart=always +User=osmocom +Group=osmocom ExecStart=/usr/bin/osmo-sgsn -c /etc/osmocom/osmo-sgsn.cfg RestartSec=2 diff --git a/debian/control b/debian/control index aa59455..b28db1f 100644 --- a/debian/control +++ b/debian/control @@ -30,7 +30,7 @@ Package: osmo-sgsn Architecture: any Multi-Arch: foreign -Depends: ${misc:Depends}, ${shlibs:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, adduser Description: OsmoSGSN: Osmocom's Serving GPRS Support Node for 2G and 3G packet-switched mobile networks Package: osmo-sgsn-dbg @@ -42,7 +42,7 @@ Package: osmo-gtphub Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser Description: Osmocom GTP Hub: Proxy for GTP traffic between multiple SGSNs and GGSNs Package: osmo-gtphub-dbg diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..84d7e5f --- /dev/null +++ b/debian/postinst @@ -0,0 +1,39 @@ +#!/bin/sh -e +# Create 'osmocom' user and group (if it doesn't exist yet) and adjust permissions +# of directories which are not automatically adjusted by systemd from previous (root-owned) +# install. + +# N. B: the user is intentionally NOT removed during package uninstall: +# see
https://wiki.debian.org/AccountHandlingInMaintainerScripts
for reasoning. +chperms() { + # chperms <user> <group> <perms> <file> + if ! OVERRIDE=`dpkg-statoverride --list $4 2>&1`; then + if [ -e $4 ]; then + chown $1:$2 $4 + chmod $3 $4 + fi + fi +} + +case "$1" in + configure) + if ! getent passwd osmocom > /dev/null; then + adduser --quiet \ + --system \ + --group \ + --no-create-home \ + --disabled-password \ + --home /var/lib/osmocom \ + --gecos "Open Source Mobile Communications" \ + osmocom + fi +# Set permissions according to
https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
+ chperms osmocom osmocom 0660 /etc/osmocom/osmo-sgsn.cfg + chperms root osmocom 2775 /etc/osmocom + + ;; +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/osmo-sgsn/+/29711?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I55ce205d4b314d01b2641c8f3d52455c051d6282 Gerrit-Change-Number: 29711 Gerrit-PatchSet: 2 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 year, 2 months
1
0
0
0
[M] Change in osmo-sgsn[master]: .deb/.rpm: add osmocom user during package install
by osmith
Attention is currently required from: msuraev. osmith has posted comments on this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/29711?usp=email
) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/29711?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I55ce205d4b314d01b2641c8f3d52455c051d6282 Gerrit-Change-Number: 29711 Gerrit-PatchSet: 2 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Thu, 25 Apr 2024 08:35:41 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 year, 2 months
1
0
0
0
[M] Change in osmo-upf[master]: .deb/.rpm: add osmocom user during package install
by osmith
osmith has submitted this change. (
https://gerrit.osmocom.org/c/osmo-upf/+/29716?usp=email
) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... .deb/.rpm: add osmocom user during package install Create osmocom user & group during package installation. Fix the configuration dir/files permission to match. Related: OS#4107 Tweaked-By: Oliver Smith <osmith(a)sysmocom.de> Change-Id: I6caa561eff63d6ee58b5c7b0f8c69bfd2d134eb3 --- M contrib/osmo-upf.spec.in M contrib/systemd/osmo-upf.service M debian/control A debian/postinst 4 files changed, 70 insertions(+), 2 deletions(-) Approvals: osmith: Looks good to me, approved Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve diff --git a/contrib/osmo-upf.spec.in b/contrib/osmo-upf.spec.in index 772db85..fb8438c 100644 --- a/contrib/osmo-upf.spec.in +++ b/contrib/osmo-upf.spec.in @@ -58,19 +58,32 @@ %install %make_install -%if 0%{?suse_version} %preun +%if 0%{?suse_version} %service_del_preun %{name}.service +%endif %postun +%if 0%{?suse_version} %service_del_postun %{name}.service +%endif %pre +getent group osmocom >/dev/null || groupadd --system osmocom +getent passwd osmocom >/dev/null || useradd --system --gid osmocom --home-dir /var/lib/osmocom \ + --shell /sbin/nologin --comment "Open Source Mobile Communications" osmocom +%if 0%{?suse_version} %service_add_pre %{name}.service +%endif %post +%if 0%{?suse_version} %service_add_post %{name}.service %endif +chown osmocom:osmocom /etc/osmocom/osmo-upf.cfg +chmod 0660 /etc/osmocom/osmo-upf.cfg +chown root:osmocom /etc/osmocom +chmod 2775 /etc/osmocom %check make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +) diff --git a/contrib/systemd/osmo-upf.service b/contrib/systemd/osmo-upf.service index 717a681..93dd84f 100644 --- a/contrib/systemd/osmo-upf.service +++ b/contrib/systemd/osmo-upf.service @@ -8,6 +8,8 @@ StateDirectory=osmocom WorkingDirectory=%S/osmocom Restart=always +User=osmocom +Group=osmocom ExecStart=/usr/bin/osmo-upf -c /etc/osmocom/osmo-upf.cfg RestartSec=2 diff --git a/debian/control b/debian/control index 5c26faf..7681c46 100644 --- a/debian/control +++ b/debian/control @@ -25,7 +25,7 @@ Package: osmo-upf Architecture: any Multi-Arch: foreign -Depends: ${misc:Depends}, ${shlibs:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, adduser Description: OsmoUPF: Osmocom User Plane Function Package: osmo-upf-dbg diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..a84d9b2 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,39 @@ +#!/bin/sh -e +# Create 'osmocom' user and group (if it doesn't exist yet) and adjust permissions +# of directories which are not automatically adjusted by systemd from previous (root-owned) +# install. + +# N. B: the user is intentionally NOT removed during package uninstall: +# see
https://wiki.debian.org/AccountHandlingInMaintainerScripts
for reasoning. +chperms() { + # chperms <user> <group> <perms> <file> + if ! OVERRIDE=`dpkg-statoverride --list $4 2>&1`; then + if [ -e $4 ]; then + chown $1:$2 $4 + chmod $3 $4 + fi + fi +} + +case "$1" in + configure) + if ! getent passwd osmocom > /dev/null; then + adduser --quiet \ + --system \ + --group \ + --no-create-home \ + --disabled-password \ + --home /var/lib/osmocom \ + --gecos "Open Source Mobile Communications" \ + osmocom + fi +# Set permissions according to
https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
+ chperms osmocom osmocom 0660 /etc/osmocom/osmo-upf.cfg + chperms root osmocom 2775 /etc/osmocom + + ;; +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/osmo-upf/+/29716?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: I6caa561eff63d6ee58b5c7b0f8c69bfd2d134eb3 Gerrit-Change-Number: 29716 Gerrit-PatchSet: 2 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 year, 2 months
1
0
0
0
[M] Change in osmo-upf[master]: .deb/.rpm: add osmocom user during package install
by osmith
Attention is currently required from: msuraev. osmith has posted comments on this change. (
https://gerrit.osmocom.org/c/osmo-upf/+/29716?usp=email
) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/osmo-upf/+/29716?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: I6caa561eff63d6ee58b5c7b0f8c69bfd2d134eb3 Gerrit-Change-Number: 29716 Gerrit-PatchSet: 2 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Thu, 25 Apr 2024 08:35:33 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 year, 2 months
1
0
0
0
[M] Change in osmo-hlr[master]: .deb/.rpm: add osmocom user during package install
by osmith
osmith has submitted this change. (
https://gerrit.osmocom.org/c/osmo-hlr/+/29311?usp=email
) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... .deb/.rpm: add osmocom user during package install Created osmocom user & group during package installation. Fix the configuration dir/files permission to match. Related: OS#4107 Tweaked-By: Oliver Smith <osmith(a)sysmocom.de> Change-Id: I625c993ab03dfe32976c651acca9c35c33a768e7 --- M contrib/osmo-hlr.spec.in M contrib/systemd/osmo-hlr.service M debian/control M debian/postinst 4 files changed, 69 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve osmith: Looks good to me, approved diff --git a/contrib/osmo-hlr.spec.in b/contrib/osmo-hlr.spec.in index f3085e7..a1f92ef 100644 --- a/contrib/osmo-hlr.spec.in +++ b/contrib/osmo-hlr.spec.in @@ -127,22 +127,34 @@ %check make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +) -%if 0%{?suse_version} %preun +%if 0%{?suse_version} %service_del_preun %{name}.service +%endif %postun +%if 0%{?suse_version} %service_del_postun %{name}.service +%endif %pre +getent group osmocom >/dev/null || groupadd --system osmocom +getent passwd osmocom >/dev/null || useradd --system --gid osmocom --home-dir /var/lib/osmocom \ + --shell /sbin/nologin --comment "Open Source Mobile Communications" osmocom +%if 0%{?suse_version} %service_add_pre %{name}.service %endif +exit 0 %post %if 0%{?suse_version} %service_add_post %{name}.service %endif /usr/share/osmocom/osmo-hlr-post-upgrade.sh +chown osmocom:osmocom /etc/osmocom/osmo-hlr.cfg +chmod 0660 /etc/osmocom/osmo-hlr.cfg +chown root:osmocom /etc/osmocom +chmod 2775 /etc/osmocom %post -n libosmo-gsup-client0 -p /sbin/ldconfig %postun -n libosmo-gsup-client0 -p /sbin/ldconfig diff --git a/contrib/systemd/osmo-hlr.service b/contrib/systemd/osmo-hlr.service index 4b4df7e..2822f13 100644 --- a/contrib/systemd/osmo-hlr.service +++ b/contrib/systemd/osmo-hlr.service @@ -9,6 +9,8 @@ Restart=always StateDirectory=osmocom WorkingDirectory=%S/osmocom +User=osmocom +Group=osmocom ExecStart=/usr/bin/osmo-hlr -c /etc/osmocom/osmo-hlr.cfg -l /var/lib/osmocom/hlr.db RestartSec=2 ProtectHome=true diff --git a/debian/control b/debian/control index ec234a3..56457c9 100644 --- a/debian/control +++ b/debian/control @@ -20,7 +20,7 @@ Package: osmo-hlr Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser Description: Osmocom Home Location Register OsmoHLR is a Osmocom implementation of HLR (Home Location Registrar) which works over GSUP protocol. The subscribers are store in sqlite DB. diff --git a/debian/postinst b/debian/postinst index 390d304..96734df 100755 --- a/debian/postinst +++ b/debian/postinst @@ -3,3 +3,42 @@ # post-upgrade script in both cases, it won't do anything if there is nothing # to do. /usr/share/osmocom/osmo-hlr-post-upgrade.sh + +# Create 'osmocom' user and group (if it doesn't exist yet) and adjust permissions +# of directories which are not automatically adjusted by systemd from previous (root-owned) +# install. + +# N. B: the user is intentionally NOT removed during package uninstall: +# see
https://wiki.debian.org/AccountHandlingInMaintainerScripts
for reasoning. +chperms() { + # chperms <user> <group> <perms> <file> + if ! OVERRIDE=`dpkg-statoverride --list $4 2>&1`; then + if [ -e $4 ]; then + chown $1:$2 $4 + chmod $3 $4 + fi + fi +} + +case "$1" in + configure) + if ! getent passwd osmocom > /dev/null; then + adduser --quiet \ + --system \ + --group \ + --no-create-home \ + --disabled-password \ + --home /var/lib/osmocom \ + --gecos "Open Source Mobile Communications" \ + osmocom + fi +# Set permissions according to
https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
+ chperms osmocom osmocom 0660 /etc/osmocom/osmo-hlr.cfg + chperms root osmocom 2775 /etc/osmocom + + ;; +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/osmo-hlr/+/29311?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Change-Id: I625c993ab03dfe32976c651acca9c35c33a768e7 Gerrit-Change-Number: 29311 Gerrit-PatchSet: 19 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: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 year, 2 months
1
0
0
0
[M] Change in osmo-hlr[master]: .deb/.rpm: add osmocom user during package install
by osmith
Attention is currently required from: fixeria, msuraev. osmith has posted comments on this change. (
https://gerrit.osmocom.org/c/osmo-hlr/+/29311?usp=email
) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... Patch Set 19: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/osmo-hlr/+/29311?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Change-Id: I625c993ab03dfe32976c651acca9c35c33a768e7 Gerrit-Change-Number: 29311 Gerrit-PatchSet: 19 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: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Thu, 25 Apr 2024 08:35:24 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 year, 2 months
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
113
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
Results per page:
10
25
50
100
200