Mailinglist Archive: opensuse-buildservice (312 mails)

< Previous Next >
[opensuse-buildservice] Query re 'useradd' and 'userdel' commands.
  • From: <doiggl@xxxxxxxxxxxxxxxxxx>
  • Date: Wed, 22 Jul 2009 21:39:41 +1000
  • Message-id: <b325841f965331d8a072cc8725ea1c13@xxxxxxxxxxxxxxxxxxxxxxx>
Hello,
Another application I'm interested in building is called Cricket v1.0.5
Home url: http://cricket.sourceforge.net/
GPL: http://cricket.sourceforge.net/license.php
Documentation: http://cricket.sourceforge.net/support/doc/
Download: http://cricket.sourceforge.net/download/

So far its unpacked and it fails on command useradd and I suspect the
userdel command will fail too.

The build log so far says:

Checking for unpackaged file(s): /usr/lib/rpm/check-files
/var/tmp/cricket-1.0.5-11.1-root
Checking for unpackaged file(s): /usr/lib/rpm/check-files
/var/tmp/cricket-1.0.5-11.1-root
Wrote: /usr/src/packages/SRPMS/cricket-1.0.5-11.1.src.rpm
Wrote: /usr/src/packages/RPMS/x86_64/cricket-1.0.5-11.1.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.11461
+ umask 022
+ cd /usr/src/packages/BUILD
+ cd cricket-1.0.5
+ /bin/rm -rf /var/tmp/cricket-1.0.5-11.1-root
+ exit 0
... checking for files with abuild user/group
... running 00-check-install-rpms
... installing all built rpms
Preparing packages for installation...
/var/tmp/rpm-tmp.11461: line 3: useradd: command not found
error: %pre(cricket-1.0.5-11.1.x86_64) scriptlet failed, exit status 127
error: install: %pre scriptlet failed (2), skipping cricket-1.0.5-11.1
failed to install rpms, aborting build
System halted.

The spec file (cricket.spec&) has in it:

%pre
id cricket >/dev/null 2>&1
if [ $? -ne 0 ]; then
useradd -r -d %{_libdir}/%{name} -c "Cricket SNMP Monitor" cricket
fi

%postun
if [ $1 -eq 0 ]; then
userdel cricket
fi

Other info:
# which useradd
/usr/sbin/useradd
# which userdel
/usr/sbin/userdel

Build log ->
https://build.opensuse.org/package/live_build_log?arch=x86_64&package=cricket&project=home%3Adoiggl&repository=openSUSE_Factory
cricket.spec ->
https://build.opensuse.org/package/view_file?file=cricket.spec&package=cricket&project=home%3Adoiggl

Question: How can I ensure the 'useradd' and 'userdel' routines in the %pre
and %postun sections run without error and do I get those commands enabled
?.

Thanks Glenn

--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >