[Nut-upsuser] NUT service files on systemd

Simon Wilson simon at simonandkate.net
Wed Nov 30 11:37:00 GMT 2022


Thanks André...

Good to see i'm on the right path with enabling the enumerator.path  
and .service - all my reading and testing indicates that those need to  
be active/enabled to ensure that there is a correct  
nut-driver at upsname.service unit file always up to date and ready to go.

You've enabled all the remaining unit files - nut-driver.target,  
nut-driver at .service, nut-server, nut-monitor, and nut.target. I'm  
testing at the moment by just enabling nut.target. nut.target has:

[Unit]
Wants= ...nut-driver.target nut-server.service nut-monitor.service

..and nut-driver at eaton5sx.service has:

[Install]
WantedBy=nut-driver.target

...so *in theory* when nut.target starts it should try to kick all of  
those Wants services into life, and nut-driver.target should start the  
actual driver service file. I'll find out! :)

Simon.

----- Message from Andre Mueller via Nut-upsuser  
<nut-upsuser at alioth-lists.debian.net> ---------
     Date: Wed, 30 Nov 2022 12:18:24 +0100
     From: Andre Mueller via Nut-upsuser <nut-upsuser at alioth-lists.debian.net>
Reply-To: Andre Mueller <andre.mueller at himmel-blau.com>
  Subject: Re: [Nut-upsuser] NUT service files on systemd
       To: nut-upsuser at alioth-lists.debian.net


> Hello
>
> I had installed nut 2.8.0-4 debian packages "manually" on my ubuntu  
> system. After reworking paths (with confs and symlinks) from a  
> previous source make installation of nut 2.8.0-3 I was able to run  
> the default packages within systemctl also after reboots (taking all  
> confs from /etc/nut/).
>
> nut-driver-enumerator.path                 enabled         enabled
> nut-client.service                         alias           -
> nut-driver-enumerator.service              enabled         enabled
> nut-driver at .service                        indirect        enabled
> nut-monitor.service                        enabled         enabled
> nut-server.service                         enabled         enabled
> nut-driver.target                          enabled         enabled
> nut.target                                 enabled         enabled
>
> best,
>
> André
>
>
> Am 30.11.2022 um 11:44 schrieb Simon Wilson via Nut-upsuser:
>> This is what I am running with at the moment:
>>
>> [root at emp80 ups]# systemctl list-unit-files | grep -i nut
>> nut-driver-enumerator.path                                           
>>    enabled
>> nut-driver-enumerator.service                                        
>>    enabled
>> nut-driver at .service                                                  
>>    indirect
>> nut-monitor.service                                                  
>>    disabled
>> nut-server.service                                                   
>>    disabled
>> nut-driver.target                                                    
>>    disabled
>> nut.target                                                           
>>    enabled
>>
>> nut-driver-enumerator.path enabled (and running) monitors for edits  
>> to ups.conf, and flows changes into a driver restart. I can see  
>> this happen if I edit ups.conf: the driver restarts.
>>
>> The companion nut-driver-enumerator.service is a one-shot run  
>> service, is also enabled to run at boot - this appears to run on  
>> EITHER when triggered by nut-driver-enumerator.path OR on reboot  
>> (enabled), and I believe generates the required  
>> nut-driver at eaton5sx.service.
>>
>> nut.target enabled should then start nut-driver.target, nut-server  
>> and nut-monitor (all are set to "wants" in the unit file).
>>
>> At least, that is how I am reading it - if anyone else has other  
>> pointers please let me know! :-)
>>
>> Will see what happens over multiple reboots!
>>
>>


----- End message from Andre Mueller via Nut-upsuser  
<nut-upsuser at alioth-lists.debian.net> -----



-- 
Simon Wilson
M: 0400 12 11 16




More information about the Nut-upsuser mailing list