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

UPS shutdown script

I did a search of this forum and found nothing so I did a bit of Googling but everything I did find leads me to think that there is no way I can do an ordered shutdown of my ASL box when the power goes pear shaped for an extended period of time.
I have an APC SmartUPS that I would like to configure to shutdown Astaro. Is this possible?
Any help or advice on this subject would be appreciated.


This thread was automatically locked due to age.
  • Watching with interest in the howto answers. I have a similar setup.
    A thought, have you tried just plugging the UPS serial interface into the firewall at build/re-boot time? I will give it a go tomorrow when I have the firewall to myself.

    Ian M [:)]
  • Currently I have the serial cable plugged into a Windows box with the PowerChute client installed. This UPS powers three other boxes as well as the ASL box and some other hardware. The UPS is managed from my Server 2003 PDC on my internal network, in another location, that is powered by another APC SmartUPS. I have scrips to shutdown all of the windows boxes before the UPS batteries quit but I currently have no way to shut down the ASL box. Letting it die when the UPS battery power dies is not my shutdown method of choice.
  • I am not really sure about letting any electronic device die slowly as the UPS power sinks slowly in the west. Normally youy would go with a straight power off, no problems, but Batteries don't go flat instantaneously. Yes I realise that most will stop producing output when the battery voltage reaches a certain point, but how clean will the cutoff be? Will it be like turning the power switch off or will it be brownout style?
    I suppose there are two ways to find out, read the manual or try it out in real life.

    Ian M [:)]
  • A UPS will cleanly shutoff when the battery is too low.

    Barry
  • Is it just me or are there others that would prefer to have the ability to do an ordered shutdown of ALL boxes on their network in the case of an extended power outage?
    I have read all of the comments people have given in this thread and the link that ReD-MaN gave and have a little more comfort that my ASL box will in fact deal with just being powered off, I just don't like that this is my only option. Letting my UPS run until its batteries are flat is another thing I would prefer not to do.
    Is it possible that Astaro will build a mechanism into its system allowing an ordered shutdown in the future?
  • Hello Big0,

    i habe a answer for you,
    you must have a pc with usv-software, your usv software
    start a script on low power. in a script insert follow

    step 1
    pscp -2 -pw passwort drive:\path\shutdown.now loginuser@ip-adresse:/home/login

    this file copy on low power to astrao-firewall.
    the firewall check all 5min is file in dir, if file insert
    then del shutdown.now and stop a firewall.
    shutdown.now is a emty file.

    step2
    create a file shdown.sh with
    if [ -e "/home/login/shutdown.now" ]
      then
       rm /home/login/shutdown.now
       /sbin/halt
    fi

    step3
    create a file crontab.sdown with
    5,10,15,20,25,30,35,40,45,50,55,00 * * * * root /usr/local/bin/shdown.sh

    step4
    copy file shdown.sh and crontab.sdown too /home/login
    with winscp

    step5
    copy shdown.sh from /home/login too /usr/local/bin
    copy crontab.sdwon from /home/login too /etc

    step6
    chmod 777 /usr/local/bin/shdown.sh

    step7
    reboot your firewall an check a entry in /etc/crontab
    you must have a entry with
    5,10,.... root /usr/local/bin/shdown.sh

    i hope, i can help
  • [ QUOTE ]
    /sbin/halt

    [/ QUOTE ]

    /sbin/poweroff

    would be better

    Also, one should set their BIOS to power-on when AC back, or similar.

    Barry