From 10f0460fd581381b284a973b23cf13e69fa5cceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Fri, 15 May 2020 13:54:34 +0200 Subject: [PATCH] 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 --- site-cookbooks/kosmos-dirsrv/resources/instance.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/site-cookbooks/kosmos-dirsrv/resources/instance.rb b/site-cookbooks/kosmos-dirsrv/resources/instance.rb index de6b6fd..956add8 100644 --- a/site-cookbooks/kosmos-dirsrv/resources/instance.rb +++ b/site-cookbooks/kosmos-dirsrv/resources/instance.rb @@ -56,7 +56,14 @@ action :create do end 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 cookbook_file "#{Chef::Config[:file_cache_path]}/users.ldif" do