When I declare a service as follows:
service "my_service" do
action [:enable, :start]
end
What will chef actually execute in the end ?
Will it just run service my_service enable
and service my_service start
?
For start
, there should be no problem whether your linux server is using init.d or systemd, since the systemctl
command is backward compatible with the service
command. But there really isn't such option as enable
for the service
command. For example, if you run service my_service enable
, you'll get
Usage: /sbin/service my_service {start|stop|reload|restart|try-restart|force-reload|status}
In my case, I'm using systemd, and what I really what chef to do is to run systemctl enable my_service
. But from the documentation I cannot tell what chef will do exactly in the end.
I could specify a custom start_command
for the start
action, but unfortunately there's no enable_command
.
Does anyone have a clear answer or reference for that?