Fix startup of the dirsrv@master Systemd unit on boot

The symlink created by Chef's service resource was wrong. Creating the
correct symlink fixes the automatic startup on boot
This commit is contained in:
Greg Karékinian 2020-05-15 13:54:34 +02:00
parent bf60f9fca8
commit 10f0460fd5

View File

@ -56,7 +56,14 @@ action :create do
end end
service service_name do service service_name do
action [:enable, :start] action [:start]
end
# :enable on the dirsrv@master service creates the wrong file
# (/etc/systemd/system/dirsrv.target.wants/dirsrv@master.service), seems to
# be a Chef bug. Let's do it manually
link "/etc/systemd/system/multi-user.target.wants/dirsrv@master.service" do
to "/lib/systemd/system/dirsrv@.service"
end end
cookbook_file "#{Chef::Config[:file_cache_path]}/users.ldif" do cookbook_file "#{Chef::Config[:file_cache_path]}/users.ldif" do