[collectd] exec plugin: Setting the group-ID

Florian Forster octo at verplant.org
Mon Feb 18 19:27:44 CET 2008


On Fri, Feb 15, 2008 at 10:51:48AM +0100, Peter Holik wrote:
> I think collect handles groupid's wrong.

the exec plugin first calls `setgid' with the default group-id of the
user and then `setegid' with the configured group.

Assuming that the group of the `nobody' user is `nogroup'. Depending on
whether collectd runs as root or not, the executed program has the
following GIDs set:
- collectd is root:
  * real GID:      nogroup
  * effective GID: dialout
  * saved set-GID: nogroup
- collectd is nobody:
  * real GID:      <not changed>
  * effective GID: dialout
  * saved set-GID: <not changed>

For any other options, such as starting collectd with the set-GID bit
set, I recommend Stevens `APUE'[*].

So, what is the problem you experience? I assume you have some device
like /dev/ttyS0 with permissions similar to:
  crw-rw---- 1 root dialout 4, 64 2008-02-18 12:14 /dev/ttyS0
Thus the spawned process needs to be in group `dialout' to be able to
read from the device. This should be possible with the effective GID set
to `dialout'.


[*] <http://www.kohala.com/start/apue.html>
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080218/f4339c0d/attachment.pgp 

More information about the collectd mailing list