From a4103962fca97bf217c3abd53f611634a4f81f5b Mon Sep 17 00:00:00 2001 From: Dave Hibberd Date: Sat, 16 Dec 2023 13:35:16 +0000 Subject: [PATCH 1/2] bpq config move --- debian/NEWS | 11 +++++++++++ debian/changelog | 6 ++++++ debian/dirs | 1 + debian/install | 2 +- debian/linbpq.service | 2 +- debian/patches/makefile | 4 ++-- debian/preinst | 12 ++++++++++++ 7 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 debian/NEWS create mode 100644 debian/preinst diff --git a/debian/NEWS b/debian/NEWS new file mode 100644 index 0000000..e0aefbc --- /dev/null +++ b/debian/NEWS @@ -0,0 +1,11 @@ +linbpq (6.0.24.22-2) UNRELEASED; urgency=medium + + This is quite a big update, with config moving from /opt/oarc/bpq/bpq32.cfg to + /etc/bpq32.cfg. The system shall do this automatically for you, however + computers and their programmers are not perfect. + + I strongly recommend at this point backing up your entire + /opt/oarc/bpq/ directory (cp -r /opt/oarc/bpq/ ~/bpq-backup/) before + proceeding with the upgrade + + -- Dave Hibberd Sat, 16 Dec 2023 13:30:06 +0000 diff --git a/debian/changelog b/debian/changelog index d0ca8b4..019b549 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +linbpq (6.0.24.22-2) UNRELEASED; urgency=medium + + * Moved config file home, caused chaos + + -- Dave Hibberd Sat, 16 Dec 2023 13:30:06 +0000 + linbpq (6.0.24.22-1) unstable; urgency=medium * New Upstream Release diff --git a/debian/dirs b/debian/dirs index 5cac53f..10a5980 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1 +1,2 @@ +usr/sbin opt/oarc/bpq diff --git a/debian/install b/debian/install index e4a0e92..fb787b0 100644 --- a/debian/install +++ b/debian/install @@ -1 +1 @@ -debian/templates/bpq32.cfg opt/oarc/bpq +debian/templates/bpq32.cfg etc/bpq32.cfg diff --git a/debian/linbpq.service b/debian/linbpq.service index 34ed587..3b46a5d 100644 --- a/debian/linbpq.service +++ b/debian/linbpq.service @@ -2,7 +2,7 @@ After=network.target [Service] -ExecStart=/opt/oarc/bpq/linbpq +ExecStart=/usr/sbin/linbpq -c /etc -d /opt/oarc/linbpq -l /opt/oarc/linbpq/logs WorkingDirectory=/opt/oarc/bpq Restart=always User=linbpq diff --git a/debian/patches/makefile b/debian/patches/makefile index d663e6c..2132816 100644 --- a/debian/patches/makefile +++ b/debian/patches/makefile @@ -8,8 +8,8 @@ +# setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq + +install: -+ install -b -m 755 -D -d debian/linbpq/opt/oarc/bpq -+ install -b -m 755 -s -p linbpq debian/linbpq/opt/oarc/bpq ++ install -b -m 755 -D -d debian/usr/sbin ++ install -b -m 755 -s -p linbpq debian/usr/sbin -include *.d diff --git a/debian/preinst b/debian/preinst new file mode 100644 index 0000000..8ba52dd --- /dev/null +++ b/debian/preinst @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +confile="/etc/bpq32.cfg" +node="/opt/oarc/bpq/bpq32.cfg" + +if [ -L $confile ]; then + rm $confile + cp $node $confile + rm $node +fi From 1fbded9d3afd766e861577ba08d0f86f952de64e Mon Sep 17 00:00:00 2001 From: Dave Hibberd Date: Sat, 16 Dec 2023 14:40:33 +0000 Subject: [PATCH 2/2] Tested final release for new layout --- debian/changelog | 4 ++-- debian/conffiles | 1 - debian/install | 2 +- debian/linbpq.links | 1 - debian/linbpq.service | 2 +- debian/patches/makefile | 4 ++-- debian/postinst | 2 +- debian/preinst | 2 +- 8 files changed, 8 insertions(+), 10 deletions(-) delete mode 100644 debian/conffiles delete mode 100644 debian/linbpq.links diff --git a/debian/changelog b/debian/changelog index 019b549..c144a78 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -linbpq (6.0.24.22-2) UNRELEASED; urgency=medium +linbpq (6.0.24.22-2) unstable; urgency=medium * Moved config file home, caused chaos - -- Dave Hibberd Sat, 16 Dec 2023 13:30:06 +0000 + -- Dave Hibberd Sat, 16 Dec 2023 14:40:20 +0000 linbpq (6.0.24.22-1) unstable; urgency=medium diff --git a/debian/conffiles b/debian/conffiles deleted file mode 100644 index 9667d53..0000000 --- a/debian/conffiles +++ /dev/null @@ -1 +0,0 @@ -/opt/oarc/bpq/bpq32.cfg diff --git a/debian/install b/debian/install index fb787b0..3367546 100644 --- a/debian/install +++ b/debian/install @@ -1 +1 @@ -debian/templates/bpq32.cfg etc/bpq32.cfg +debian/templates/bpq32.cfg etc/ diff --git a/debian/linbpq.links b/debian/linbpq.links deleted file mode 100644 index 9f1a328..0000000 --- a/debian/linbpq.links +++ /dev/null @@ -1 +0,0 @@ -/opt/oarc/bpq/bpq32.cfg /etc/bpq32.cfg diff --git a/debian/linbpq.service b/debian/linbpq.service index 3b46a5d..598393c 100644 --- a/debian/linbpq.service +++ b/debian/linbpq.service @@ -2,7 +2,7 @@ After=network.target [Service] -ExecStart=/usr/sbin/linbpq -c /etc -d /opt/oarc/linbpq -l /opt/oarc/linbpq/logs +ExecStart=/usr/sbin/linbpq -c /etc -d /opt/oarc/bpq -l /opt/oarc/bpq WorkingDirectory=/opt/oarc/bpq Restart=always User=linbpq diff --git a/debian/patches/makefile b/debian/patches/makefile index 2132816..d2888a9 100644 --- a/debian/patches/makefile +++ b/debian/patches/makefile @@ -8,8 +8,8 @@ +# setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq + +install: -+ install -b -m 755 -D -d debian/usr/sbin -+ install -b -m 755 -s -p linbpq debian/usr/sbin ++ install -b -m 755 -D -d debian/linbpq/usr/sbin ++ install -b -m 755 -s -p linbpq debian/linbpq/usr/sbin -include *.d diff --git a/debian/postinst b/debian/postinst index 4289690..70eac96 100644 --- a/debian/postinst +++ b/debian/postinst @@ -26,7 +26,7 @@ if [ "$1" = configure ]; then # which allows us to install our binaries without the setuid # bit. if command -v setcap > /dev/null; then - setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" /opt/oarc/bpq/linbpq + setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" /usr/sbin/linbpq else echo "Setcap failed on /usr/sbin/linbpq, Features may be limited" >&2 fi diff --git a/debian/preinst b/debian/preinst index 8ba52dd..4dae0eb 100644 --- a/debian/preinst +++ b/debian/preinst @@ -8,5 +8,5 @@ node="/opt/oarc/bpq/bpq32.cfg" if [ -L $confile ]; then rm $confile cp $node $confile - rm $node + mv $node $node.bak fi