Bug 2467 - xserver-nodm-init init script broken for rootles X
Summary: xserver-nodm-init init script broken for rootles X
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: graphics (show other bugs)
Version: 1.2
Hardware: x86 Multiple
: High major
Target Milestone: 1.3 M1
Assignee: Laurentiu Palcu
QA Contact:
URL:
Whiteboard: (Scheduled)
Depends on:
Blocks:
 
Reported: 2012-05-17 09:35 UTC by tf
Modified: 2012-06-19 13:31 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments
Patch to add missing -s option to su invocation. (1.31 KB, patch)
2012-05-17 09:35 UTC, tf
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tf 2012-05-17 09:35:47 UTC
Created attachment 516 [details]
Patch to add missing -s option to su invocation.

the init script tries to start the server using this line:

su -l -c '/etc/X11/Xserver&' $username

This does not work, because the user 'xuser' has default shell /bin/false, so the whole line is a NOP. It can be fixed by adding '-s /bin/sh' to the command line; patch is attached.
Comment 1 Laurentiu Palcu 2012-06-08 08:09:58 UTC
I tested rootless X on an atom based Lenovo Ideapad S10-3t, with Intel GPU, and it works fine. I used atom-pc machine target and I didn't need to change anything else. However, it doesn't work in qemux86 anymore because X depends very much on DRI now and qemu does not support it.

Nevertheless, the bug doesn't seem to be valid since the xserver-nodm script works fine for atom-pc.
Comment 2 Laurentiu Palcu 2012-06-11 10:53:47 UTC
Works fine on real HW. Closing as invalid.
Comment 3 tf 2012-06-11 11:31:48 UTC
I am using this on real HW too, and it definitely does not work here, and I don't see how it could possibly work considering xuser has no shell ... from a root console, if you do 'su xuser' do you get an xuser shell?
Comment 4 Laurentiu Palcu 2012-06-11 12:04:55 UTC
@tf: I do get a shell after doing 'su xuser' in a root console. Also, /etc/passwd shows that xuser does have a shell assigned:

xuser:x:1000:1000::/home/xuser:/bin/sh

The '/bin/sh' is assigned by default by useradd if no -s option is provided and if /etc/default/useradd exists. In our case, the file exists and the default shell is /bin/sh. So, it should also work for you.

Are you using the latest tree? Can you provide more info?
Comment 5 tf 2012-06-11 12:39:25 UTC
I am using denzil; the xuser entry in the passwd file is:

  xuser:x:999:999::/home/xuser:/bin/false

The reason for this is connman, the connman.inc file also does a useradd xuser and it specifies the shell as /bin/false -- I guess the final outcome depends on whether your xserver-nodm-init or connman recipe gets built first.
Comment 6 Laurentiu Palcu 2012-06-11 13:35:36 UTC
You're right. It looks like a parallelism issue. If connman creates the user first, then xserver-nodm-init script will fail to create the user because it already exists. It turns out, I was "lucky" enough not to reproduce it... :)
Comment 7 Ross Burton 2012-06-11 13:42:32 UTC
There is a good reason for connman to create the user -- dbus warns if it comes across a username it doesn't recognise in the rules.

Long term I want to see that rule die anyway.
Comment 8 Laurentiu Palcu 2012-06-11 15:01:32 UTC
Well, I think the right solution to this would be to make useradd parameters consistent for both connman and xserver-nodm-init. Afterall, they both add the same user which is shared between connman and rootless X.
Comment 10 tf 2012-06-13 13:21:37 UTC
Thx; it's a fix for now, but having to manually keep files in sync is not very robust -- would it not be better to have a dedicated xuser package that the two packages RDEPEND on?
Comment 11 Laurentiu Palcu 2012-06-13 13:34:46 UTC
Technically, it would be better. But I don't think it's worth the effort, provided USERADD_PARAMs are not expected to change that often in the future. Otherwise, yes, I agree with you.
Comment 12 Ross Burton 2012-06-13 14:02:16 UTC
I've made it a personal mission to remove the xuser reference in connman anyway.
Comment 13 Alexandru Georgescu 2012-06-19 13:31:44 UTC
Hi,
I have tested it with the core-image-sato-sugarbay-20120618061023.hddimg.

X starts,

the line: 
     xuser:x:1000:1000::/home/xuser:/bin/sh 

exist in /etc/passwd, and in connman.inc the USER_ADD_PARAM${PN} is created like this: 

USERADD_PARAM_${PN} = "--create-home \
                       --groups video,tty,audio \
                       --user-group xuser"


Setting it to verified.
alex.