From owner-freebsd-questions@FreeBSD.ORG Fri Jan 11 07:43:41 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 231AD16A417 for ; Fri, 11 Jan 2008 07:43:41 +0000 (UTC) (envelope-from ryallsd@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.228]) by mx1.freebsd.org (Postfix) with ESMTP id DD54E13C447 for ; Fri, 11 Jan 2008 07:43:40 +0000 (UTC) (envelope-from ryallsd@gmail.com) Received: by nz-out-0506.google.com with SMTP id l8so566100nzf.13 for ; Thu, 10 Jan 2008 23:43:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=YFxqs6Ss89A1jQ0XVdNTNNmBaDojO3hkYxwo3ICPSYw=; b=r6DRXkvZd29XlAi17+PFq9GaVryFdQTsgOIOhl5VIfIBUchmME5+PZxJg5l9q81NieW+mETQORE5Z1NzKkDcNkFGELUVIx4cvBEE73jNYBjZVEqkBoiD0oYY5H2ZyR3IH6dLsg/1w/dA1R1xuqdO9b/sEwDg14cZucTMoLmpR3k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Z+ApXM/K+BStwMsyjI9BnxnHhNbgL31PvIpqUwLW8lhK7v6kxATzUMHdNLiwkwICM6h+9YmkN8BgQImOUAvQagk2Sa4FOHxolJfc/o0XIV9QIGCK13HKPmPhqpmLh1cuhXPeOFX1Zu8d5+TmQINJE+Uf7MRCUK4f4YkoqmX6NPc= Received: by 10.142.229.4 with SMTP id b4mr1474294wfh.118.1200037419711; Thu, 10 Jan 2008 23:43:39 -0800 (PST) Received: by 10.142.239.3 with HTTP; Thu, 10 Jan 2008 23:43:39 -0800 (PST) Message-ID: Date: Thu, 10 Jan 2008 23:43:39 -0800 From: "Derrick Ryalls" To: "Kurt Buff" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6.0.0.22.2.20080110025841.023a9bb8@mail.computinginnovations.com> <6.0.0.22.2.20080110155430.023d29d8@mail.computinginnovations.com> <54db43990801101514y317a2889l7ad18fa4ffce56be@mail.gmail.com> Cc: Bob Johnson , FreeBSD Questions Subject: Re: Nut and RAID on FreeBSD 7.0 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2008 07:43:41 -0000 On Jan 10, 2008 3:52 PM, Kurt Buff wrote: > > On Jan 10, 2008 3:14 PM, Bob Johnson wrote: > > On 1/10/08, Derrick Ryalls wrote: > > > > > > > > Perhaps I need to re-evaluate my line of thinking. Light sometime > > > flicker, but power almost never goes out. When it does it is either > > > back on in less than 1 minute, or out for hours. If the UPS detects > > > critical correctly and gives me at least a minute before death, then > > > that should be plenty of time for the system to auto-shutdown. Guess > > > I will have to do some experimentation tonight. > > > > While you experiment, keep in mind the following sequence of events: > > > > -- Power fails > > -- UPS signals low battery > > -- System shuts down > > -- Power returns before UPS shuts itself down > > --> System never reboots, because it never lost power. > > > > Getting around this is the tricky part. I haven't used NUT in about > > seven years, but back then the recommendation was to shut down to > > single user mode and run a script that delayed for some time longer > > than the remaining battery life of the UPS, then rebooted the system. > > There didn't seem to be an easy hook for running a script after > > shutting down to single user mode (maybe there is now). > > > > I haven't looked at NUT recently, but I expect the various flags that > > you are supposed to test are another way around this problem. > Trying to test out the scripts, I ran into a road block. I see that upsmon is working and detecting the events I wanted to detect from these sorts of entries in /var/log/messages: Jan 10 23:28:57 frodo upsmon[80983]: UPS powercom@localhost on line power Plus a similar message for going to battery power. However, the notify executable is having issues and is dumping dozens of lines like this in /var/log/messages: Jan 10 23:28:09 frodo kernel: pid 81029 (upssched), uid 1005: exited on signal 11 Jan 10 23:28:09 frodo kernel: pid 81031 (upssched), uid 1005: exited on signal 11 Jan 10 23:28:10 frodo kernel: pid 81032 (upssched), uid 1005: exited on signal 11 Jan 10 23:28:10 frodo kernel: pid 81033 (upssched), uid 1005: exited on signal 11 Jan 10 23:28:11 frodo kernel: pid 81034 (upssched), uid 1005: exited on signal 11 Jan 10 23:28:11 frodo kernel: pid 81035 (upssched), uid 1005: exited on signal 11 I tried giving the user the user in question (nutmon) a shell of /bin/sh instead of /sbin/nologin but that didn't help. Any clues on how to fix this? Executing upssched from the command line it tells me not to execute directly (similar to what the man page states), and manually executing the upsched-cmd shell script does work and the script itself uses full paths for commands.