From: Grigory Batalov <grisxa@mail.ru>
To: community@altlinux.ru
Subject: Re: [Comm] nut and UPS shutdown
Date: Mon, 28 Jul 2003 11:15:18 +0400
Message-ID: <20030728111518.568fe879.grisxa@mail.ru> (raw)
In-Reply-To: <200307252229.01344.alexey_borovskoy@mail.ru>
On Fri, 25 Jul 2003 22:29:01 +1300
Alexey Borovskoy <alexey_borovskoy@mail.ru> wrote:
> > В документации к NUT рекомендуется прописать в shutdown-скрипт
> > строки типа:
> >
> > if (test -f /etc/killpower)
> > then
> > echo "Killing the power, bye!"
> > /usr/local/ups/bin/upsdrvctl shutdown
> > fi
> >
> > Поскольку у нас shutdown - не скрипт, то совершенно непонятно,
> > куда их вписывать. Кто как поступает?
> >
> > P.S. 'upsdrvctl shutdown' инициирует выключение UPS
> > (и нагрузки, соответственно) при невозможности
> > дальнейшей работы от батарей.
>
> Я его запихал в /etc/init.d/halt
> Там есть такие строки:
>
> # See if this is a powerfail situation.
> UPSCTL=/etc/apcupsd/apccontrol
> if [ -x "$UPSCTL" -a -f /etc/apcupsd/powerfail ]; then
> action "Attempting to turn the UPS off:" "$UPSCTL" killpower
> message="The system is turned off"
> command=/sbin/poweroff
> fi
>
> Вот этот приведенный кусочек скрипта и подвергнулся правке.
> Был изменен путь к бинарнику и флагу_что_упс_на_батареях.
Спасибо, это то, что нужно.
Однако, при выполнении "shutdown" upsdrvctl вызывает драйвер
от UPS с соответствующими параметрами, например:
/usr/lib/nut/apcsmart -a ups250 -d 0 -k
Если /usr располагается на отдельном разделе, то в этот момент
он уже размонтирован. Так что команда "shutdown" UPS-у передана
быть не может, в результате чего машина проходит дальнейшие
стадии из /etc/init.d/halt и выключается по poweroff.
Как этого избежать?
--
Григорий Баталов,
группа техподдержки
ОАО "Ковдорский ГОК"
next prev parent reply other threads:[~2003-07-28 7:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-25 8:02 Grigory Batalov
2003-07-25 9:29 ` Alexey Borovskoy
2003-07-28 7:15 ` Grigory Batalov [this message]
2003-07-28 8:15 ` Alexey Borovskoy
2003-07-28 8:17 ` Sergey Bolshakov
2003-07-29 11:16 ` Grigory Batalov
2003-07-30 6:18 ` Grigory Batalov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030728111518.568fe879.grisxa@mail.ru \
--to=grisxa@mail.ru \
--cc=community@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git