Guest User!

You are not Sophos Staff.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Automatic initiation of upsc and upsmon on boot

Hello;

I am trying to identify how to get the upsc and upsmon applications to launch automatically at boot. 

Please note my efforts and understanding thus far below:

I am running my Sophos server as a UPS slave on my network. My UPS is connected to my ReadyNas DUO server (configured as master) which is broadcasting the UPS information to my Sophos server (configured as slave). 

I have adjusted my firewall settings to allow communication between the two servers (was surprised to find that SNMP was not the protocol being used in the broadcast when creating the firewall rules). When I initiate the upsc and upsmon commands, the UPS is detected and the Sophos server responds to the UPS status (powers down etc). 

When studying up on the NUT system I noted that the upsd driver was not required for a slave configuration like the one I am configuring as it searches for local hosts only. 

When activating the upsd driver it obviously doesnt work. I am certain this upsd driver is loading at boot, and I have noticed during my search through several configuration files that it will not initiate upsc and upsmon if it does not identify a local UPS (mine is on a network so it produces a null result).

Can someone perhaps assist me in identifying how I can initiate upsmon and upsc during the boot up sequence? As I currently need to activate them each time I reboot my server.


This thread was automatically locked due to age.
  • The upsd is initiated automatically by udev when a supported USB UPS is connected to the UTM.
  • Hi Trollvottel

    Thanks for the response.

    My issue is exactly that, it only initiates upsd when a UPS is connected via USB. I am connecting a slave via a network with my UPS and upsd should not be initiated, only upsc and upsmon.

    Is there anyway to alter the configuration codes to initiate these two applications during the boot sequence?

    Kind regards
  • Hello BarryG;

    Thanks for the response. I can see how the solution will definitely work. However, I am not as familiar with Linux as I would like to be and I am having difficulty getting the upsmon to initiate.

    Please dont laugh cause I am positive I am doing this completely wrong, but in the link you sent, it states "Don´t forget to add upsmon to rc3.d " 

    I have taken that literally as copy the upsmon file to that directory. I dont understand linux file links and so I use the command cp /sbin/upsmon to /etc/init.d/rc3.d/. 

    When I check the directory I see that upsmon has copied successfully however it is highlighted in green and the other files (links) are sky blue. Im sure I am missing the point here lol.

    Also, I noted on boot that my Sophos states after boot that it skipped level 3. Is that normal? Would this mean that the files or links in rc3.d are skipped? Dont think they are?

    If you could provide me with a little guidance around this point I know I will have this working once I can properly execute the advice from your link.

    Thank you so much for pointing me in the right direction.[:D]
  • - Delete your copied file: "rm /etc/init.d/rc3.d/$filename"
    - Create the correct symlinks:
    -- "ln -s /etc/init.d/upsd /etc/init.d/rc3.d/S99upsd"
    -- "ln -s /etc/init.d/upsd /etc/init.d/rc3.d/K01upsd"

    Remember your custom UPS config may get lost when an U2D is installed which updates upsd and related scripts.
  • Hello Trollvottel

    I hate to be difficult but my sophos system does not appear to recognize the "In -s" bash?

    Not sure what to do?
  • Apologies,

    I mistook the L for an I.

    Will test the new entries and revert back if there are any issues. 

    Thank you very much for your help on this. I never would have figured this out ;-).

    Kind regards
  • Hello Trollvottel

    So I tested the system and had no luck. The commands you provided work fine. 

    My concern however, is that upsd is primarily for a localhost and based on your commands we were initiating upsd? I just need upsmon and upsc to initiate automatically and it works perfectly.

    I did note that level 3 "appears" to be getting skipped. I have a picture of what I am talking about, just not sure how to attach it to the forum?
  • Forgive me,

    For some reason I had to be in the rc3.d directory and execute the command. I created the symbolic links in root accidentally.

    My issue is now resolved and it works perfectly.

    Thank you so much for your help and patience.

    Kind regards