Do not create nova user and group if they already exist.

This commit is contained in:
Thomas Goirand 2013-12-25 16:46:22 +08:00
parent c747497500
commit bdc57948d6
3 changed files with 26 additions and 5754 deletions

5752
debian/CHANGELOG vendored

File diff suppressed because it is too large Load Diff

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
novnc (1:0.4+dfsg+1+20131010+gitf68af8af3d-2) unstable; urgency=medium
* Do not create nova user and group if they already exist.
-- Thomas Goirand <zigo@debian.org> Wed, 25 Dec 2013 16:47:06 +0800
novnc (1:0.4+dfsg+1+20131010+gitf68af8af3d-1) unstable; urgency=low
* New upstream release (well, a more recent commit since upstream isn't

22
debian/novnc.postinst vendored
View File

@ -2,9 +2,27 @@
set -e
pkgos_adduser () {
local VAR_UG_PKG_NAME
VAR_UG_PKG_NAME=${1}
# Create user and groups if they don't exist
if ! getent group ${VAR_UG_PKG_NAME} > /dev/null 2>&1 ; then
addgroup --quiet --system ${VAR_UG_PKG_NAME}
fi
if ! getent passwd ${VAR_UG_PKG_NAME} > /dev/null 2>&1 ; then
adduser --system \
--home /var/lib/${VAR_UG_PKG_NAME} \
--no-create-home \
--quiet \
--disabled-password \
--shell /bin/bash \
--group ${VAR_UG_PKG_NAME}
fi
}
if [ "$1" = "configure" ]; then
addgroup --quiet --system nova
adduser --quiet --system --home /var/lib/nova --ingroup nova --no-create-home --shell /bin/bash nova
pkgos_adduser nova
fi
#DEBHELPER#