Setting permissions for log files and directories

When you specify the -c start option, syslogd creates log files and directories dynamically. By default, directories are created with the permissions value 0700, which means that only the owner can read, write, and list the contents of the directory. Similarly, if syslogd needs to create a file, the default permissions value is 600, which again means that only the owner can read and write to the file. Because a user ID with UID 0 must run syslogd, the owner is always a superuser. To change the default permissions used by syslogd, use either the -F or the -D start option to set the global default permissions for files and directories, respectively.

Tip: The -F and -D start options have no effect on files or directories that already exist.

You can also use the -F and -D configuration options to override global defaults for individual syslogd rules. Specify -F or -D (or both) with octal values following the file name. For example:

*.err      /var/log/%Y/%m/%d/errors -F 640 -D 644

The file permission bits, whether provided on the rule or as global defaults, are modified by the syslogd process file creation mask (umask), and then used to set the file permission bits of a file that is being created.

If you are considering allowing users other than a superuser to have access to log files, before changing the syslogd default permissions for files and directories, be sure to consider the following options: