diff options
| author | Nikolay Govorov <me@govorov.online> | 2026-01-12 22:51:15 +0000 |
|---|---|---|
| committer | Nikolay Govorov <me@govorov.online> | 2026-01-12 22:51:15 +0000 |
| commit | 4137072731c36a3db3af8e0bd6f718b64d439d8b (patch) | |
| tree | d688c53fc75ce2e99e68229cac0153612b13048c | |
| parent | 86c38be2510084bb4b6dd6ea181703c34742cc65 (diff) | |
| download | tar tar.gz tar.bz2 tar.lz tar.xz tar.zst zip | |
Fix packages for usage in containers without systemd
Diffstat
| -rw-r--r-- | pkg/scripts/postinstall.sh | 17 | +12 −5 |
| -rw-r--r-- | pkg/scripts/preremove.sh | 6 | +4 −2 |
2 files changed, 16 insertions, 7 deletions
diff --git a/pkg/scripts/postinstall.sh b/pkg/scripts/postinstall.sh index f6f2c15..2373a73 100644 --- a/pkg/scripts/postinstall.sh +++ b/pkg/scripts/postinstall.sh @@ -4,12 +4,19 @@ set -e -if ! getent group zorian >/dev/null; then - groupadd --system zorian +PROGRAM=zorian +ZORIAN_USER=${ZORIAN_USER:-zorian} +ZORIAN_GROUP=${ZORIAN_GROUP:-${ZORIAN_USER}} + +if ! getent group $ZORIAN_GROUP >/dev/null; then + groupadd --system $ZORIAN_GROUP fi -if ! getent passwd zorian >/dev/null; then - useradd --system --gid zorian --no-create-home --shell /usr/sbin/nologin zorian +if ! getent passwd $ZORIAN_USER >/dev/null; then + useradd --system --gid $ZORIAN_GROUP --no-create-home --shell /usr/sbin/nologin $ZORIAN_USER fi -systemctl daemon-reload +if [ -x "/bin/systemctl" ] && [ -d /run/systemd/system ] && [ -f /usr/lib/systemd/system/zorian.service ]; then + /bin/systemctl daemon-reload + /bin/systemctl enable zorian +fi diff --git a/pkg/scripts/preremove.sh b/pkg/scripts/preremove.sh index 9236820..87c062a 100644 --- a/pkg/scripts/preremove.sh +++ b/pkg/scripts/preremove.sh @@ -4,5 +4,7 @@ set -e -systemctl stop zorian.service || true -systemctl disable zorian.service || true +if [ -x "/bin/systemctl" ] && [ -d /run/systemd/system ] && [ -f /usr/lib/systemd/system/zorian.service ]; then + /bin/systemctl stop zorian.service || true + /bin/systemctl disable zorian.service || true +fi |
