1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#!/bin/sh
set -e
# upgrade existing libuuid user/group.
if getent group libuuid >/dev/null && ! getent group uuidd >/dev/null ; then
groupmod --new-name uuidd libuuid
fi
if getent passwd libuuid >/dev/null && ! getent passwd uuidd >/dev/null ; then
# attempt to stop potentially running uuidd, otherwise usermod will fail.
invoke-rc.d --quiet uuidd stop || true
# rename user, change shell and set new homedir.
usermod --login uuidd --shell /bin/false --home /run/uuidd libuuid
# attemp cleanup of old home directory.
[ -d /var/lib/libuuid ] && \
rmdir --ignore-fail-on-non-empty /var/lib/libuuid
fi
# add uuidd user/group if needed.
if ! getent group uuidd >/dev/null; then
addgroup --system uuidd
fi
if ! getent passwd uuidd >/dev/null; then
adduser --system --ingroup uuidd \
--home /run/uuidd --no-create-home \
uuidd
fi
#DEBHELPER#
|