NUT resets config on every service restart



  • Hello all,
    I have a problem with NUT package (v2.6.4) on Pfsense 2.0.3.
    I'm trying to use Pfsense as a NUT master to send UPS evenrts uto 5 NUT slaves.
    I have encontered two probelms that are preventing me to use this config:

    1. each time the service or the firewall are restarted the upd.users files gets overwritten with a different password for the same user [monuser];
    2. the upsd.users doean't include the user I input in the config page [upsmon] as shown in the attached pic.
      So each time the firewall restarts all the slaves get disconnected due to "ACCESs DENIED" error.
      Any solution?
      Thanks for your kind attention

    Alberto



  • Hello all, too!

    I was running into nearly the same probs when using nut 2.6.4 on pfsense 2.0.3 the first time with a direct attached ups. I fiddled around a while with my remote-client config with no success. Every time i started the upsd on the upsd-client server, i got the 'access-denied' message in the logs. But the problem is in fact the package config on pfsense.

    The remote-user parameters (username, password at a minimum) from the gui are not written into the proper config-file for nut ( /usr/local/etc/nut/upsd.users ). If you set the user-config manually into this file, everything works, when accessing nut from remote-clients.

    So in pfsense /usr/local/etc/nut/upsd.users you can insert e.g., maybe via vi:
      [upsclient]
      password = <somepassword>upsmon slave

    It is not overwritten here by service-restarts, but of course when you hit the save-button on the nut-configuration page.

    I've no real knowledge of php, but i think the problem lies in the depreceation of the 'address'-variable of nut's gui-page.

    If you change /usr/local/pkg/nut.inc
    from
        275                if($allowaddress && $allowuser) {
    to:
        275                if($allowuser) {
        276                        $upsd_users .= "\n[$allowuser]\n";
        277                        $upsd_users .= "password = $allowpass\n";
        278                        $upsd_users .= "upsmon slave\n";
        279                }
    the user-configuration is written appropriate from the gui's values.

    But i think the package itself has to be corrected, because an update or a package reinstall may overwrite this mod.

    cheers

    Wolfgang</somepassword>




Log in to reply