title: Why do calls to adduser and groupadd not work when rpm installed?
body: <p>I added the following "Pre" section to my rpm installer's build.spec.  When I install the rpm no new group or user is created?</p>
  
  <p>If I paste this into a script and run, then it works as expected.  What am I missing?</p>
  
  <p>Thanks in advance,</p>
  
  <p>-Ed</p>
  
  <p>RHEL 5.2</p>
  
  <pre><code>#######################
  # pre
  #######################
  %pre
  
  # This works when run as a script by root.  Why not from the RPM?
  if grep ^frontier: /etc/group &gt;&gt; /dev/null ; then
   : # group already exists
  else
   %{_sbindir}/groupadd frontier -g 2000
  fi
  
  if ! id diagnostics &gt;&amp; /dev/null; then 
   %{_sbindir}/adduser diagnostics -g diaguser -d /home/diagnostics -u 2001 -p secretPassword
   usermod -a -G frontier diagnostics
  fi
  </code></pre>