up vote 1 down vote favorite
share [g+] share [fb]

Can anyone tell me how I can undo a sudo rm -r /var/run mistake?

I can't use sftp and mysql now.

link|improve this question
@BlueNovember: I'd edited that over on stackoverflow ( stackoverflow.com/questions/1988866/… ).. , deleted here before noticing your question .. sorry for breaking the context. I figured the people on serverfault were most likely to have been in this "pit of doom" situation. – lexu Jan 1 '10 at 15:41
Ah, hence the confusion. Comment removed. =) – RJFalconer Jan 1 '10 at 15:53
feedback

migrated from stackoverflow.com Jan 1 '10 at 15:30

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 3 down vote accepted

You can... reinstall debian!

There's a reason you should be careful with anything starting with "sudo rm", and this is it :P

link|improve this answer
sudo rm -r, actually. – Malfist Jan 1 '10 at 16:00
2  
-f especially, but when you're deleting ANYTHING as root you should be bloody careful :P – Phoshi Jan 1 '10 at 16:13
2  
You can always reinstall, but I personally would go to a lot of drudge work to avoid it... – dmckee Jan 1 '10 at 17:31
2  
You can fix things like this by reinstalling, but you can also dive in and try and put it all back together. You'll learn alot more about your system that way, and be motivated never to ever make that mistake again. – Adam Luchjenbroers Jan 2 '10 at 0:34
feedback

reinstalling debian is not necessary. in /var/run are stored temporary pid files.. just try if restart of broken services works, if not, do dpkg -S /var/run to see, which packages installed some subdirectories there (dpkg -L <PACKAGENAME> | grep /var/run), eventually you might want to try dpkg-reconfigure <PACKAGENAME>. then restart services (/etc/init.d/... restart) or entire debian.

link|improve this answer
See now, this is what happens when you know how your package manager works... – dmckee Jan 1 '10 at 17:30
feedback
sudo mkdir /var/run

If something complains about a subdirectory missing, create it in the same way. But packages are supposed to be robust against that now, because /var/run can be on a temporary file system. Worst case, reinstall the package in question.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.