Skip to content

Commit a5e9663

Browse files
committed
Fixed bug in policy where service restart fails
On Ubuntu/Debian, the service is called ssh, not sshd. Ticket: ENT-13766 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent 853c492 commit a5e9663

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ci/cfengine-build-host-setup.cf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ bundle agent cfengine_build_host_setup
189189
"ChallengeResponseAuthentication",
190190
};
191191
"sshd_config_files" slist => findfiles("/etc/ssh/sshd_config", "/etc/ssh/sshd_config.d/*.conf");
192+
debian|ubuntu::
193+
"sshd_service_name" string => "ssh";
194+
!(debian|ubuntu)::
195+
"sshd_service_name" string => "sshd";
192196

193197
classes:
194198
any::
@@ -391,7 +395,7 @@ jenkins_builds ALL=NOPASSWD: /usr/bin/podman
391395

392396
services:
393397
sshd_hardened::
394-
"sshd"
398+
"$(sshd_service_name)"
395399
service_policy => "restart",
396400
handle => "sshd_restarted",
397401
comment => "Restart sshd to apply hardened configuration";

0 commit comments

Comments
 (0)