Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-36251

change logfile permissions.

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 3.6.5
    • Fix Version/s: None
    • Component/s: Admin, Logging
    • Labels:
    • Environment:

      Description

      There are some questions about mongod permissions.

      When you restart or start mongod, the permissions of the mongo log are 644.
      However, when logrotate is run, the permissions of the mongod log change to 600.
      I wonder why this is happening.

      And I do not want to change the log permissions. I need 644.
      So, I want to know how permissions do not change.

       

      ===========================================

      1). mongo --version
      MongoDB shell version v3.6.5
      git version: a20ecd3e3a174162052ff99913bc2ca9a839d618
      allocator: tcmalloc
      modules: none
      build environment:
      distarch: x86_64
      target_arch: x86_64

       

      2. lsb_release -a
      LSB Version: :core-4.1-amd64:core-4.1-noarch
      Distributor ID: CentOS
      Description: CentOS Linux release 7.4.1708 (Core)
      Release: 7.4.1708
      Codename: Core

       

      3. service mongod start (or service mongod restart )
       
      total 1728
      drwxr-xr-x 2 root root 290 Jul 24 17:14 .
      drwxr-xr-x 8 root root 90 Jul 18 10:55 ..
      {color:#FF0000}-rw-r--r--{color} 1 root root 8656 Jul 24 17:14 mongod.log   {color:#FF0000} <=== chmod : 644{color}
      -rw------- 1 root root 148090 Jul 19 10:00 mongod.log.2018-07-19T01-00-02
      -rw------- 1 root root 119319 Jul 20 10:00 mongod.log.2018-07-20T01-00-02
      -rw------- 1 root root 113986 Jul 21 10:00 mongod.log.2018-07-21T01-00-02
      

       

      admin> db.runCommand(\{ logRotate: 1 });
       
       
       
      total 1732
      drwxr-xr-x 2 root root 328 Jul 24 17:17 .
      drwxr-xr-x 8 root root 90 Jul 18 10:55 ..
      {color:#FF0000}-rw-------{color} 1 root root 2825 Jul 24 17:17 mongod.log    {color:#FF0000}<=== chmod : 600{color}
      -rw------- 1 root root 148090 Jul 19 10:00 mongod.log.2018-07-19T01-00-02
      -rw------- 1 root root 119319 Jul 20 10:00 mongod.log.2018-07-20T01-00-02
      -rw------- 1 root root 113986 Jul 21 10:00 mongod.log.2018-07-21T01-00-02
      

        Attachments

          Activity

            People

            Assignee:
            nick.brewer Nick Brewer
            Reporter:
            piook bae eunmi
            Participants:
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: