Operating System - HP-UX
1833296 Members
3190 Online
110051 Solutions
New Discussion

syslog owner & perms reset; how do I prevent?

 
SOLVED
Go to solution
jmb
Regular Advisor

syslog owner & perms reset; how do I prevent?

We are modifying the owner and permissions of syslog.log so that it is available to specific groups only. That's fine, except that every time syslog starts up, or is restarted, it resets the ownership of the file back to root:sys, with perms of 644.

The modifications to syslog work on other platforms, and work on HP-UX, as long as we don't restart syslogd (or reboot the box..).

How do I work around this? I simply need to prevent the reset from happening, or be able to reset the reset every time it happens.
2 REPLIES 2
Patrick Wallek
Honored Contributor
Solution

Re: syslog owner & perms reset; how do I prevent?

The place to make sure the reset happens everytime syslog is (re)started is in the /sbin/init.d/syslogd file. When that is used to start syslog, like when you reboot, syslog.log gets moved to OLDsyslog.log and a new syslog.log gets created with the command '> /var/adm/syslog/syslog.log' and the permissions on the file are 644 (the umask is set to 022 before the file is created).

So the thing to do is put your chown/chmod/chgrp in that file right after the file creating line. Then you should be set as long as /sbin/init.d/syslogd is used to start syslog.
jmb
Regular Advisor

Re: syslog owner & perms reset; how do I prevent?

And even though the answer is simple and clean, it works! Thanks, Patrick.