Package: slurm-llnl
Version: 1.2.20-1
Severity: important
Tags: patch

Hi Gennaro,

I have noticed an issue with preinst failing if the user "slurm" does not
exist on the system while upgrading.

Usually, this should not happen at all because the user is created when the
package is installed. In our installation however, the user "slurm" was
exported via NIS which worked fine. Due to changes in our NIS setup the user
was not exported anymore and therefore missing. The current preinst does not
cover this situation and the call to id returns with an error code of 1 which
makes preinst fail. The attached patch fixed the issue for me. I also silenced
id on error, you have to decide if that's useful change or not.

I think this is a quite unusal corner case, however, it can happen. Thanks
for your work on the package!

Best regards
Manuel


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (200, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
diff -Nur slurm-llnl-1.2.20.orig/debian/preinst slurm-llnl-1.2.20/debian/preinst
--- slurm-llnl-1.2.20.orig/debian/preinst       2008-01-07 17:19:38.000000000 
+0100
+++ slurm-llnl-1.2.20/debian/preinst    2008-01-07 17:29:49.000000000 +0100
@@ -21,10 +21,12 @@
     ;;
 
     upgrade)
-      SLURMUID=$(id -u slurm)
-      SLURMGID=$(id -g slurm)
-      if [ "$SLURMUID" != "64030" ] || [ "$SLURMGID" != x"64030" ] ; then
-        deluser --quiet slurm
+      if [ $(id -u slurm 2>/dev/null) ]; then
+        SLURMUID=$(id -u slurm 2>/dev/null)
+        SLURMGID=$(id -g slurm 2>/dev/null)
+        if [ "$SLURMUID" != "64030" ] || [ "$SLURMGID" != x"64030" ] ; then
+          deluser --quiet slurm
+        fi
       fi
       adduser --quiet --system --group --uid 64030 --no-create-home slurm
     ;;

Reply via email to