diff options
author | Hendrik Jäger <gitcommit@henk.geekmail.org> | 2022-06-26 22:34:39 +0200 |
---|---|---|
committer | Hendrik Jäger <gitcommit@henk.geekmail.org> | 2022-07-25 23:53:04 +0200 |
commit | 54da0fea16fe96e031150a7f87de4567aa6ddc0b (patch) | |
tree | 9d62241cbb17a502f237dd4137a098d683db2ed8 | |
parent | 72b29d02cb6a7007944f81e0fb354f5ba833ed2f (diff) |
work with systemd
-rw-r--r-- | files/etc/systemd/system/s6.service | 14 | ||||
-rw-r--r-- | manifests/install.pp | 48 |
2 files changed, 45 insertions, 17 deletions
diff --git a/files/etc/systemd/system/s6.service b/files/etc/systemd/system/s6.service new file mode 100644 index 0000000..3c3c7ec --- /dev/null +++ b/files/etc/systemd/system/s6.service @@ -0,0 +1,14 @@ +[Unit] +Description=s6 supervision tree +Documentation=https://skarnet.org/software/s6/ + +[Install] +WantedBy=multi-user.target + +[Service] +Type=simple +ExecStart=/usr/bin/s6-svscan -t0 /etc/s6-scandir +ExecStop=/usr/bin/s6-svscanctl -t /etc/s6-scandir +ExecReload=/usr/bin/s6-svscanctl -an /etc/s6-scandir +Restart=always +RestartSec=1 diff --git a/manifests/install.pp b/manifests/install.pp index 9609076..f683aad 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -5,23 +5,6 @@ class s6::install { ; } file { - '/usr/local/bin/s6-svscanboot': - ensure => present, - source => [ - "puppet:///modules/s6/usr/local/bin/s6-svscanboot.${facts['os']['distro']['codename']}", - 'puppet:///modules/s6/usr/local/bin/s6-svscanboot', - ], - mode => '0755', - require => Package['s6'], - notify => Class['s6::service'], - ; - '/etc/init.d/s6': - ensure => present, - source => 'puppet:///modules/s6/etc/init.d/s6', - mode => '0755', - require => Package['s6'], - notify => Class['s6::service'], - ; '/etc/s6-services/': ensure => directory, ; @@ -32,6 +15,37 @@ class s6::install { ensure => directory, ; } + + if $facts['service_provider'] == 'systemd' { + file { + '/etc/systemd/system/s6.service': + ensure => present, + source => 'puppet:///modules/s6/etc/systemd/system/s6.service', + require => Package['s6'], + notify => Class['s6::service'], + ; + } + } else { + file { + '/usr/local/bin/s6-svscanboot': + ensure => present, + source => [ + "puppet:///modules/s6/usr/local/bin/s6-svscanboot.${facts['os']['distro']['codename']}", + 'puppet:///modules/s6/usr/local/bin/s6-svscanboot', + ], + mode => '0755', + require => Package['s6'], + notify => Class['s6::service'], + ; + '/etc/init.d/s6': + ensure => present, + source => 'puppet:///modules/s6/etc/init.d/s6', + mode => '0755', + require => Package['s6'], + notify => Class['s6::service'], + ; + } + } user { 's6-logs': ensure => present, |