Browse Source

adduser libreant

che iddio ce la mandi bona
boyska 8 years ago
parent
commit
e6ee1d96df

+ 6 - 0
debian/changelog

@@ -1,3 +1,9 @@
+libreant (0.3-6) testing; urgency=medium
+
+  * libreant system user
+
+ -- boyska <piuttosto@logorroici.org>  Fri, 15 Jan 2016 23:43:57 -0500
+
 libreant (0.3-5) testing; urgency=medium
 
   * configuration fixed

+ 1 - 1
debian/python-libreant.libreant.service

@@ -3,7 +3,7 @@ Description=book sharing solution
 Documentation=https://libreant.readthedocs.org/en/v0.3/
 
 [Service]
-User=nobody
+User=libreant
 Environment=LIBREANT_SETTINGS=/etc/libreant/libreant.conf
 ExecStart=/usr/bin/libreant
 

+ 32 - 0
debian/python-libreant.postinst

@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -eu
+
+USER="libreant"
+GROUP="$USER"
+
+case "${1}" in
+	configure)
+		adduser \
+			--system \
+			--home /var/lib/libreant \
+			--quiet \
+			--group \
+			${USER} || true
+
+		mkdir -p '/var/lib/libreant/fsdb'
+		chown -R ${USER}:${GROUP} '/var/lib/libreant/fsdb'
+		;;
+
+	abort-upgrade|abort-remove|abort-deconfigure)
+		;;
+
+	*)
+		echo "postinst called with unknown argument \`${1}'" >&2
+		exit 1
+		;;
+esac
+
+#DEBHELPER#
+
+exit 0

+ 10 - 0
debian/python-libreant.postrm

@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+if [ "${1}" = "purge" ]
+then
+	userdel libreant || true
+fi
+
+#DEBHELPER#