[syslog-ng]Strange behaviour in syslog-ng file creation.
Luca Villani
lvillani@iol.it
Thu, 13 Jun 2002 18:02:43 +0200
Hi all.
First, I'm sorry: I'm afraid my english is very poor. :-|
Actually we run a medium log server, with a dozen of host logging on
it via tcp. syslog-ng is 1.4.15, OS is Linux RedHat 7.2.
We find some trouble in file creation: we want syslog-ng create files
with an user, a group and a bitmask, but it fail in bitmap setting
for some files and do it successfuly for other files.
This is a snap of our configuration file (I'm sorry for lines wrap):
>--------------------------- START --------------------------------<
# bayonne logfiles
destination bayonne_all {file("/var/log/bayonne/bayonne.log"
owner("root") group("bayonne") perm(0660)); };
destination bayonne_debug {file("/var/log/bayonne/debug.log"
owner("root") group("bayonne") perm(0660)); };
destination bayonne_info {file("/var/log/bayonne/info.log"
owner("root") group("bayonne") perm(0660)); };
destination bayonne_err {file("/var/log/bayonne/error.log"
owner("root") group("bayonne") perm(0660)); };
destination bayonne_crit {file("/var/log/bayonne/critical.log"
owner("root") group("bayonne") perm(0660)); };
# bayonne-avvenire logfiles
destination avvenire_all
{file("/var/log/bayonne/avvenire/avvenire.log" owner("root")
group("bayonne") perm(0660)); };
destination avvenire_debug
{file("/var/log/bayonne/avvenire/debug.log" owner("root")
group("bayonne") perm(0660)); };
destination avvenire_info {file("/var/log/bayonne/avvenire/info.log"
owner("root") group("bayonne") perm(0660)); };
destination avvenire_warn
{file("/var/log/bayonne/avvenire/warning.log" owner("root")
group("bayonne") perm(0660)); };
destination avvenire_err {file("/var/log/bayonne/avvenire/error.log"
owner("root") group("bayonne") perm(0660)); };
>--------------------------- END --------------------------------<
What we want is something like this:
>--------------------------- START --------------------------------<
[root@platone root]# ls -l /var/log/bayonne
total 7552
drwxrwx--- 2 root bayonne 4096 Jun 11 17:58 avvenire
-rw-rw---- 1 root bayonne 2860663 Jun 13 17:12 bayonne.log
-rw-rw---- 1 root bayonne 23267 Jun 13 16:34 calls
-rw-rw---- 1 root bayonne 0 Jun 13 04:02 critical.log
-rw-rw---- 1 root bayonne 2541445 Jun 13 17:12 debug.log
-rw-rw---- 1 root bayonne 6613 Jun 13 17:08 error.log
-rw-rw---- 1 root bayonne 312605 Jun 13 17:12 info.log
[root@platone root]# ls -l /var/log/bayonne/avvenire/
total 320
-rw-rw---- 1 root bayonne 126474 Jun 13 17:10 avvenire.log
-rw-rw---- 1 root bayonne 75780 Jun 13 17:10 debug.log
-rw-rw---- 1 root bayonne 1365 Jun 13 17:08 error.log
-rw-rw---- 1 root bayonne 44628 Jun 13 17:10 info.log
-rw-rw---- 1 root bayonne 4701 Jun 13 17:08 warning.log
[root@platone root]#
>--------------------------- END --------------------------------<
In real world, this is the results:
>--------------------------- START --------------------------------<
[root@platone root]# ls -l /var/log/bayonne
total 7552
drwx------ 2 root root 4096 Jun 11 17:58 avvenire
-rw-rw---- 1 root bayonne 2860663 Jun 13 17:12 bayonne.log
-rw-rw---- 1 root bayonne 23267 Jun 13 16:34 calls
-rw-rw---- 1 root bayonne 0 Jun 13 04:02 critical.log
-rw-rw---- 1 root bayonne 2541445 Jun 13 17:12 debug.log
-rw-rw---- 1 root bayonne 6613 Jun 13 17:08 error.log
-rw-rw---- 1 root bayonne 312605 Jun 13 17:12 info.log
[root@platone root]# ls -l /var/log/bayonne/avvenire/
total 320
-rw-r----- 1 root bayonne 126474 Jun 13 17:10 avvenire.log
-rw-r----- 1 root bayonne 75780 Jun 13 17:10 debug.log
-rw-r----- 1 root bayonne 1365 Jun 13 17:08 error.log
-rw-r----- 1 root bayonne 44628 Jun 13 17:10 info.log
-rw-r----- 1 root bayonne 4701 Jun 13 17:08 warning.log
[root@platone root]#
>--------------------------- END --------------------------------<
First, the directory /var/log/bayonne/avvenire/ is property of
root.root
with a bitmask
drwx------
Second, all files in this directory are properties of
root.bayonne
and this is correct, but the bitmask is
-rw-r-----
and not
-rw-rw----
All files in /var/log/bayonne/, pheraps, have corret owner and
permission bitmask!!!
If I perform a chown on directory /var/log/bayonne/avvenire/, it
works, but if I perform a manual chmod on all files in this directory
it *temporary* work, but permission are changhed at first a log line
is appended in every file.
Have someone out there experimented this behavoiur?
--
Ciao da Villo - GPG public key available