This is slightly more complicated than it looks at first.
I suggest an API similar to the following:
service "foo" do
priority 20
end
this will add foo to the default runlevels (2,3,4,5 on Debian/Ubuntu, possibly others on RH) with a start priority of 20 and add it to 0, 1 and 6 with a stop priority of 80.
Alternatively, if you want to do something more complex, you can do
service "foo" do
priority({ 0 => [ :start, 15 ],
1 => [ :stop, 55 ]
})
end
This will add it to runlevel 0 with a start priority of 15 and runlevel 1 with a stop priority of 55.
Does this sound sane? What should we do in the case that a service provider does not support priorities (like upstart) or runlevels?
This is slightly more complicated than it looks at first.
I suggest an API similar to the following:
service "foo" do
priority 20
end
this will add foo to the default runlevels (2,3,4,5 on Debian/Ubuntu, possibly others on RH) with a start priority of 20 and add it to 0, 1 and 6 with a stop priority of 80.
Alternatively, if you want to do something more complex, you can do
service "foo" do
priority({ 0 => [ :start, 15 ], 1 => [ :stop, 55 ] })
end
This will add it to runlevel 0 with a start priority of 15 and runlevel 1 with a stop priority of 55.
Does this sound sane? What should we do in the case that a service provider does not support priorities (like upstart) or runlevels?