From 7eacf20f84103483d8b69bc3131435979d498850 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 11 Jan 2016 02:18:08 +0100 Subject: also create special user for vanity to run as --- debian/changelog | 6 ++++++ debian/vanity.postinst | 12 ++++++++++++ debian/vanity.postrm | 17 +++++++++++++++++ debian/vanity.service | 2 ++ 4 files changed, 37 insertions(+) create mode 100644 debian/vanity.postinst create mode 100644 debian/vanity.postrm diff --git a/debian/changelog b/debian/changelog index 5c444a6..fc4c587 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +vanity (0.1.1-2) UNRELEASED; urgency=medium + + * create special user for vanity + + -- Christian Pointner Mon, 11 Jan 2016 02:17:37 +0100 + vanity (0.1.1-1) unstable; urgency=medium * Initial release. diff --git a/debian/vanity.postinst b/debian/vanity.postinst new file mode 100644 index 0000000..c6f9aba --- /dev/null +++ b/debian/vanity.postinst @@ -0,0 +1,12 @@ +#!/bin/sh +# postinst script for vanity + +set -e + +if [ "$1" = "configure" ]; then + adduser --quiet --system --group --no-create-home --home /var/lib/vanity vanity +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/vanity.postrm b/debian/vanity.postrm new file mode 100644 index 0000000..96bb01d --- /dev/null +++ b/debian/vanity.postrm @@ -0,0 +1,17 @@ +#!/bin/sh +# postrm script for vanity + +set -e + +#DEBHELPER# + +if [ "$1" = "purge" ] ; then + if [ -x "$(command -v deluser)" -a -x "$(command -v delgroup)" ]; then + deluser --quiet --system vanity || true + delgroup --quiet --system vanity || true + else + echo "Not removing vanity user and group: adduser package not found." >&2 + fi +fi + +exit 0 diff --git a/debian/vanity.service b/debian/vanity.service index c66620b..a22a624 100644 --- a/debian/vanity.service +++ b/debian/vanity.service @@ -3,6 +3,8 @@ Description=make go packages gettable [Service] ExecStart=/usr/bin/vanity -addr localhost:9192 -repo-root https://git.helsinki.at -vanity-root https://code.helsinki.at +User=vanity +Group=vanity Restart=on-failure PrivateTmp=yes PrivateDevices=yes -- cgit v1.2.3