LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Log file empty? (https://www.linuxquestions.org/questions/linux-newbie-8/log-file-empty-4175574126/)

Princo 03-06-2016 10:19 AM

Log file empty?
 
Hi to all, one newbie question.

I delete all log dile in /var/log/rm * then pres y for all files, then i delte all in /var/log/httpd/rm * .

But now the directory still empty, where is new logs?

Thanks

Emerson 03-06-2016 10:43 AM

Welcome to LQ!

You probably need to restart the httpd. Next time you can empty the log by using echo command to send a line into log you want to empty.

pan64 03-06-2016 11:22 AM

yes, you need to restart httpd (that is for /var/log/httpd) and I think you need to reboot your PC for /var/log (or at least syslog daemon should be restarted).
In general it is not a good idea, because the log files are opened and continuously in use. rm * will not remove them just remove the directory entry, but those files will be still in use.

Emerson 03-06-2016 01:17 PM

Good point pan64, of course the file is still open. BTW, I do not think syslog needs to be restarted, if I recall correctly logrotate does not do it.

Anyhow, instead of emptying log files configure your logrotate to your liking.

Princo 03-06-2016 01:37 PM

1 Attachment(s)
:) working, thanks guys.

And if want to reboot our server, just using command reboot?

pan64 03-06-2016 01:45 PM

yes, more or less that works. If you are logged in on GUI there will be also a menu to poweroff/restart

Princo 03-06-2016 01:52 PM

I use putty to send only commands.

pan64 03-07-2016 12:48 AM

in that case yes, reboot is the command you need.


All times are GMT -5. The time now is 02:45 AM.