I have accidentally removed my apache2 startup file /etc/init.d/apache2 using rm /etc/init.d/apache2 command.
How can I get that back?
|
show 3 more comments
feedback
|
This question came from our site for professional and enthusiast programmers.
|
In this case the file is part of a package in the distribution. Just reinstall it. In apt-based systems like Debian or Ubuntu, i believe it's just | |||||
feedback
|
|
Depending on your package manager, you can just reinstall the apache package. It will add that file back. Make sure you back up your configurations before you try though. | |||
|
feedback
|
|
This won't help you after the event, but I highly recommend etckeeper. It maintains your | |||
|
feedback
|
|
http://e2undel.sourceforge.net/recovery-howto.html Never tried it. | |||
|
feedback
|
|
Depending on your filesystem you could try the following: | |||
|
feedback
|
edcan be used (if you have a really good memory). – msw Jul 2 '10 at 13:37mount -oremount,ro /. Then continue looking for recovery programs, probably on a different machine because a read-only root is not appreciated by many programs. – Thomas Jul 2 '10 at 13:39trash /etc/init.d/apache2works as doesrestore-trash. I've never used them as source control and backups have always been sufficient and protect against more than a badrm. ramendik.ru/docs/trashspec.html – msw Jul 2 '10 at 15:52