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?
If I paste this into a script and run, then it works as expected. What am I missing?
Thanks in advance,
-Ed
RHEL 5.2
#######################
# pre
#######################
%pre
# This works when run as a script by root. Why not from the RPM?
if grep ^frontier: /etc/group >> /dev/null ; then
: # group already exists
else
%{_sbindir}/groupadd frontier -g 2000
fi
if ! id diagnostics >& /dev/null; then
%{_sbindir}/adduser diagnostics -g diaguser -d /home/diagnostics -u 2001 -p secretPassword
usermod -a -G frontier diagnostics
fi