Sunday, January 20, 2013

auth.log Service Restart

I tried to incorporate my auth.log file into logrotate and didn't use copytruncate in my logrotate.d configuration file, so I ended up with a missing auth.log file. I tried to recreate auth.log by copying auth.log.0 and chown'ing it syslog:adm, but I ended up with an auth.log that wasn't being updated because the authentication daemon no longer had a handle to the file.

Rather than reboot the whole server, I wanted to restart the service that writes to auth.log. I found a reference to rsyslog, but I was a couple of versions of Ubuntu later than the 10.04 mentioned in that conversation. (Ubuntu 12.04 LTS) so I ended up getting "rsyslog: unrecognized service" when I tried that.

I ran "service --status-all" to get a list of services on the machine and "sysklogd" looked promising so I tried restarting it.

user@server:~# service sysklogd restart
 * Restarting system log daemon...                                       [ OK ]

Then I exited SSH and logged back in, to find that my auth.log file was getting written to again.

No comments: