/etc/profile.d/upstart-phablet.sh sets UPSTART_SESSION to null value

Bug #1217863 reported by James Hunt
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Won't Fix
Undecided
Unassigned
ubuntu-touch-session (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Script /etc/profile.d/upstart-phablet.sh sets XDG_RUNTIME_DIR to a suitable value, then calls:

export UPSTART_SESSION=$(/sbin/initctl list-sessions | awk '{ print $NF; quit }')

However, "sudo su -" does not result in the creation of XDG_RUNTIME_DIR for the root user, hence UPSTART_SESSION is set to the null value.

This leads to confusing upstart behaviour:

phablet@ubuntu-phablet:~$ sudo su -
initctl: unable to determine sessions
root@ubuntu-phablet:~# initctl list
initctl: Unable to connect to Upstart: Empty address ''
root@ubuntu-phablet:~# unset UPSTART_SESSION
root@ubuntu-phablet:~# initctl list | head
cgroup-lite start/running
mountall-net stop/waiting
mountnfs-bootclean.sh start/running
passwd stop/waiting
rc stop/waiting
rsyslog start/running, process 437
startpar-bridge stop/waiting
tty4 stop/waiting
udev start/running, process 631
upstart-udev-bridge start/running, process 624

I think the issue may actually be related to logind not creating XDG_RUNTIME_DIR.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in systemd (Ubuntu):
status: New → Confirmed
Changed in ubuntu-touch-session (Ubuntu):
status: New → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

> However, "sudo su -" does not result in the creation of XDG_RUNTIME_DIR for the root user, hence UPSTART_SESSION is set to the null value.

That's correct, and intended. This was explicitly done in https://launchpad.net/ubuntu/+source/systemd/204-0ubuntu19.1 for bug 1197395. $XDG_RUNTIME_DIR must *never* be set for a session/program which does not belong to the owner of /run/user/..., in particular not root. Otherwise processes from root will damage/destroy the user's runtime dir.

Changed in systemd (Ubuntu):
status: Confirmed → Won't Fix
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.