subnet in upsd.conf

Printers, HDDs, USB/eSATA drives, 3rd-party programs
Post Reply
mycroft.holmes
New here
Posts: 8
Joined: Sun Mar 21, 2021 2:26 am

subnet in upsd.conf

Post by mycroft.holmes »

Hello forum,

I connected an APC ups to my Qnap NAS, and clicked "enable network ups master".
Then I manually edited /mnt/HDA_ROOT/.config/ups/upsd.conf and changed "reject all" into "accept all".
(I need to allow multiple clients to connect)
But unfortunately, the file gets rewritten, I'm not sure precisely when or where is the "template".

So at the moment I tried to add manually a dummy IP from the GUI and then I changed the file from (say)

Code: Select all

ACL client_1 192.168.1.123
ACCEPT client_1
to

Code: Select all

ACL client_1 192.168.1.0/24
Would it work?
From the GUI I cannot type "/" in the box.

thanks,
MH
FSC830
Experience counts
Posts: 2043
Joined: Thu Mar 03, 2016 1:11 am

Re: subnet in upsd.conf

Post by FSC830 »

How is the UPS connected, by USB?
And what exactly do you try to achieve?
In GUI you can add up to 5 clients when NAS is operating as network master.
Network master means, that the NAS sends a "on battery" (or "shutdown"?) command to this 5 clients.

Regards
mycroft.holmes
New here
Posts: 8
Joined: Sun Mar 21, 2021 2:26 am

Re: subnet in upsd.conf

Post by mycroft.holmes »

>How is the UPS connected, by USB?

yes, by USB, but this is not relevant. in the scope of the NAS, the ups works perfectly.

>And what exactly do you try to achieve?
>Network master means, that the NAS sends a "on battery" (or "shutdown"?) command to this 5 clients.

ok, some more context.

I don't care about "sending messages" from master to clients. I only care that the server will reply ONLY to requests coming from clients, because the GUI will generate a upsd.conf file like:
ACL client_1 (ip)
ACCEPT client_1
ACL client_2 (another ip)
ACCEPT client_2
etc.
REJECT all

if I execute, say,

Code: Select all

upsc qnapnas@myqnap.local
from another properly configured machine, I get a "deny", unless the client machine is in the list:

Code: Select all

pi@raspberry:~ $ upsc qnapups@myqnap.local
Init SSL without certificate database
Error while connecting to myqnap.local, disconnect
Error: Server disconnected
Instead I want the qnap to reply to ALL requests from the local subnet, so basically I want 192.168.1.0/24 as a valid client (which IS ALLOWED in nut config, but artificially disallowed by qnap GUI).

So, as I said, I tried to change the config and add an "accept all", but it doesn't work, as periodically the config file gets rewritten (and I don't know why/where/who).

More precisely my question is: do you know where is the TEMPLATE config file that the GUI uses?
FSC830
Experience counts
Posts: 2043
Joined: Thu Mar 03, 2016 1:11 am

Re: subnet in upsd.conf

Post by FSC830 »

Sorry to say, but no, I dont know where the template is located.
If the trigger for rewriting is unknown a workaround is hard to find. :S
For some kind of this rewriting (or recreated by boot) files an entry in autostart.sh could be a workaround.
Or even a cron job. But without any idea... :?

Regards
mycroft.holmes
New here
Posts: 8
Joined: Sun Mar 21, 2021 2:26 am

Re: subnet in upsd.conf

Post by mycroft.holmes »

does autostart.sh run BEFORE upsd?
FSC830
Experience counts
Posts: 2043
Joined: Thu Mar 03, 2016 1:11 am

Re: subnet in upsd.conf

Post by FSC830 »

Not sure, never figured out in which sequence the services are starting.
Also I didnt they this is the solution for this issue, just that are other config files which are written during boot and thus can be modified with an autorun entry.

Regards
Post Reply

Return to “Hardware & Software Compatibility”