summaryrefslogtreecommitdiff
path: root/core/util-linux/util-linux.install
diff options
context:
space:
mode:
Diffstat (limited to 'core/util-linux/util-linux.install')
-rw-r--r--core/util-linux/util-linux.install29
1 files changed, 29 insertions, 0 deletions
diff --git a/core/util-linux/util-linux.install b/core/util-linux/util-linux.install
index 90ce5bd73..35f80e2a2 100644
--- a/core/util-linux/util-linux.install
+++ b/core/util-linux/util-linux.install
@@ -1,3 +1,20 @@
+post_install() {
+ # create user for uuidd
+ if ! getent group uuidd >/dev/null; then
+ groupadd -r uuidd
+ fi
+
+ if ! getent passwd uuidd >/dev/null; then
+ useradd -r -s /sbin/nologin -d / -g uuidd uuidd
+ fi
+
+ # we don't want use systemd-tmpfiles here because
+ # the package dependency would create a circular dep.
+ if [ ! -d run/uuidd ]; then
+ install -o uuidd -g uuidd -dm755 run/uuidd
+ fi
+}
+
post_upgrade() {
if [ "$(vercmp $2 2.21.2-4)" -lt 0 ]; then
if [ -f /var/lib/hwclock/adjtime ]; then
@@ -7,4 +24,16 @@ post_upgrade() {
rmdir /var/lib/hwclock
fi
fi
+
+ post_install
+}
+
+post_remove() {
+ if getent passwd uuidd >/dev/null; then
+ userdel uuidd
+ fi
+
+ if getent group uuidd >/dev/null; then
+ userdel uuidd
+ fi
}