osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-smlc/+/36810?usp=email )
Change subject: debian/postinst: add checks, be verbose
......................................................................
debian/postinst: add checks, be verbose
Do not attempt to change permissions/ownership if the package gets
upgraded from a version higher than the next release.
Do not fail if the user deleted the config file.
Be verbose when changing permissions.
Related: OS#4107
Change-Id: I8994759df644d6edd8f937051b95690537b749be
---
M debian/postinst
1 file changed, 31 insertions(+), 6 deletions(-)
Approvals:
pespin: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/debian/postinst b/debian/postinst
index faecd26..6c99b1f 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -16,12 +16,20 @@
fi
# Fix permissions of previous (root-owned) install (OS#4107)
- chown osmocom:osmocom /etc/osmocom/osmo-smlc.cfg
- chmod 0660 /etc/osmocom/osmo-smlc.cfg
- chown root:osmocom /etc/osmocom
- chmod 2775 /etc/osmocom
- mkdir -p /var/lib/osmocom
- chown -R osmocom:osmocom /var/lib/osmocom
+ if dpkg --compare-versions "$2" le "0.3.0"; then
+ if [ -e /etc/osmocom/osmo-smlc.cfg ]; then
+ chown -v osmocom:osmocom /etc/osmocom/osmo-smlc.cfg
+ chmod -v 0660 /etc/osmocom/osmo-smlc.cfg
+ fi
+
+ if [ -d /etc/osmocom ]; then
+ chown -v root:osmocom /etc/osmocom
+ chmod -v 2775 /etc/osmocom
+ fi
+
+ mkdir -p /var/lib/osmocom
+ chown -R -v osmocom:osmocom /var/lib/osmocom
+ fi
;;
esac
--
To view, visit https://gerrit.osmocom.org/c/osmo-smlc/+/36810?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-smlc
Gerrit-Branch: master
Gerrit-Change-Id: I8994759df644d6edd8f937051b95690537b749be
Gerrit-Change-Number: 36810
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(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
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hlr/+/36804?usp=email )
Change subject: debian/postinst: add checks, be verbose
......................................................................
debian/postinst: add checks, be verbose
Do not attempt to change permissions/ownership if the package gets
upgraded from a version higher than the next release.
Do not fail if the user deleted the config file.
Be verbose when changing permissions.
Related: OS#4107
Change-Id: I1bcbe414fd18101e4d875a16539deab7baf9cb5f
---
M debian/postinst
1 file changed, 31 insertions(+), 6 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/debian/postinst b/debian/postinst
index 5dedec4..34fb79d 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -21,12 +21,20 @@
fi
# Fix permissions of previous (root-owned) install (OS#4107)
- chown osmocom:osmocom /etc/osmocom/osmo-hlr.cfg
- chmod 0660 /etc/osmocom/osmo-hlr.cfg
- chown root:osmocom /etc/osmocom
- chmod 2775 /etc/osmocom
- mkdir -p /var/lib/osmocom
- chown -R osmocom:osmocom /var/lib/osmocom
+ if dpkg --compare-versions "$2" le "1.8.0"; then
+ if [ -e /etc/osmocom/osmo-hlr.cfg ]; then
+ chown -v osmocom:osmocom /etc/osmocom/osmo-hlr.cfg
+ chmod -v 0660 /etc/osmocom/osmo-hlr.cfg
+ fi
+
+ if [ -d /etc/osmocom ]; then
+ chown -v root:osmocom /etc/osmocom
+ chmod -v 2775 /etc/osmocom
+ fi
+
+ mkdir -p /var/lib/osmocom
+ chown -R -v osmocom:osmocom /var/lib/osmocom
+ fi
;;
esac
--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/36804?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: I1bcbe414fd18101e4d875a16539deab7baf9cb5f
Gerrit-Change-Number: 36804
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(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
Attention is currently required from: fixeria, pespin.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/30131?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-trx/+/30131?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I3e0e5978992dac0a0c76c6f0e859576aa3eb72eb
Gerrit-Change-Number: 30131
Gerrit-PatchSet: 4
Gerrit-Owner: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 15 May 2024 10:52:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment