How do I fix /var/log

Asked by Jon Charge

I have cleaned out /var/log completely (or at least the partition that mounts there). Now I get messages here and there regarding missing directories and logs. Is there a program that will make everything as it needs to be or will this resolve itself on its own?

Thanks for your help.

Jon

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Jon Charge
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Bhavani Shankar (bhavi) said :
#1

You must have done a cron job for deleting contents of /var/log... Hmm whats the exact error you recieve?

Revision history for this message
Jon Charge (seropith) said :
#2

Actually, I booted using the live cd and cleared the /var/log of all data. I did this manually. I see things like

Mar 24 22:30:39 central gdm[2778]: WARNING: gdm_config_parse: Logdir /var/log/gdm does not exist or isn't a directory. Using ServAuthDir /var/lib/gdm.

among other items.

Revision history for this message
Jon Charge (seropith) said :
#3

Actually, I booted using the live cd and cleared the /var/log of all data. I did this manually. I see things like

Mar 24 22:30:39 central gdm[2778]: WARNING: gdm_config_parse: Logdir /var/log/gdm does not exist or isn't a directory. Using ServAuthDir /var/lib/gdm.

among other items.

Revision history for this message
bixejo (bixo-bixejo) said :
#4

If you don't care about keeping your logs, you may define temporary filesystems to hold these files. You may include the corresponding lines in your file /etc/fstab. I drop here an example:

tmpfs /var/log tmpfs defaults 0 0
tmpfs /var/log/apt tmpfs defaults 0 0

Alternatively, you may create the missing directories by hand :-)

Good luck,

--Bixejo

Revision history for this message
A. Denton (aquina) said :
#5

JonCharge,

copy the contents of "/var/log" from your install media (e.g. Ubuntu CD) into your current "/var/log" directory (HDD). That's most likely the easiest way to have at least a basic set of files in there.

Revision history for this message
Jon Charge (seropith) said :
#6

Aquina, I will attempt your solution.