From: Grigory Batalov <grisxa@mail.ru>
To: community@altlinux.ru
Subject: Re: [Comm] nut and UPS shutdown
Date: Tue, 29 Jul 2003 15:16:08 +0400
Message-ID: <20030729151608.7d84d828.grisxa@mail.ru> (raw)
In-Reply-To: <m3n0ezukt0.fsf@pc313.belcaf.minsk.by>
[-- Attachment #1: Type: text/plain, Size: 2357 bytes --]
On Mon, 28 Jul 2003 11:17:47 +0300
Sergey Bolshakov <s.bolshakov@sam-solutions.net> wrote:
> > /usr/lib/nut/apcsmart -a ups250 -d 0 -k
>
> > Если /usr располагается на отдельном разделе, то в этот момент
> > он уже размонтирован. Так что команда "shutdown" UPS-у передана
> > быть не может, в результате чего машина проходит дальнейшие
> > стадии из /etc/init.d/halt и выключается по poweroff.
>
> > Как этого избежать?
>
> Вероятно, переносом в /lib. Буду признателен, если кто-то суммирует
> сказанное и перешлет мне либо в BTS.
Поскольку драйвера от nut - это самостоятельные программы,
их можно использовать отдельно от upsdrvctl, то я бы положил
их прямо в /sbin. Это легко меняется в спеке следующим
образом:
--- nut.spec.orig 2003-03-15 16:39:19 +0300
+++ nut.spec 2003-07-29 11:09:11 +0400
@@ -3,7 +3,7 @@
%define _sbindir /sbin
%define confdir %_sysconfdir/%name
-%define modeldir %_libdir/%name
+%define modeldir %_sbindir
%define cgidir /var/www/cgi-bin
%define runas upsmon
@@ -78,7 +81,7 @@
%install
%make_install DESTDIR=%buildroot install install-cgi
-%__mv -f %buildroot%modeldir/upsdrvctl %buildroot%_sbindir
+#%__mv -f %buildroot%modeldir/upsdrvctl %buildroot%_sbindir
%__install -p -m0755 -D %SOURCE1 %buildroot%_initdir/upsd
%__install -p -m0755 -D %SOURCE2 %buildroot%_initdir/upsmon
%__mkdir_p %buildroot%_localstatedir/%name
Кроме того, нужно заменить в секции %files
%modeldir/*
на
%modeldir/apcsmart
%modeldir/newapc
и т.д. все драйвера. Я собирал только нужные, так что
здесь не привожу. Тогда кусок отключения UPS из
/etc/init.d/halt выглядит так:
UPSCTL=/sbin/upsdrvctl
if [ -x "$UPSCTL" -a -f /etc/killpower ]; then
action "Attempting to turn the UPS off:" "$UPSCTL" shutdown
message="The system is halted"
command=/sbin/poweroff
fi
APC PowerStack 250 почему-то всё равно ждёт ~200 секунд перед
отключением, на что halt совершенно не расcчитывал. Поэтому
успевает сработать /sbin/poweroff. Чтобы poweroff не отключал
питание от материнской платы, можно запретить загрузку модуля
apm в /etc/modules.conf:
alias apm null
Ещё полезно было бы добавить в пакет с nut прилагаемый патч,
иначе у меня powernet не работает. Проверял на APC Web/SNMP
Management Card (AP9606).
--
Григорий Баталов,
группа техподдержки
ОАО "Ковдорский ГОК"
[-- Attachment #2: nut-1.2.3-alt-oid_ambtemp.diff --]
[-- Type: text/plain, Size: 958 bytes --]
diff -ruN nut-1.2.3.orig/drivers/powernet.h nut-1.2.3/drivers/powernet.h
--- nut-1.2.3.orig/drivers/powernet.h 2003-07-02 17:48:22 +0400
+++ nut-1.2.3/drivers/powernet.h 2003-07-24 11:23:28 +0400
@@ -94,9 +94,6 @@
#define OID_GRACEDELAY ".1.3.6.1.4.1.318.1.1.1.5.2.10.0"
#define OID_RETDELAY ".1.3.6.1.4.1.318.1.1.1.5.2.9.0"
#define OID_LOBATTIME ".1.3.6.1.4.1.318.1.1.1.5.2.8.0"
-/* Environmental sensors (AP9612TH and others) */
-#define OID_AMBTEMP ".1.3.6.1.4.1.318.1.1.2.1.1.0"
-#define OID_AMBHUMID ".1.3.6.1.4.1.318.1.1.2.1.2.0"
#define PN_VAR_COMMUNITY "community"
#define PN_VAR_SDTYPE "sdtype"
@@ -236,8 +233,6 @@
PN_TYPE_TIME | PN_FLAG_OK },
{ INFO_LOBATTIME, FLAG_STRING | FLAG_RW, 3, OID_LOBATTIME, "",
PN_TYPE_TIME | PN_FLAG_OK },
- { INFO_AMBTEMP, 0, 0, OID_AMBTEMP, "", PN_FLAG_OK },
- { INFO_AMBHUMID, 0, 0, OID_AMBHUMID, "", PN_FLAG_OK },
/* instant commands. */
{ CMD_OFF, 0, OFF_DO, OID_OFF, "", PN_FLAG_OK },
next prev parent reply other threads:[~2003-07-29 11:16 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
2003-07-28 8:15 ` Alexey Borovskoy
2003-07-28 8:17 ` Sergey Bolshakov
2003-07-29 11:16 ` Grigory Batalov [this message]
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=20030729151608.7d84d828.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