Bug 5705 - Need more descriptive error messages on non-root systemtap invocation
Summary: Need more descriptive error messages on non-root systemtap invocation
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-01 08:39 UTC by Ananth Mavinakayanahalli
Modified: 2008-02-05 16:03 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
More descriptive errors on non-root stap invocation (597 bytes, patch)
2008-02-01 08:43 UTC, Ananth Mavinakayanahalli
Details | Diff
More descriptive error messages on non-root stap invocation (597 bytes, patch)
2008-02-01 17:18 UTC, Jim Keniston
Details | Diff
create stapusr and stapdev groups if they don't exist (585 bytes, patch)
2008-02-04 13:36 UTC, Ananth Mavinakayanahalli
Details | Diff
Create stapusr stapdev groups if they don't exist already (549 bytes, patch)
2008-02-04 13:40 UTC, Ananth Mavinakayanahalli
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ananth Mavinakayanahalli 2008-02-01 08:39:22 UTC
Currently, stap errors out on a non-root invocation with just a:

ERROR: unable to find either group "stapdev" or group "stapusr"

Though documentation pertaining to stapdev and stapusr are part of the stap(1)
manpage, IMO it is prudent to spell out a more detailed error message here.

Also, would it make sense to automagically create stapdev and stapusr groups
during systemtap install?
Comment 1 Ananth Mavinakayanahalli 2008-02-01 08:43:14 UTC
Created attachment 2223 [details]
More descriptive errors on non-root stap invocation

Here is a stab at this. This or something along these lines would be good to
have.
Comment 2 Frank Ch. Eigler 2008-02-01 16:19:25 UTC
> Here is a stab at this. This or something along these lines would be good to
> have.

Looks good.
If one can find in e.g. the fedora packaging guidelines
information to the effect of creating new groups during
.rpm installation, we can plop such code into a new
-runtime RPM %post piece.
Comment 3 Jim Keniston 2008-02-01 17:18:35 UTC
Created attachment 2224 [details]
More descriptive error messages on non-root stap invocation

Fixed a couple of typos and added missing punctuation.
Comment 4 Ananth Mavinakayanahalli 2008-02-04 09:32:13 UTC
Thanks Jim!

I've committed Jim's version of the patch into cvs.
Comment 5 Ananth Mavinakayanahalli 2008-02-04 13:36:46 UTC
Created attachment 2229 [details]
create stapusr and stapdev groups if they don't exist

Adding it to the normal build process rather than %post would make sense for
users who'd want to locally build and install systemtap.

How about this totally untested patch to create the stapdev and stapusr groups
at install time. I am not too familiar with fiddling with Makefiles, but again,
something akin to what this does would be good. (The script snippet is adapted
from Tom Callaway's RPM packaging guidelines handout from Foss.in/2007).
Comment 6 Ananth Mavinakayanahalli 2008-02-04 13:40:28 UTC
Created attachment 2230 [details]
Create stapusr stapdev groups if they don't exist already

Minor code reorg to accomodate comment in place
Comment 7 David Smith 2008-02-04 15:06:17 UTC
(In reply to comment #2)
> Looks good.
> If one can find in e.g. the fedora packaging guidelines
> information to the effect of creating new groups during
> .rpm installation, we can plop such code into a new
> -runtime RPM %post piece.

The fedora packaging guidelines for creating users and groups is located here:

<http://fedoraproject.org/wiki/Packaging/UsersAndGroups?highlight=%28Packaging%29>

The systemtap spec file already follows the latest fedora packaging guidelines
and creates the groups at install time.  This functionality was added on
2007-08-14.  It is done in the %pre section, like this:

  %pre
  getent group stapdev >/dev/null || groupadd -r stapdev
  getent group stapusr >/dev/null || groupadd -r stapusr
  exit 0

However, after thinking about it.  This needs to be done for the
systemtap-runtime rpm, not the main systemtap rpm.  So, the %pre section has
been moved to the systemtap-runtime rpm.
Comment 8 Ananth Mavinakayanahalli 2008-02-05 05:30:32 UTC
Thanks Dave
Comment 9 Frank Ch. Eigler 2008-02-05 16:03:11 UTC
(In reply to comment #6)
> Created an attachment (id=2230)
> Create stapusr stapdev groups if they don't exist already
> Minor code reorg to accomodate comment in place

(For the record, it does not sound like a good idea to me for "make install"
to try to create system users.  Let's leave that to the packaging system, as
the committed patch does.)