Skip to content
Snippets Groups Projects
Commit 069309d3 authored by Andreas Henriksson's avatar Andreas Henriksson
Browse files

Rename libuuid user to uuidd in libuuidd1 postinst as well

Just in case the user doesn't have uuid-runtime installed
duplicate the postinst part converting the user to
make sure everyone gets converted over.

This should be dropped once it has shipped in a stable release.
parent c7c74eb8
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
set -e
##########################################################################
# This is a partial copy of uuid-runtime.postinst just to make sure #
# everyone gets their user renamed (even if they don't have uuid-runtime #
# installed). This package used to create the user in the first place, #
# but no longer uses it and all handling has been moved to uuid-runtime. #
# This (entire file?) should be dropped after this code has shipped in a #
# Debian Stable release (so we know everyone has been migrated). #
##########################################################################
# 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
# switch existing libuuid user to not have a login shell.
if [ "$(getent passwd libuuid | cut -d: -f7)" = "/bin/sh" ]; then
chsh -s /bin/false libuuid
fi
# rename user and set new homedir.
usermod --login uuidd --home /run/uuidd libuuid
# attemp cleanup of old home directory.
[ -d /var/lib/libuuid ] && \
rmdir --ignore-fail-on-non-empty /var/lib/libuuid
fi
#DEBHELPER#
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment