LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Accidentally Deleted Everything In /var/log (https://www.linuxquestions.org/questions/slackware-14/accidentally-deleted-everything-in-var-log-269686/)

Joe Heng 12-23-2004 03:58 PM

Accidentally Deleted Everything In /var/log
 
Can some kind soul kindly give me some advice as to what to do? or how to rectify this problem?
I accidentally deleted everything in /var/log
I am still able to boot the system, my services like bind, samba, nfs, squid...etc are all working. Except Apache gives an error unable to find error_log :(
I have reinstalled swaret, but it doesnt have the cache of all installed packages on my system. Is there anyway I can rebuild that cache?

sh1ft 12-23-2004 04:06 PM

Hate to say this.. but you should have made backups. That partition isn't even particularily large..

jschiwal 12-23-2004 04:34 PM

I'm not at my home linux computer so I can't check the filename or exact location of the Apache error_log. If this is given in the error message, you could try using the touch command to create an empty one.

The location of the logs may be determined on how Apache was compiled. type in the command:
/usr/local/apache/bin/httpd -V

This should give information such as:
-D HTTPD_ROOT="/usr/local/apache"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"

I don't know what the permissions and ownership of these log files should be. Perhaps someone could provide more information.

If you accidentally delete files, which other programs may be using, you could try locating them using the 'lsof' command. (LiSt Open Files)

Piping the output through grep like: lsof | grep '/var/log'
could give you the numbers of the process which still have a handle on the deleted file. You can then cd to the corresponding process in the /proc directory and copy the file from there.

Joe Heng 12-23-2004 07:20 PM

Thanx jschiwal!
 
Thanx for ur advice, I managed to get Apache to work again by recreating the /var/log/apache directory and using touch to create an empty error_log file.
Abt my installed packages tree getting messed up, I'd prob have to do a reinstall over the existing installation cuz I read somewhere that the installed-package list is created only during installation of the operating system.


All times are GMT -5. The time now is 12:22 AM.