Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-6844

amreport, amdump hang due to missing /etc/amanda/DailySet1/command_file, which amandabackup user cannot create

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-8.5.0
    • amanda
    • Minor
    • sst_cs_system_management
    • ssg_core_services
    • 3
    • False
    • Hide

      None

      Show
      None
    • If docs needed, set a value

      Description of problem:
      As shipped, Amanda cannot perform dumps due to the amandabackup user not having permission to create the file /etc/amanda/DailySet1/commmand_file. Commands such as amreport or amdump loop trying to create the file once per second until a writable command_file is created (or until the amandabackup user is given write permission to the /etc/amanda/DailySet1/ directory).

      Version-Release number of selected component (if applicable):
      amanda-3.5.1-13.el8.x86_64
      amanda-server-3.5.1-13.el8.x86_64

      How reproducible:
      Always

      Steps to Reproduce:
      1. Install the packages via "dnf install amanda-server amanda-client".
      2. As the amanadabackup user, attempt to initiate a backup via "amdump DailySet1". (Since no backup has been configured, this will produce the message "Can't open tape device /dev/YOUR-TAPE-DEVICE-HERE: No such file or directory" and a prompt to enter ^D to abort, but this is irrelevant to this issue--the same thing happens if a DLE has been configured.)
      3. Run "strace -p $(pgrep planner)" to trace system calls of the planner process. Observe that it's looping trying to create /etc/amanda/DailySet1/command_file and getting "permission denied" errors.
      4. Hit Ctrl-C twice to abort the amdump process. Observe that running "amreport DailySet1" also hangs, and running "strace amreport DailySet1)" similarly shows repeated failed attempts to create /etc/amanda/DailySet1/command_file .

      Actual results:
      The planner and amdump processes loop, and /var/log/amanda/server/DailySet1/ will contain planner*, driver*, and amreport* logs containing repeated entries such as:

      /var/log/amanda/server/DailySet1/amreport.20220110095258.debug:Mon Jan 10 09:53:02.989265035 2022: pid 2042915: thd-0x5573ebaf1600: amreport: file_lock_lock open failed (/etc/amanda/DailySet1/command_file): Permission denied
      /var/log/amanda/server/DailySet1/amreport.20220110095258.debug:Mon Jan 10 09:53:03.989382629 2022: pid 2042915: thd-0x5573ebaf1600: amreport: file_lock_lock open failed (/etc/amanda/DailySet1/command_file): Permission denied
      /var/log/amanda/server/DailySet1/amreport.20220110095258.debug:Mon Jan 10 09:53:04.989465466 2022: pid 2042915: thd-0x5573ebaf1600: amreport: file_lock_lock open failed (/etc/amanda/DailySet1/command_file): Permission denied

      Expected results:
      The Amanda processes should not hang; e.g., pressing Ctrl-D when prompted with "enter ^D to abort" by amdump should cause the amdump process to exit within a few seconds.

      Additional info:
      Creating the file /etc/amanda/DailySet1/command_file and chown'ing it to the amandabackup user (even after the Amanda commands have been started) will allow Amanda to proceed. Chown'ing the /etc/amanda/DailySet1/ directory to the amandabackup user also works, but the amandabackup user should probably not have write access to the configuration directory without a compelling reason.

      Note that this problem did not affect Red Hat Enterprise Linux 7, as the command_file mechanism was introduced after the version of Amanda that was shipped with that release (amanda-3.3.3).

      Including an empty /etc/amanda/DailySet1/command_file file with appropriate permissions in the amanda-server package as a configuration file may be adequate to remedy the issue.

      It's not clear to me why the Amanda authors chose to locate the command_file file in the configuration directory rather than, e.g., /var/lib/amanda/DailySet1/ (which would already have appropriate permissions), since the amandabackup user does not typically modify any other files in the configuration directories, but that decision may be beyond the scope of this report.

            rhn-support-pcahyna Pavel Cahyna
            djast_ecf djast@ecf.utoronto.ca (Inactive)
            Pavel Cahyna Pavel Cahyna
            rhel-cs-system-management-subsystem-qe Bot rhel-cs-system-management-subsystem-qe Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: