2

After running update today and rebooting the OS lightdm would not start. After some debugging I noticed that /dev/null (and some other /dev files) do not have adequate permissions (compared to another Ubuntu box I have) - e.g. 'others' could not read nor write /dev/null.

After 'chmod a+rw /dev/null /dev/urandom /dev/random /dev/ptmx' lightdm started up. Of course this is not reboot persistent so I need to put this in some /etc/rc.* to make it stick - which I do not want to!

Anyone knows why this started to happen? IOW, it worked up till today for me.

[SOLVED] I had custom buggy udev rules that would set certain /dev entries to 0600!

  • 3
    You are stepping over one important question: why do you need to change it? Ever reboot will recreate /dev/. If /dev/null is wrongly created this is a *serious* bug and should be reported as such. Please do so. Recreating /dev/null should be done as shown here http://askubuntu.com/a/435891/15811 but this is almost only happening when someone himself messed with it and not through the system itself. That would be very bad. – Rinzwind Dec 01 '15 at 13:51
  • My thoughts exactly, I should not need to worry about! I have not touched the /dev files in any way. The /dev/null is a proper device node already, no need to recreate it myself, I think. It is only permissions that are wrong IMO. Where do I report bug? – Hinko Kocevar Dec 01 '15 at 14:04

1 Answers1

1

As Rinzwind properly mentioned, /dev/null is created on every boot , but specifically every device including /dev/null is created by MAKEDEV script, which is referenced in several /etc/init scripts as shown bellow:

xieerqi:$ sudo grep -iR "makedev" /etc 2 > /dev/null                                                                                  
[sudo] password for xieerqi: 

    xieerqi:$ sudo grep -iR "makedev" /etc 2> /dev/null                                                                                   
    [sudo] password for xieerqi: 
    /etc/init/mounted-dev.conf: /sbin/MAKEDEV std fd ppp tun
    /etc/init/mounted-dev.conf:     /sbin/MAKEDEV console
    /etc/init.d/udev:create_dev_makedev() {
    /etc/init.d/udev:  if [ -e /sbin/MAKEDEV ]; then
    /etc/init.d/udev:    ln -sf /sbin/MAKEDEV /dev/MAKEDEV
    /etc/init.d/udev:    ln -sf /bin/true /dev/MAKEDEV
    /etc/init.d/udev:    create_dev_makedev

The /sbin/MAKEDEV and /sbin/makedev are the same script, which have in the header settings for all the devices and their respective permissions. In particular, on makedev my system creates the null device with $public permissions:

makedev null c 1 3 $public

At the top the public is defined as public=" root root 0666"

You should be able to open this script and modify the permissions as necessary or verify they are not altered in any way.

However, if they are unaltered, it is strongly recommended to report this behavior as bug, and for your own convenience probably switch to gdm for the time being.

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
  • Looking at the /sbin/MAKEDEV I have exactly the same lines for /dev/null. Who should I report bug to? – Hinko Kocevar Dec 02 '15 at 14:19
  • https://launchpad.net/ubuntu/+bugs – Sergiy Kolodyazhnyy Dec 02 '15 at 17:52
  • Thanks! /etc/init.d/udev, linked to /etc/rcS.d/S03udev, is the place where a call to create_dev_makedev() should create link /dev/MAKEDEV -->/sbin/MAKEDEV. There is no /dev/MAKEDEV in my /dev folder. Also looking at the /var/log/boot.log I can not see any lines from /etc/init.d/udev.. Strange.. – Hinko Kocevar Dec 03 '15 at 08:14