Score:0

Logrotate Create Mode Issue

cn flag

I have a trouble with logrotate service in linux. I have a logrotate config for mongodb log as below:

/var/log/mongodb/mongod.log
{
   rotate 10
   daily
   dateext
   dateformat %Y-%m-%d-%s
   dateyesterday
   missingok
   create 644 mongodb mongodb
   delaycompress
   compress
   sharedscripts
   postrotate
     /bin/kill -SIGUSR1 $(pgrep mongod)
   endscript
}

As can be seen, I expect that mode of new mongodb file to be 644 but it is 600 and only the closed log file mode is 644.

ls -l command output:

total 640
-rw------- 1 mongodb mongodb  9822 May 29 19:42 mongod.log
-rw-r--r-- 1 mongodb mongodb     0 May 29 19:29 mongod.log.2022-05-29T14-59-01

I don't understand what problem is exactly.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.