Whamcloud - gitweb
debian: Use useradd and groupadd in favor of adduser
authorTheodore Ts'o <tytso@mit.edu>
Tue, 1 Jan 2008 03:22:46 +0000 (22:22 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 1 Jan 2008 03:35:18 +0000 (22:35 -0500)
The adduser package is 'important', and while it is often installed,
we can't guarantee that it will always be there.  A required package,
or a package which is dragged in by a required package, such as
libuuid1, shouldn't depend on an 'important' package since that would
implicitly make it be required, which shouldn't be done unless
absolutely necesary.

So we replace the call to adduser with the lower-level useradd and
groupadd programs.  They are part of the passwd package, which is
required to be on all Debian systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debian/libuuid1.postinst
debian/uuid-runtime.postinst

index 8559ffc..9d8bcf3 100644 (file)
@@ -1,8 +1,9 @@
 #!/bin/sh
 
-adduser --system --group --no-create-home --disabled-login \
-       --quiet --home /var/lib/libuuid libuuid
+groupadd -f -K GID_MIN=1 -K GID_MAX=999 libuuid
+if ! grep -q libuuid /etc/passwd; then
+   useradd -d /var/lib/libuuid -K UID_MIN=1 -K UID_MAX=499 -g libuuid libuuid
+fi
 mkdir -p /var/lib/libuuid
 chown libuuid:libuuid /var/lib/libuuid
 chmod 2775 /var/lib/libuuid
-
index 8d3be77..b7e4d0b 100644 (file)
@@ -1,6 +1,8 @@
 #!/bin/sh
 
-adduser --system --group --no-create-home --disabled-login \
-       --quiet --home /var/lib/libuuid libuuid
+groupadd -f -K GID_MIN=1 -K GID_MAX=999 libuuid
+if ! grep -q libuuid /etc/passwd; then
+   useradd -d /var/lib/libuuid -K UID_MIN=1 -K UID_MAX=499 -g libuuid libuuid
+fi
 chown libuuid:libuuid /usr/sbin/uuidd
 chmod 6755 /usr/sbin/uuidd