After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 589862 - gdm fails to start if /var/log/gdm does not exist
gdm fails to start if /var/log/gdm does not exist
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.27.x
Other Linux
: Normal minor
: ---
Assigned To: Brian Cameron
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-27 12:14 UTC by Dominic Evans
Modified: 2010-07-02 19:11 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
the change we use in ubuntu (514 bytes, patch)
2009-10-19 21:13 UTC, Sebastien Bacher
none Details | Review
updated patch that calls chown (637 bytes, patch)
2009-10-19 21:32 UTC, Brian Cameron
accepted-commit_now Details | Review

Description Dominic Evans 2009-07-27 12:14:01 UTC
Originally reported at:
  https://bugs.launchpad.net/bugs/405227

Binary package hint: gdm

If a user decides to tidy up their /var/log directory, with e.g., a sudo rm -rf /var/log/*, and removes the 'gdm' subdirectory from /var/log then gdm will refuse to start on next boot/restart.

The user will find this difficult to debug.

Ideally gdm should be capable of re-creating its own logging directory on start, rather than just weakly reporting that /var/log/gdm doesn't exist and failing to start.

i.e., either test for directory existence, and create if not found, or always do a `mkdir -p /var/log/gdm` on startup (as it won't error on directory exists anyway)

ProblemType: Bug
Architecture: amd64
Date: Mon Jul 27 11:06:40 2009
DistroRelease: Ubuntu 9.10
Package: gdm 2.27.4-0ubuntu6
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=en_GB.UTF-8
 LANGUAGE=en_GB:en
ProcVersionSignature: Ubuntu 2.6.31-4.22-generic
SourcePackage: gdm
Uname: Linux 2.6.31-4-generic x86_64
Comment 1 Ray Strode [halfline] 2009-07-28 14:28:07 UTC
makes sense.
Comment 2 Daniel Kaplun 2009-09-18 17:38:06 UTC
This needs to be marked "major".

I use an EeePC with an SSD and in order to minimize writes I set /var/log to use tmpfs in fstab. There is a large affected audience that does the same thing that I do. Many users will not know what to do.

The solution is VERY simple -- just make the directory before attempting to use itk in the GDM code.
Comment 3 Daniel Kaplun 2009-09-18 17:53:51 UTC
In fact, I don't see why GDM needs to quit if it can't log. It should just print a warning somewhere and move on.
Comment 4 Ray Strode [halfline] 2009-10-19 15:20:25 UTC
I'd definitely take a patch that did g_mkdir_with_parents or whatever...  Otherwise, i'll write it at some point.   This is a niche problem though.  It's not unreasonable for an application to expect /var/log exists.

Trivial workaround is to mkdir -p /var/log in /etc/rc.local.
Comment 5 Daniel Kaplun 2009-10-19 15:34:49 UTC
The problem has been fixed.
Comment 6 Sebastien Bacher 2009-10-19 21:13:07 UTC
Created attachment 145806 [details] [review]
the change we use in ubuntu
Comment 7 Brian Cameron 2009-10-19 21:32:55 UTC
Created attachment 145809 [details] [review]
updated patch that calls chown


It's better to call chown() after g_mkdir to ensure the permissions are set properly.
Comment 8 Brian Cameron 2009-10-19 21:34:46 UTC
Oops, I mean the updated patch calls g_chmod(), not chown().
Comment 9 Ray Strode [halfline] 2009-10-19 21:54:02 UTC
Review of attachment 145809 [details] [review]:

seems fine to me...
Comment 10 Brian Cameron 2009-10-19 21:56:44 UTC
Fixed in master, and in the 2.28.1 release.