[volunteers] Why you are careful about /dev/null operations as the root user

Rick Moen rick at linuxmafia.com
Wed Dec 16 21:07:05 PST 2015


Quoting Tim Utschig (tim at tetro.net):

> Here's my theory: There was at some point a 'bind' mount of /dev onto
> /var/old-svlug-rfs/dev, but nothing in place to replace that mount at
> boot time.
> 
> Maintenance happened, and the system rebooted.  /dev inside the chroot
> is now an empty directory.  Scripts running as root, such as the above
> mentioned crontab entries are now creating/overwriting /dev/null every
> time they run.

Yep, that would account for what we saw today.

Good job finding the other part of the picture.  I think.  (Honestly,
I'm jet-lagged and so could easily be missing important things.)

You're way ahead of me in looking through setup of the host system
outside the chroot.  I've not yet gotten to that.  

[...]

> I added the bind mount to /etc/fstab next to the other two bind mounts.
> 
> However it occurred to me that I was unsure whether bind mounting from
> /dev would work during startup, or conflict with udev/systemd/whatever.
> Rather than try to figure that out now, I moved the bind mount to
> /etc/init.d/start-chroot, which I'm fairly certain should work.

Sounds reasonable.  Perhaps Sarah can comment, too.

> I'm sorry it was so much trouble :-(

Things always blow up when one is least prepared to handle the work.
It's almost a rule of nature.  ;->




More information about the volunteers mailing list