What I have to run for my custom environment on Fedora 16

March 8, 2012

As an example of what a custom environment needs on a modern Linux desktop, here is a list of all of the various things I need to do and run to make my custom environment work on Fedora 16.

  • I start my X session by hand from a text login, which means that my startup script has to run some extra programs. The details of this are unchanged since Fedora 8 and probably don't apply to anyone else.

    (If you need to know this sort of stuff, poke around in /etc/X11/xinit.)

  • Sound requires some PulseAudio stuff, which right now I am running as:
    pulseaudio --start --log-target=stderr &
    pactl load-module module-x11-publish display=$DISPLAY
    pactl load-module module-x11-cork-request display=$DISPLAY

    (Some research from writing this entry suggests that the simpler way is to run start-pulseaudio-x11.)

    However, in Fedora 16 there is some extra permissions step that I'm missing; doing just this still leaves the audio devices inaccessible, with only group access permissions for the Unix group audio. As a brute force hack to get my environment functioning on Fedora 16 I just put myself in the audio group in /etc/group.

    (I suspect that there is some PAM or ConsoleKit magic that has been added in Fedora 16. However, I don't know where it would be hiding.)

  • Various programs want to be able to pop up notifications about things, using a freedesktop.org protocol for this. To support this I need to run /usr/libexec/notification-daemon.

  • Volume management for things like USB memory keys and DVD-ROMs is no longer handled by the nicely convenient halevt, because HAL itself is deprecated and basically gone. Instead I have to run /usr/libexec/gnome-fallback-mount-helper, which is more annoying and much less flexible (but, apparently, the standard way to handle this).

    In Fedora 16, plain umount from an ordinary user account seems to be able to unmount these automatically mounted things.

    (I use gnome-control-center to set all removable devices to 'never do anything when inserted'. This just mounts them if applicable and doesn't try to helpfully start player programs or whatever.)

  • I run stalonetray to create a 'system tray', which is where various programs want to stick their little notification icons and controls. Unfortunately this no longer seems to be packaged in Fedora 16; I have it from the Fedora 15 repo, which is one patch behind the official version.

    (Fedora 16 doesn't seem to have any packaged system tray alternatives. There are alternatives to stalonetray, but none that I have any experience with.)

  • I have not found a native Fedora 16 volume control applet that I like. As a result I am still using a Fedora 14 binary of gnome-volume-control-applet, which continues to work better than any of the alternatives.

    (There are several programs packaged for Fedora 16 that are close, but they all have glitches and irritations when run under my FVWM configuration.)

  • I run abrt-applet to get the little notifications of crashes (or at least in theory get the little notifications; I haven't seen any recently).

There are a couple of other applets that I don't run because they're not applicable to me but other people will probably want. nm-applet is the famous (or infamous) front end to NetworkManager, which you will really want on any laptop or other mobile machine. seapplet is the SELinux problem notification applet, which you will want if you use SELinux. Some research suggests that /usr/libexec/gnome-settings-daemon is probably also important if you want more Gnome stuff. I don't know about KDE.

(I don't know what applet or program handles power management; it's possible that gnome-settings-daemon handles this in the Gnome world.)

Poking around my Fedora 16 systems suggests that a lot of this can be dug out of /etc/xdg/autostart and perhaps also bits from /usr/share/gnome-session/sessions/. Looking through the former has been interesting and vaguely educational, although I can't say I understand what all of the various programs are supposed to do.


Comments on this page:

From 79.216.138.138 at 2012-03-09 16:54:16:

I don't bother with half of that. I used to use halevt but when it broke I just added entries in /etc/fstab with the user mount option for my own SD cards and memory sticks. I believe you can get stuff automounted with udev rules directly and there are some solutions based on udisks.

I never had much success with pulseaudio and ended up just uninstalling it and leaving stuff to use alsa directly. Does it really offer any advantages? For volume control, I've simply bound the extra keys on my keyboard.

From 188.226.51.71 at 2012-03-11 08:06:10:

Several points about your setup came to mind:

1) Vanilla "startx" from one VT, starting X on another, is not supported by systemd.

I don't use fedora, and I've bumped into some problems regarding X switching VT on start. In the past, I've got "we don't support it atm" response in #systemd, but looks like it was discussed on #fedora-devel and #systemd just about the time / the day after this post (mezcalero == Lennart):

<mezcalero> coling: we had some discussion about startx on #fedora-devel the other day
<mezcalero> coling: so we found a very simple way to bring startx back in a sane way
<mezcalero> the idea is that startx should not attempt to open a new VT
<mezcalero> but instead simply "convert" the existing session on the existing VT
<mezcalero> it should just invoke X with -noswitchvt (or how that switch is called)
<mezcalero> so that the X runs on the same VT as the invoking bash
<mezcalero> and then all the access control will work

So I thought you might still bump into that, xserverrc is the solution.

In fact, permissions for sound card should be set by systemd-logind (in late systemd versions, not sure which one is in F16), so your problem with permissions for pulse might be direct result of that.

2) Why do you need to start pulseaudio by hand at all?

I mean, everything that links against pulse has "connect or start" behavior, and libasound_module_*_pulse.so starts pulse for any app that tries to use alsa.

3) I heard fedora devs went gung-ho on disabling stuff started from anywhere but systemd, but doesn't notification-daemon has systemd-enabled dbus service file to auto-start on first message received? (and die in a while if everything's quiet)

By cks at 2012-03-20 00:07:21:

A quick note: I tried changing my startx code to start the X server on the same VT as my login and it did make the permissions issues with audio (and DVD burning) go away. Unfortunately it appears to break volume management through gnome-fallback-mount-helper. I have no idea why and in the modern Linux way, it is somewhere between very challenging and impossible for ordinary people to debug this.

Written on 08 March 2012.
« The hard part of custom environments on Fedora (or any Linux)
Why you do not want to patch your source code in place »

Page tools: View Source, View Normal, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Thu Mar 8 23:31:17 2012
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.