← Back to team overview

sts-sponsors team mailing list archive

[Bug 1819046] Re: Systemd unit file reads settings from wrong path

 

** Description changed:

  [Impact]
  Systemd Unit file doesn't read any settings by default
  
  [Description]
  The unit file shipped with the Xenial pacemaker package tries to read environment settings from /etc/sysconfig/ instead of /etc/default/. The result is that settings defined in /etc/default/pacemaker are not effective.
  Since the /etc/default/pacemaker file is created with default values when the pacemaker package is installed, we should source that in the systemd unit file.
  
  [Test Case]
  1) Deploy a Xenial container:
-     $ lxc launch ubuntu:xenial pacemaker
+     $ lxc launch ubuntu:xenial pacemaker
  2) Update container and install pacemaker:
-     root@pacemaker:~# apt update && apt install pacemaker -y
- 3) Check the systemd unit file for the "EnvironmentFile" option:
-     root@pacemaker:~# systemctl cat pacemaker | grep EnvironmentFile
-     EnvironmentFile=-/etc/sysconfig/pacemaker
-     EnvironmentFile=-/etc/sysconfig/sbd
+     root@pacemaker:~# apt update && apt install pacemaker -y
+ 3) Change default pacemaker log location:
+     root@pacemaker:~# echo "PCMK_logfile=/tmp/pacemaker.log" >> /etc/default/pacemaker
+ 4) Restart pacemaker service and verify that log file exists:
+     root@pacemaker:~# systemctl restart pacemaker.service
+     root@pacemaker:~# ls -l /tmp/pacemaker.log
+     ls: cannot access '/tmp/pacemaker.log': No such file or directory
+ 
+ After fixing the systemd unit, changes to /etc/default/pacemaker get picked up correctly:
+     root@pacemaker:~# ls -l /tmp/pacemaker.log
+     -rw-rw---- 1 hacluster haclient 27335 Mar  7 20:46 /tmp/pacemaker.log
+ 
  
  [Regression Potential]
  The regression potential for this should be very low, since the configuration file is already being created by default and other systemd unit files are using the /etc/default config. In case the file doesn't exist or the user removed it, the "-" prefix will gracefully ignore the missing file according to the systemd.exec manual [0].
  Nonetheless, the new package will be tested with autopkgtests and the fix will be validated in a reproduction environment.
  
  [0] https://www.freedesktop.org/software/systemd/man/systemd.exec.html

-- 
You received this bug notification because you are a member of STS
Sponsors, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1819046

Title:
  Systemd unit file reads settings from wrong path

Status in pacemaker package in Ubuntu:
  Fix Released
Status in pacemaker source package in Xenial:
  Confirmed

Bug description:
  [Impact]
  Systemd Unit file doesn't read any settings by default

  [Description]
  The unit file shipped with the Xenial pacemaker package tries to read environment settings from /etc/sysconfig/ instead of /etc/default/. The result is that settings defined in /etc/default/pacemaker are not effective.
  Since the /etc/default/pacemaker file is created with default values when the pacemaker package is installed, we should source that in the systemd unit file.

  [Test Case]
  1) Deploy a Xenial container:
      $ lxc launch ubuntu:xenial pacemaker
  2) Update container and install pacemaker:
      root@pacemaker:~# apt update && apt install pacemaker -y
  3) Change default pacemaker log location:
      root@pacemaker:~# echo "PCMK_logfile=/tmp/pacemaker.log" >> /etc/default/pacemaker
  4) Restart pacemaker service and verify that log file exists:
      root@pacemaker:~# systemctl restart pacemaker.service
      root@pacemaker:~# ls -l /tmp/pacemaker.log
      ls: cannot access '/tmp/pacemaker.log': No such file or directory

  After fixing the systemd unit, changes to /etc/default/pacemaker get picked up correctly:
      root@pacemaker:~# ls -l /tmp/pacemaker.log
      -rw-rw---- 1 hacluster haclient 27335 Mar  7 20:46 /tmp/pacemaker.log

  
  [Regression Potential]
  The regression potential for this should be very low, since the configuration file is already being created by default and other systemd unit files are using the /etc/default config. In case the file doesn't exist or the user removed it, the "-" prefix will gracefully ignore the missing file according to the systemd.exec manual [0].
  Nonetheless, the new package will be tested with autopkgtests and the fix will be validated in a reproduction environment.

  [0] https://www.freedesktop.org/software/systemd/man/systemd.exec.html

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pacemaker/+bug/1819046/+subscriptions