Add sssd systemd service file override

sssd is monitored by pmon. But currently the Restart option in its
systemd service file is set to on-failure. This sometimes causes
systemd and pmon to fight to restart the service when it fails. All
processes monitored by pmon should have Restart set to "no".

This change added a systemd override file to set Restart to "no" for
sssd service.

Test Plan:
PASS: Standard system deployment.
PASS: Check sssd Restart option using "systemctl cat sssd", verify
      Restart option is set to "no", as following:

      # /etc/systemd/system/sssd.service.d/sssd-stx-override.conf
      [Service]
      # pmond monitors sssd service
      Restart=no
PASS: Kill sssd process, verify pmon restart it successfully by
      tailing pmon.log, and verify sssd is running by "systemctl
      status sssd" command.

Closes-Bug: 2023421
Signed-off-by: Andy Ning <andy.ning@windriver.com>
Change-Id: I84521caf3745122492afe9ef4a251e42129b29b0
This commit is contained in:
Andy Ning
2023-06-16 09:06:33 -04:00
parent a5489c0b62
commit 559b79b72e
2 changed files with 20 additions and 0 deletions

View File

@@ -21,6 +21,23 @@ class platform::sssd::config
inherits ::platform::sssd::params {
if $::osfamily == 'Debian' {
# Generate sssd systemd override file
$sssd_override_dir = '/etc/systemd/system/sssd.service.d'
file { $sssd_override_dir:
ensure => 'directory',
owner => 'root',
group => 'root',
mode => '0755',
}
-> file { "${sssd_override_dir}/sssd-stx-override.conf":
content => template('platform/sssd.systemd.override.conf.erb'),
owner => 'root',
group => 'root',
mode => '0644',
}
# Update sssd configuration
class { 'sssd':
manage_package => $manage_package,
manage_service => $manage_service,

View File

@@ -0,0 +1,3 @@
[Service]
# pmond monitors sssd service
Restart=no