Koozali.org: home of the SME Server

Log Permissions

Log Permissions
« on: May 03, 2012, 11:00:46 PM »
Hello,

I was messing around, when I shouldn't have been. (Cleaning up logs)....

I think I messed up the permissions on the qmail, and various other logs.

Is there a way to 'reset' them?

Please and thanks.

What are the default permissions and owners of the logs?

Thanks.

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: Log Permissions
« Reply #1 on: May 04, 2012, 05:03:30 AM »
You can probably fix it by renaming the old folders and doing 'signal-event post-upgrade; signal-event reboot'.

Otherwise, here's what I get from
Code: [Select]
find /var/log -maxdepth 1 -type d -exec ls -ld "{}" \;
on me SME8b7 server:
Code: [Select]
drwxr-xr-x 52 root root 12288 May  3 04:03 /var/log
drwxr-sr-x 2 dnslog dnslog 4096 May  3 15:45 /var/log/dnscache.forwarder
drwxr-s--- 2 qmaill nofiles 4096 Apr 21 09:10 /var/log/qmail
drwxr-s--- 2 smelog smelog 4096 Apr 23 21:55 /var/log/qpsmtpd
drwxr-s--- 2 smelog smelog 4096 Feb 11 22:59 /var/log/raidmonitor
drwxr-x--- 2 smelog root 4096 Feb 19 08:46 /var/log/squid.run
drwx------ 3 root radiusd 4096 May  1 04:03 /var/log/radius
drwxr-s--- 2 smelog smelog 4096 Feb 11 22:59 /var/log/yum
drwxr-x--- 2 root root 4096 Nov 10 11:35 /var/log/proftpd
drwxr-x--- 2 cvmlog cvmlog 4096 Feb 11 22:59 /var/log/cvm
drwxr-xr-x 2 clamav clamav 4096 Oct 17  2011 /var/log/clamav
drwxr-sr-x 2 dnslog dnslog 4096 May  3 07:45 /var/log/dnscache
drwxr-x--- 2 squid squid 4096 Apr 29 04:03 /var/log/squid
drwxr-xr-x 2 root root 4096 Mar 30  2008 /var/log/flexbackup
drwxr-xr-x 2 root root 4096 Sep 19  2009 /var/log/vbox
drwx------ 2 ldap ldap 4096 Mar 14  2011 /var/log/bdb
drwxr-s--- 2 smelog smelog 4096 Feb 11 22:59 /var/log/ftp
drwxr-s--- 2 smelog smelog 4096 Feb 11 22:59 /var/log/pptpd
drwxr-x--- 2 smelog smelog 4096 Feb 11 22:59 /var/log/oidentd
drwxr-s--- 2 smelog smelog 4096 Feb 11 22:59 /var/log/ippp
drwxr-s--- 2 smelog smelog 4096 Apr 21 09:10 /var/log/smbd
drwxr-s--- 2 smelog smelog 4096 Feb 11 22:59 /var/log/clamd
drwxr-s--- 2 smelog smelog 4096 Apr 21 09:10 /var/log/sqpsmtpd
drwxr-s--- 2 smelog smelog 4096 Feb 11 22:59 /var/log/wan
drwxr-x--- 2 smelog smelog 4096 Feb 11 22:59 /var/log/pop3
drwxr-sr-x 2 dnslog dnslog 4096 Feb 11 22:59 /var/log/tinydns
drwx------ 2 root root 4096 Apr 20 09:28 /var/log/aide
drwxr-xr-x 2 imaplog imaplog 4096 Apr 22 07:25 /var/log/imaps
drwxr-s--- 2 smelog nofiles 4096 Feb 11 22:59 /var/log/smtp-auth-proxy
drwxr-s--- 2 smelog smelog 4096 Jan 20 05:21 /var/log/spamd
drwxr-s--- 2 root nofiles 4096 Feb 11 22:59 /var/log/sshd
drwx------ 2 root root 4096 Jan 20  2009 /var/log/ppp
drwx------ 2 root root 4096 Mar 14  2007 /var/log/iptraf
drwxr-s--- 2 smelog smelog 4096 Feb 11 22:59 /var/log/pop3s
drwxr-xr-x 2 root root 4096 Sep 24  2011 /var/log/pm
drwx------ 2 root root 12288 May  1 01:12 /var/log/httpd
drwxr-s--- 2 smelog smelog 4096 Feb 11 22:59 /var/log/dhcpd
drwxr-xr-x 2 root root 4096 Aug 31  2006 /var/log/ulogd
drwxr-xr-x 2 455 fuse 4096 Dec 31 08:43 /var/log/ntop
drwxr-s--- 2 smelog clamav 4096 Apr 22 23:13 /var/log/freshclam
drwxr-s--- 2 smelog nofiles 4096 Feb 11 22:59 /var/log/ntpd
drwx------ 4 root root 4096 Apr 10 16:48 /var/log/samba
drwxr-x--- 2 root root 4096 Feb 22 10:09 /var/log/audit
drwxr-xr-x 2 imaplog imaplog 4096 Apr 26 06:13 /var/log/imap
drwxr-xr-x 2 root root 4096 Sep 25  2011 /var/log/prelink
drwxr-x--- 2 smelog smelog 4096 Feb 11 22:59 /var/log/httpd-admin
drwxr-x--- 2 smelog smelog 4096 May  2 04:03 /var/log/ldap
drwxr-xr-x 2 smelog smelog 4096 Feb 11 22:59 /var/log/iptables
drwxr-s--- 2 smelog smelog 4096 Apr 21 09:10 /var/log/nmbd
drwxr-xr-x 2 smelog smelog 4096 Feb 11 22:59 /var/log/radiusd
drwxr-s--- 2 smelog smelog 4096 Apr 21 09:10 /var/log/mysqld

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Log Permissions
« Reply #2 on: May 04, 2012, 04:14:33 PM »
You can probably fix it by renaming the old folders and doing 'signal-event post-upgrade; signal-event reboot'.

No, that will leave you with missing folders, loggers which don't work, and services which block.

This command might restore ownership of the log directories at least:

Code: [Select]
rpm --setugids $(rpm -qf /var/log/*/. | sort | uniq)