The Life of a Sysadmin

Carousel is a lie!

Well, that'll teach me
Thu Dec 31 12:41:24 PST 2009

While trying to figure out why Nagios was suddenly unable to check up on our databases, I suddenly realized that the permissions on /dev/null were wrong: 0600 instead of 0666. What the hell? I've had this problem before, and I was in the middle of something, so I set them back and went on with my life. Then in happened again, not half an hour later. I was in the same shell, so I figured it had to have been a command I'd run that had inadvertantly done this.

Yep: don't run the MySQL client as root. Yes yes yes, it's bad anyway, I'll go to sysadmin hell, but this is an interesting bug. The environment variable MYSQL_HISTFILE is set to /dev/null for root...and when you exit the client, it sets the permissions for the history file to 0600. So, you know, don't do that then. (Still no fix committed, btw...)

Tags: bug.

Comments On This Entry

hi, you can also chattr +i the /dev/null file and if you forget to run mysql client as user will be no problem :)
regards

@Cristian

If I make /dev/null immutable, where will I send my naughty user accounts?