From bac3b3c64b2d6982a5182de38d43715983fa515f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Wed, 22 Jun 2022 12:29:41 +0200 Subject: [PATCH] debian: put binaries in sbin, libexec builder-db and builder-migrations require privileges, and builder-web is expected to be run from systemd. --- packaging/debian/builder-web.service | 2 +- packaging/debian/create_package.sh | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packaging/debian/builder-web.service b/packaging/debian/builder-web.service index 2835d92..8195660 100644 --- a/packaging/debian/builder-web.service +++ b/packaging/debian/builder-web.service @@ -6,7 +6,7 @@ After=syslog.target network.target Type=simple User=builder Group=builder -ExecStart=/usr/bin/builder-web +ExecStart=/usr/libexec/builder-web [Install] WantedBy=multi-user.target diff --git a/packaging/debian/create_package.sh b/packaging/debian/create_package.sh index 235bd19..d8d48d7 100755 --- a/packaging/debian/create_package.sh +++ b/packaging/debian/create_package.sh @@ -11,18 +11,19 @@ basedir=$(realpath "$(dirname "$0")"/../..) bdir=$basedir/_build/install/default/bin tmpd=$basedir/_build/stage rootdir=$tmpd/rootdir -bindir=$rootdir/usr/bin +sbindir=$rootdir/usr/sbin systemddir=$rootdir/usr/lib/systemd/system debiandir=$rootdir/DEBIAN +libexecdir=$rootdir/usr/libexec trap 'rm -rf $tmpd' 0 INT EXIT -mkdir -p "$bindir" "$debiandir" "$systemddir" +mkdir -p "$sbindir" "$debiandir" "$systemddir" "$libexecdir" # stage app binaries -install $bdir/builder-web $bindir/builder-web -install $bdir/builder-migrations $bindir/builder-migrations -install $bdir/builder-db $bindir/builder-db +install "$bdir/builder-web" "$libexecdir/builder-web" +install "$bdir/builder-migrations" "$sbindir/builder-migrations" +install "$bdir/builder-db" "$sbindir/builder-db" # service script install -m 0644 $basedir/packaging/debian/builder-web.service $systemddir/builder-web.service