Why you shouldn’t use copy/paste as root
Title: How to subtile fsck your Apache setup.
Solution (quoting the original command line):
cd /etc/apache2/mods-enabled
lrwxrwxrwx 1 root www-data 33 2007-09-28 15:23 auth_basic.load -> ../mods-available/auth_basic.load
lrwxrwxrwx 1 root www-data 33 2007-09-28 15:23 authn_file.load -> ../mods-available/authn_file.load
lrwxrwxrwx 1 root www-data 36 2007-09-28 15:23 authz_default.load -> ../mods-available/authz_default.load
Disclaimer: no, it wasn’t me; it’s the log of a customer.
Credits: thanks to monitoring and the use of mercurial in /etc locating and fixing the problem was a matter of seconds.
February 24th, 2008 at 12:58
I only just got up so I may have missed something but you don’t appear to have explained what the original problem was?
February 24th, 2008 at 13:12
@Simon: yeah, tricky one. :) Check out the redirection “>” inside the commands (which are comming from a “ls -la” copy/paste buffer), so several *.load-files inside /etc/apache2/mods-available/ are being zeroed out. :)
regards,
-mika-
February 24th, 2008 at 13:57
oh yeah, now I get it ;)
$ lrwxrwxrwx 1 root www-data 33 2007-09-28 15:23 auth_basic.load -> ../mods-available/auth_basic.load
zsh: file exists: ../mods-available/auth_basic.load
February 25th, 2008 at 12:07
That’s one of the reasons why su and sudo -s are forbidden in my work environment. If you use su or sudo -s, you need to use logger(1) to explain _in_ _the_ _syslog_ why that particular procedure was necessary with a root shell.
I have established that rule when a colleague mistakenly pasted an e-mail into a root shell.