when upstart init the session jobs, it should be robust against environment changes (fallback?)

Bug #1184878 reported by Didier Roche-Tolomelli
46
This bug affects 10 people
Affects Status Importance Assigned to Milestone
lightdm (Ubuntu)
Confirmed
Undecided
Unassigned
upstart (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

A file that is commonly modified is /etc/environment.

If you remove the PATH line in this file, you can start a session upstart-less quite easily, and things will still work.
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

However, if upstart manage your session, you can't log in (you will be rejected and going back to the greeter quickly). I thnk we should be more fortified against this pebkac issue, especially has we have no really good log for it to know what happened (nothing in lightdm or upstart logs rather than exiting the session and gnome-session logs were not there as it's not executed).

What happens is:
/usr/sbin/lightdm-session: 5: exec: init: not found

in .xsession-errors.

indeed, which init doesn't return anything as /sbin isn't in path. We should maybe hardcode /sbin/init in this script?

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: upstart 1.8-0ubuntu2
ProcVersionSignature: Ubuntu 3.9.0-2.7-generic 3.9.3
Uname: Linux 3.9.0-2-generic x86_64
ApportVersion: 2.10.2-0ubuntu1
Architecture: amd64
Date: Tue May 28 09:51:48 2013
EcryptfsInUse: Yes
InstallationDate: Installed on 2012-05-28 (364 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
MarkForUpload: True
SourcePackage: upstart
UpgradeStatus: No upgrade log present (probably fresh install)
UpstartBugCategory: Session
UpstartRunningSessionVersion: init (upstart 1.8)
UpstartRunningSystemVersion: init (upstart 1.8)

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

as pitti pointed out, a symlink from /sbin/init to /bin/init would make sense as it's now a user-centric part as well.

Changed in upstart (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in upstart (Ubuntu):
status: New → Confirmed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

This is not a problem with upstart packaging. /sbin is on the default path in ubuntu, and hence "init" binary is shipped there and is a reasonable location for the executable, same as e.g. ifconfig. Adding "extra" symlinks, is not, since quite a lot of things will not work. Other binaries that are used by user session upstart jobs are also /sbin/start /sbin/stop /sbin/reload /sbin/restart /sbin/initctl /sbin/initctl.

If one doesn't want an upstart managed user-session, one should comment it out from /etc/upstart-xsessions, similarly lightdm/ubuntu-greeter should manage to start such sessions without init user-session.

Changed in lightdm (Ubuntu):
status: New → Confirmed
Changed in upstart (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

actually, if "init" is not on the path we could either add /sbin to path in Xsession.d scripts, or fallback in Xsession.d to non-upstart managed user-session.

Even better we could simply merge sbin -> bin, as well as complete the /usr merge. =)

Revision history for this message
François Marier (fmarier) wrote :

I also had this problem after upgrading from 12.04 to 14.04 and fixed it by creating a new file (/etc/X11/Xsession.d/01path_fix) and putting the following in it:

  # Fix for https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1184878
  PATH=$PATH:/sbin

It's a bit annoying that it puts /sbin in normal user paths though.

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.