Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

systemd provider for service resource doesn't pick up custom init scripts #2839

Closed
dAnjou opened this issue Jan 30, 2015 · 3 comments
Closed
Labels
Type: Enhancement Adds new functionality.

Comments

@dAnjou
Copy link

dAnjou commented Jan 30, 2015

I'm currently configuring Red5 on Debian Jessie using the init script from the Debian's repo. Red5 however is not in Jessie and we need a newer version than in Sid anyway.

After adapting the init script and putting it on the node I wanted to enable and start Red5.

template "/etc/init.d/red5" do
  source "red5/red5.service"
  mode "0750"
  action :create
end

service "red5" do
  supports :start => true, :stop => true, :restart => true, :status => true
  action [:enable, :start]
end

This failed, and after some investigation it turns out there's no unit file (e.g. red5.service). Running systemctl daemon-reload creates this unit file. So putting the following line right between the resources above makes all of this work:

execute "systemctl daemon-reload"

The systemd provider for the service resource should do this.

@lamont-granquist
Copy link
Contributor

run_action doesn't take an array of actions it does a single action. you need to call it repeatedly if that is what you're trying to do.

r = [....resourcey stuff...]
r.run_action(:enable)
r.run_action(:start)

@dAnjou
Copy link
Author

dAnjou commented Jan 30, 2015

@lamont-granquist Uhm, this wasn't the actual issue. Read the title of this issue. The systemd provider is buggy if not broken in that regard.

I edited the issue.

@dAnjou dAnjou changed the title systemd provider for service resource doesn't pick custom init scripts systemd provider for service resource doesn't pick up custom init scripts Jan 31, 2015
@lamont-granquist
Copy link
Contributor

After discussing this, we believe this is the way that it should work and after dropping a template you should have the template resource notify the execute resource to hit "systemctl daemon-reload". Otherwise we have to constantly be doing daemon-reload on every service resource action. The explicit solution is better because the template resource knows that daemon-reload actually needs to be called when it gets updated. We can't put that kind of intelligence directly into the systemd provider.

gsreynolds added a commit to gusrc/varnish that referenced this issue Jul 22, 2015
martinb3 pushed a commit to sous-chefs/varnish that referenced this issue Aug 21, 2015
@thommay thommay added Type: Enhancement Adds new functionality. and removed Enhancement labels Jan 25, 2017
@chef chef locked and limited conversation to collaborators Nov 16, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

No branches or pull requests

3 participants