Resource Manager Troubleshooting FAQ


Table of Contents

1. Resource manager features overview per distro
1.1. pre 10.0
1.2. SUSE Linux 10.0
1.3. SUSE Linux 10.1 / SLE 10
1.4. openSUSE 10.2
2. FAQ

1. Resource manager features overview per distro

1.1. pre 10.0

resmgrd reads a static device list from /etc/resmgr.conf. Some rogue hotplug scripts also add devices at run time. Access to devices only possible via libresmgr. Mostly affects cdrecord. Programs linked against system libusb transparently use libresmgr. Device ownership is changed independently from resmgr by pam_devperm on login.

1.2. SUSE Linux 10.0

resmgrd no longer uses a static list of devices. Instead the helper program hal-resmgr is called by hald to register devices in resmgrd. resmgrd now also installs ACLs for devices in the filesystem. A fallback to chown is used for the first user if filesystem ACLs are not available. dbus uses the files in /var/run/resmgr/classes/desktop/ for access control (at_console).

1.3. SUSE Linux 10.1 / SLE 10

usb devices are now regular devices in /dev rather than /proc/bus/usb. Therefore libusb no longer utilizes resmgr and relies on file system permissions for /dev/bus/usb/*

1.4. openSUSE 10.2

resmgrd no longer knows about devices at all, it only tracks user logins and manages the classes associated with logins. The helper program hal-resmgr now sets ACLs on devices and gets called by both resmgrd and hald. The now obsolete libresmgr functions for handling devices were replaced by stubs that always fail. The fallback to chown is no longer possible with hal-resmgr, therefore ACL support on /dev is mandatory. pam_devperm is no longer used, therefore a working resmgr and hal are mandatory for device access. Resmgr also notifies PolicyKit about user logins which then grants access to the 'desktop-console' privilege.

2. FAQ

2.1. How do I find out which devices are handled by (hal-)resmgr?
2.2. How can I find out whether resmgr installed proper ACLs in the file system?
2.3. How do I find out whether resmgr knows that I am logged in?
2.4. How do I list the classes I have access to?
2.5. How do I grant users permanent access to serial ports like ttyS0, ttyACM0?
2.6. Should I add users to the group uucp?
2.1.

How do I find out which devices are handled by (hal-)resmgr?

openSUSE 10.2, 10.3:

Use hal-resmgr with the --list option to list devices the current user has access to. The option --list-all lists all devices managed by hal-resmgr.

$ /usr/sbin/hal-resmgr --list-all
UDI /org/freedesktop/Hal/devices/pci_1106_3059_oss_pcm_0_0
Device /dev/audio
Class sound
...

10.1/SLE10 and older

Use resmgr with the list option to list devices the current user has access to. The option dump can be used to inpect resmgr's internal state which also contains the list of all devices known to resmgr. dump can only be used as root

$ /sbin/resmgr list
rw-- /dev/snd/pcmC0D4p
rw-- /dev/dsp
...

2.2.

How can I find out whether resmgr installed proper ACLs in the file system?

You can check the ACLs on a file with the command getfacl. The following screen shows that user "fritz" has read and write access to /dev/dsp:

$ getfacl /dev/dsp
getfacl: Removing leading '/' from absolute path names
# file: dev/dsp
# owner: root
# group: audio
user::rw-
user:fritz:rw-
group::rw-
mask::rw-
other::---

The ls shows that there are ACLs by appending a plus sign to the permissions:

$ ls -l /dev/dsp
crw-rw----+ 1 root audio 14, 3 Mar  7 16:42 /dev/dsp

2.3.

How do I find out whether resmgr knows that I am logged in?

Use resmgr with the sessions option to list all sessions of the current user. When run as root resmgr will list all sessions of all users.

$ /sbin/resmgr sessions
:0 fritz

2.4.

How do I list the classes I have access to?

openSUSE 10.2, 10.3:

Use resmgr with the classes option to list all sessions of the current user. When run as root resmgr will list all sessions of all users.

$ /sbin/resmgr classes
desktop
dvb
v4l
...

2.5.

How do I grant users permanent access to serial ports like ttyS0, ttyACM0?

Modems are the most common devices that are conneted to serial ports. Access to such ports can cost real money if a user dials expensive numbers. Therefore access to serial ports is not granted by default.

To grant the user "fritz" access to all serial ports nevertheless (replace "fritz" with the actual user name) you need create a new file for resmgr, for exapmle /etc/resmgr.conf.d/50-modem.conf. Add the following line:

allow modem user=fritz

If you don't want to grant access to all serial ports (good) just because e.g. your PDA is connected to /dev/ttyS0 you may also assign a different class to that device. Access to the class pda for example is granted by default. To change the class of /dev/ttyS0 to pda create a file /etc/hal/fdi/policy/20user/50-mypda.fdi with the following content:

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>
    <match key="linux.device_file" string="/dev/ttyS0">
      <merge key="resmgr.class" type="string">pda</merge>
    </match>
  </device>
</deviceinfo>

2.6.

Should I add users to the group uucp?

No! The group uucp is reserved for use by the uucp system. Adding users to that group grants them access to additional directories which may lead to security problems with other programs.