Skip to content

Commit

Permalink
Replaced adduser with useradd
Browse files Browse the repository at this point in the history
useradd is available in most distributions, adduser is not.

Signed-off-by: Ben Clark <ben@benjyc.uk>
  • Loading branch information
BClark09 committed Feb 18, 2017
1 parent b9054f5 commit a2c0fdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ def generate_distro_tasks = { dist, gDescription, gPackageName, gInputFile, gVer
configurationFile('/etc/default/openhab2')
configurationFile('/usr/lib/systemd/system/openhab2.service')

requires('adduser')

FileTree tar = tarTree(gInputFile)
suckUpEmptyDirectories('/var/log/openhab2', user, permissionGroup, 0755)
suckUpEmptyDirectories('/var/lib/openhab2/persistence/db4o', user, permissionGroup, 0755)
Expand Down
8 changes: 4 additions & 4 deletions resources/deb/control-runtime/preinst
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ case "$1" in
OH_GROUP=`echo ${USER_AND_GROUP} | cut -d ":" -f 2`
fi
if ! getent group "$OH_GROUP" > /dev/null 2>&1 ; then
addgroup --system "$OH_GROUP" --quiet
groupadd --system "$OH_GROUP"
fi
if ! getent passwd "$OH_USER" > /dev/null 2>&1 ; then
adduser --quiet --system --ingroup "$OH_GROUP" --no-create-home \
--disabled-password --shell /bin/false \
--gecos "openhab2 runtime user" --home /var/lib/openhab2 "$OH_USER"
adduser --quiet --system -g "$OH_GROUP" \
--shell /bin/false \
--home /var/lib/openhab2 "$OH_USER"
fi
;;
esac
Expand Down

0 comments on commit a2c0fdf

Please sign in to comment.