Skip to content

Commit d600233

Browse files
committed
Minor fix for firstboot
1 parent 158953b commit d600233

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cookbooks/fb_sssd/recipes/default.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,16 @@
7272
service 'sssd' do
7373
only_if { node['fb_sssd']['enable'] }
7474
action [:enable, :start]
75-
subscribes :restart, 'template[/etc/nsswitch.conf]', :immediately
75+
# nsswitch is before sssd (for good reasons), but that means on first
76+
# boot, we'll trigger on the nsswitch notification and try to restart
77+
# even when we can't. This could of course happen outside of firstboot
78+
# so if the binary isn't there at compile time, don't bother setting up
79+
# the notification. This is safe: if the binary isn't there, it can't
80+
# be running and therefore can't have an old config... it will then be
81+
# started by this resource
82+
if File.exist?('/usr/sbin/sssd')
83+
subscribes :restart, 'template[/etc/nsswitch.conf]', :immediately
84+
end
7685
end
7786

7887
service 'disable sssd' do

0 commit comments

Comments
 (0)