Use target for drivers in systemd#229
Conversation
This allows much better granularity and better monitoring in case of multiple UPSes.
|
Does this require a specific minimum systemd version number?
|
|
Also, this seems to be a generic (template-like) format, that would require some runtime instantiation for nut-driver@.service (iterate on ups.conf entries, then call nut-driver@.service...) |
|
ok, I think I got it probably: but then, though I see the benefit for manual calls, I'm still failing to identify how the current behavior is achieved. i.e. have all drivers started when calling "systemctl start nut-driver start" @miska thanks to shed some light on this. |
|
You call "systemctl enable nut-driver@devname start" for every UPS in your configuration file that you want to have started and then you can start/shutdown all of the selected by using "systemctl start/stop nut.driver.target" Advantages are that you can restart only one UPS which configuration changed without need to restart everything. And you can also disable some UPS for which you have configuration present in your config file but you do not have present in the moment - for example some maintenance. |
|
@miska wouldn't it make more sense to have the driver only be WantedBy=nut-driver.target and then have the nut-driver.target have an install section: |
|
@peterhoeg @miska @aquette : It seems this approach would also help retain the |
|
Suggestion above was included in #330 which, if acceptable, fully includes and then supersedes this older PR. |
|
Closing the present PR in favor of #330 |
This allows much better granularity and better monitoring in case of
multiple UPSes. Also provides ability to restart individual UPSes.