5

Logwatch has been working perfectly until now. I read a tutorial that you shouldnt edit the config in the default place

/usr/share/logwatch

Instead you should move it to /etc/logwatch

So i did that and now i get this error

/var/cache/logwatch No such file or directory at /usr/sbin/logwatch line 633.

Does anyone know how to fix? Or should i just try removing the entry in /etc ?

h00j
  • 378
  • 6
  • 21

2 Answers2

8

The advice given in /usr/share/logwatch/default.conf/logwatch.conf is quite right. However, after copying the logwatch.conf you may just want to deactivate line 30 in /etc/logwatch/logwatch.conf (or /etc/logwatch/conf/logwatch.conf in some versions).

# TmpDir = /var/cache/logwatch

or, alternatively, create this directory with

sudo mkdir /var/cache/logwatch

That's it.

1

Either that advice was wrong, or you misunderstood it.

You should leave the default configuration in place, but you should make customisations in extra files in /etc/logwatch.

You need to undo what you have done, and then add your own customisations in /etc/logwatch.

logwatch reads the configuration in /usr/share/logwatch first, and then it reads your customisations from /etc/logwatch, but it won't work if the former isn't there.

EightBitTony
  • 9,211
  • 1
  • 32
  • 46
  • 1
    Also Ubuntu help about logwatch says that "Configuration shouldn't be edited in the install directory (/usr/share/logwatch). Copy logwatch.conf to /etc/logwatch before editing"... resulting in that error ("/var/cache/logwatch No such file or directory at /usr/sbin/logwatch line..."). – MV. Oct 18 '13 at 19:11
  • Copying and moving are different. – EightBitTony Oct 18 '13 at 22:51