Skip to content

Are you ready to take the autostart challenge?

Now, here’s one for the masochistic types out there: As far as I can tell, there is no way to for an application to be installed such that it will startup as part of every user’s session the next time they log in to GNOME. Mark can probably tell me if this is absolutely true or not, but if there’s a way, I can’t find it.

On windows you can add an entry to HKLM/Run and in KDE you can stick a .desktop file into /opt/kde/share/autostart. I know Mark’s vision for the future of gnome-session includes this revolutionary capability, but for right now, it seems I’m not going to get anywhere fast. So, what can we do? There’s a half measure that can be taken, which is to edit the default.session but this will only affect users who log in for the first time after installation, which won’t be the common case. On top of that it doesn’t seem possible to add non-session-aware programs this way. gnome-session does know how to read the session-manual file but that’s per user and there’s no system wide equivalent.

We’re currently experimenting with having our system daemon detect that a user logged in and then launching the per-user process on their behalf. But this is limited because you can only reliably detect ?DM managed logins (as opposed to startx or similar) and the launched process will lack the full environment of the session.

So, the question I’m posing: Is there a proper way to install an auto-start app for GNOME? If not, are there saner alternatives to the current plan?

Update: Just to clarify: I know that the session supports restarting running applications – I’m saying I can’t find a way to say that an application should start, for the first time, the next time a user logs in.

{ 19 } Comments

  1. Matthias Clasen | 8th November 2005 at 14:10 | Permalink

    If your application uses GnomeClient, saving the session should be enough to make it restart (gnome-session-save). For everybody else, start gnome-session-properties, go to
    startup programs, and click “add”.

    This is not to say we don’t need a “one-click” autostart facility, just to defeat the claim that
    XSMP does not support restarting clients inside a session. It has done this since ca. 1986

  2. Philip Langdale | 8th November 2005 at 15:00 | Permalink

    I’m certainly not claiming that XSMP doesn’t support restart, but we want to avoid the step of requiring the user to manually run something, even if it’s only once. But it looks like that’s exactly what we’re going to have to do.

  3. James Henstridge | 8th November 2005 at 15:15 | Permalink

    Note that if you are missing the environment, that cuts you off from the session manager and the D-Bus session bus. While you might not care about the first, the second is likely to become more important in the future.

  4. Philip Langdale | 8th November 2005 at 15:17 | Permalink

    Absolutely, and that’s why it’s a serious problem. In fact, we are more concerned about the session manager information as we need to know what desktop environment is running for some decisions.

  5. John (J5) Palmieri | 8th November 2005 at 15:21 | Permalink

    There is a spec on Freedesktop.org that I helped co-author, well more like made sure it didn’t spin wildly out of control. Unfortunatly the archives seems to have cut the attachments http://lists.freedesktop.org/archives/xdg/2005-July/007138.html but you can e-mail waldo for a copy or if you are subscribed to xdg search your inbox.

  6. Staz | 8th November 2005 at 16:51 | Permalink

    On Windows you can also add a link to an application into a directory and it will start automatically. this some what make me feel like our /etc/init.d and make me wonder why did Gnome decide to be more complicated

  7. Dave Meikle | 8th November 2005 at 17:21 | Permalink

    What about the default session file /usr/share/gnome/default.session ?

    Not sure if that would be any use to you, or if it gets overridden by users ones – just of the top of my head.

  8. Philip Langdale | 8th November 2005 at 18:17 | Permalink

    As I mentioned, default.session is the skel used for a first time login but it is not referenced after that. It’s also problematic because you can’t add session-unaware programs to it – and our program happens to fall into that category

  9. Ross | 9th November 2005 at 01:24 | Permalink

    Philip: there is no way. gnome-cups-manager and eggcups hit this long ago: all distributions that ship it have to modify the default.session and include a big note saying that if your session is modified you lose. Very sucky.

  10. herzi | 9th November 2005 at 03:54 | Permalink

    That’s what I use for quite some time:

    System -> Settings -> Session -> Startup Programs -> Add

  11. Gergely Nagy | 9th November 2005 at 03:56 | Permalink

    As a temporary measure you could (manually) add a script to all the sessions, which checks a dir/file and starts extra services from there as they are added later.

  12. Rodrigo Moya | 9th November 2005 at 08:56 | Permalink

    There is a patch for Fedora that runs .desktop files from $XDG_DATA_DIRS. That has some problems, which I’m trying to fix and, once finished, submit upstream. If you want the patch, just send me a mail (rodrigo at gnome-db.org)

  13. Philip Langdale | 9th November 2005 at 09:13 | Permalink

    Rodrigo, while that’s a promising step towards the future (and it sounds like patch is based on the spec that J5 was talking about), it doesn’t help us as we need an approach that works with what’s out there today. It looks like we’ll just have to document that the user has to run the program once.

  14. Rodrigo Moya | 9th November 2005 at 10:20 | Permalink

    The patch applies perfectly to 2.12, which is what’s out there today.

  15. Philip Langdale | 9th November 2005 at 19:54 | Permalink

    Sure, but I can’t ship a product to customers and say “patch your GNOME before installing this” :-)

  16. Rodrigo Moya | 10th November 2005 at 04:59 | Permalink

    Why can’t you ship a patched package?

  17. Philip Langdale | 10th November 2005 at 09:01 | Permalink

    Bundle a patched gnome-session? Even we wouldn’t do that. In any case, it’s just not practical given the number of distributions that we support; the amount of work required to patch the separate versions and then create valid packages for each distro would be mind-boggling – never mind the implications of switching out one of the core system packages out from under the user; It’s one thing to ship a private copy of Gtk that only we use – quite another to change something that affects the whole system.

  18. clive darra | 11th November 2005 at 06:54 | Permalink

    In a CentOS 3 / 4 Red Hat RHEL 3 / 4 Gnome guest its
    Applications | Preferences | More Preferences | Sessions | Startup Programs | Add | vmware-toolbox

    But how do you start it minimised ?

  19. Brian | 13th November 2005 at 16:18 | Permalink

    To start vmware toolbox minimized:

    $ vmware-toolbox –minimize

{ 1 } Trackback

  1. VMware Workstation 6.0 at Wubble | 14th May 2007 at 09:57 | Permalink

    [...] and the existing ones become actively implemented. Readers with long memories will remember when I bemoaned the lack of support for the autostart spec in GNOME – it went in with 2.14, so now it’s [...]