gnome-session-properties fails to create entries if .config/autostart is missing

Bug #258145 reported by James Westby
4
Affects Status Importance Assigned to Milestone
gnome-session
Fix Released
High
gnome-session (Ubuntu)
Fix Released
Low
Ubuntu Desktop Bugs

Bug Description

Binary package hint: gnome-session

Hi,

I'm running Intrepid, and I couldn't add autostarted applications. I would
enter all of the details, and it would be in the list, but closing and re-opening
the tool would make the entry vanish.

Running from a terminal showed a message that
.config/autostart/whatever.desktop could not be created, quick investigation
showed that .config/autostart/ didn't exist. Once I created it everything worked.

I think the .config/autostart/ should be created by the tool.

Thanks,

James

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Confirmed here.

chr1s@chris-ubuntuvm:~$ apt-cache policy gnome-session
gnome-session:
  Installed: 2.23.6-0ubuntu1
  Candidate: 2.23.6-0ubuntu1
  Version table:
 *** 2.23.6-0ubuntu1 0
        500 http://gb.archive.ubuntu.com intrepid/main Packages
        100 /var/lib/dpkg/status

Steps to reproduce:
1. Delete ~/.config/autostart if it exists (or move it if you want to retain its contents)
2. Open gnome-session-properties in terminal
3. Add an entry

What should happen:
1. gnome-session-properties should happily create the folder ~/.config/autostart and add a new .desktop file to it

What actually happens:
1. gnome-session-properties fails to create our new .desktop file and spits out the following error:

** (gnome-session-properties:6053): WARNING **: Could not save /home/chr1s/.config/autostart/firefox.desktop file

If you manually add ~/.config/autostart before you try to add the new session entry, then it works. ~/.config/autostart isn't present on a fresh user profile

Changed in gnome-session:
status: New → Confirmed
Revision history for this message
James Westby (james-w) wrote : Re: [Bug 258145] Re: gnome-session-properties fails to create entries if .config/autostart is missing

On Fri, 2008-08-15 at 13:32 +0000, Chris Coulson wrote:
> Confirmed here.

Thanks Chris,

Looking at the code, it attempts to ensure the directory exists,
and so I'm not sure why it is failing.

Thanks,

James

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

I'm not sure either. I've forwarded it upstream as well.

Thanks
Chris

Changed in gnome-session:
status: Unknown → New
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

James

There is a function ensure_user_autostart_dir () which creates the autostart folder, but that is never called when you create a new session entry. All of the work to create the .desktop file is done in key_file_to_file (), which doesn't actually create the folder.

The attached debdiff fixes this. Tested here and it seems to work as expected.

Revision history for this message
James Westby (james-w) wrote :

Hi Chris,

Sorry, I also created a patch for this issue, I was just slow in uploading
it here.

My fix uses the existing function you found, but does it at a higher level,
the same level at which it is done for some other functions that create
.desktop files (write_desktop_file and delete_desktop_file).

I think reusing the existing function is better, but I'm not sure what
is the best level to put it at. I think it's something upstream
should decide, but which patch do you think we should forward
as a suggestion?

Thanks,

James

Changed in gnome-session:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: Confirmed → Triaged
Revision history for this message
James Westby (james-w) wrote :

Hi,

Milestoning for Intrepid so that we can fix this if needed.

Thanks,

James

Changed in gnome-session:
milestone: none → ubuntu-8.10-beta
Revision history for this message
James Westby (james-w) wrote :

Hi,

This is now fixed upstream.

Thanks,

James

Changed in gnome-session:
status: Triaged → Fix Committed
Changed in gnome-session:
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-session - 2.23.90-0ubuntu1

---------------
gnome-session (2.23.90-0ubuntu1) intrepid; urgency=low

  * New upstream version:
    - Remove inhibitors for the client when it disconnects
    - Add log/debugging framework
    - Add signal handling framework
    - Add support for stopping/killing apps
    - Add command line option to override autostart dirs
    - Improve QES,ES,CES error handling
    - Remove gnome-login-sound
    - Rework the capplet dialogs to use gobject.
    - Make gnome-session-save tool use D-Bus API
    - Fixed #521413, Fixes for sparse warnings in gnome-session
    - Fixed #546410, splash no longer disappear (lp: #258046)
    - Fixed #546439, missing include for pid_t
    - Fixed #546722, Need bump dbus-glib dependency to 0.76
    - Fixed #546896, crash wen passing null strings
      to key_file_set_locale_string
    - Fixed #547069, [patch] Logout by sending XSMP SaveYourselfRequest
      is broken
    - Fixed #547443, crashes on desktop parsing errors
    - Fixed #547619, gnome-session 2.23.6 doesn't compile on Solaris
    - Fixed #547769, part of gnome-wm potentially can break
    - Fixed #548129, gnome-session-properties
      doesn't create ~/.config/autostart (lp: #258145)
    - Fixed #548259, g-s thinks that metacity is 'not responding'
      if it was --replace'd
  * debian/control.in:
    - updated dbus-glib requirement
  * debian/patches/80_correct_gerror_use.patch:
    - the issue is fixed in the new version

 -- Sebastien Bacher <email address hidden> Wed, 20 Aug 2008 21:15:53 +0200

Changed in gnome-session:
status: Fix Committed → Fix Released
Changed in gnome-session:
importance: Unknown → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.