From 89cc4b1d344065e4d6c76f2586bf35f0b135d46e Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Wed, 16 Dec 2015 18:20:50 -0500 Subject: [PATCH] Moved adduser from preinst to postinst --- distros/debian/control | 1 + distros/debian/openalpr-daemon.postinst | 5 +++++ distros/debian/openalpr-daemon.preinst | 10 ---------- 3 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 distros/debian/openalpr-daemon.preinst diff --git a/distros/debian/control b/distros/debian/control index aade87b..9209d65 100644 --- a/distros/debian/control +++ b/distros/debian/control @@ -51,6 +51,7 @@ Package: openalpr-daemon Section: video Architecture: amd64 Depends: libopenalpr2 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, + adduser, beanstalkd Description: Daemon to run OpenALPR in the background OpenALPR is an open source Automatic License Plate Recognition library written diff --git a/distros/debian/openalpr-daemon.postinst b/distros/debian/openalpr-daemon.postinst index 661f3aa..aa69e55 100644 --- a/distros/debian/openalpr-daemon.postinst +++ b/distros/debian/openalpr-daemon.postinst @@ -4,6 +4,11 @@ set -e # Source debconf library. . /usr/share/debconf/confmodule +# Create openalpr:openalpr if it doesn't already exist +USER=openalpr +GROUP=openalpr +getent group $GROUP >/dev/null || addgroup $GROUP >/dev/null +getent passwd $USER >/dev/null || adduser --system --no-create-home --home /nonexistent $USER >/dev/null chown openalpr:openalpr /var/lib/openalpr/plateimages diff --git a/distros/debian/openalpr-daemon.preinst b/distros/debian/openalpr-daemon.preinst deleted file mode 100644 index 574b991..0000000 --- a/distros/debian/openalpr-daemon.preinst +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e - -# Create openalpr:openalpr if it doesn't already exist -USER=openalpr -GROUP=openalpr -getent group $GROUP >/dev/null || addgroup $GROUP >/dev/null -getent passwd $USER >/dev/null || adduser --system --no-create-home $USER >/dev/null - -#DEBHELPER#