Re: shutting down

2009-09-13 Thread Maurice Janssen

Toni Mueller wrote:

Hi,

On Fri, 11.09.2009 at 22:28:43 +0200, Maurice Janssen maur...@z74.net wrote:
Will the master shutdown normally, or will it stall while trying to  
umount the NFS share?  The slaves will shutdown first, so when the  
master goes down, the NFS server won't be responding.


man mount_nfs

You can mount NFS shares soft. This means that it becomes less reliable
for you, but your clients won't hang if you shut down your NFS server
first.

Another option could be to somehow notify your NFS clients, so they
know that they need to unmount the NFS shares.


I tried it, but there's still a time-out of several minutes.  Not ideal 
when the UPS might kill the power any minute.


I solved it by using upssched from nut.  When the battery goes low, I 
umount the NFS share on the master (this is the only machine that has a 
share mounted on the NFS-server).  The slaves will begin to shutdown a 
couple of seconds after the battery goes low, so this should be OK.


I'll do some tests to see if this really works as I think it does.

Maurice



Re: shutting down

2009-09-13 Thread Maurice Janssen

Mauro Rezzonico wrote:

Why don't ask the NSF server to do a 'shutdown +5' and the others to do
a 'shutdown now'? (see shutdown(8)
http://www.openbsd.org/cgi-bin/man.cgi?query=shutdown)


The NFS-server is an embedded device (Netgear NAS).  Unfortunately I 
can't set the +5 on the shutdown command...



Sorry I know nothing about this 'nut' software you are talking about...


nut = networkupstools from ports.  Quite nice set of tools to talk to 
your ups.


Maurice



Re: shutting down

2009-09-13 Thread Jussi Peltola
On Sun, Sep 13, 2009 at 03:35:04PM +0200, Maurice Janssen wrote:
 The NFS-server is an embedded device (Netgear NAS).  Unfortunately I  
 can't set the +5 on the shutdown command...

Then there's probably no way to mount the NFS server's FS's sync? That
could be enough if all processes that need clean shutdown run on the
NFS clients.



Re: shutting down

2009-09-12 Thread Toni Mueller
Hi,

On Fri, 11.09.2009 at 22:28:43 +0200, Maurice Janssen maur...@z74.net wrote:
 Will the master shutdown normally, or will it stall while trying to  
 umount the NFS share?  The slaves will shutdown first, so when the  
 master goes down, the NFS server won't be responding.

man mount_nfs

You can mount NFS shares soft. This means that it becomes less reliable
for you, but your clients won't hang if you shut down your NFS server
first.

Another option could be to somehow notify your NFS clients, so they
know that they need to unmount the NFS shares.


Kind regards,
--Toni++



Re: shutting down

2009-09-12 Thread Mauro Rezzonico
Why don't ask the NSF server to do a 'shutdown +5' and the others to do
a 'shutdown now'? (see shutdown(8)
http://www.openbsd.org/cgi-bin/man.cgi?query=shutdown)

Sorry I know nothing about this 'nut' software you are talking about...



Re: shutting down

2009-09-12 Thread Woodchuck
On Sat, Sep 12, 2009 at 11:12 AM, Toni Muelleropenbsd-m...@oeko.net wrote:
 Hi,

 On Fri, 11.09.2009 at 22:28:43 +0200, Maurice Janssen maur...@z74.net wrote:
 Will the master shutdown normally, or will it stall while trying to
 umount the NFS share?  The slaves will shutdown first, so when the
 master goes down, the NFS server won't be responding.

 man mount_nfs

 You can mount NFS shares soft. This means that it becomes less reliable
 for you, but your clients won't hang if you shut down your NFS server
 first.

 Another option could be to somehow notify your NFS clients, so they
 know that they need to unmount the NFS shares.


To expand on what Toni and Mauro have said, see man shutdown, the -k option:
k as in kick everybody off.  Since at some point each machine will kick
everyone off, that point might as well be now, and we might as well
control the order in which it happens.

Presumably the NFS file systems are not something critical to root,
and can  then be umounted by a script.  If there are files needed, I
suggest preparing a shadow
tree over which the NFS fs's are mounted.   Once users have been kicked
off, the nfs server can be shutdown.  Now in general there will be NFS
fs's mounted on third machines, and those should be shut down in the same
fashion, before the NFS server.  This sequence would be the same regardless
of the reason for shutting down the LAN.

Briefly, then:
   1) UPS software (nut I guess) tells master, power failing soon.
   2) Master tells all slaves except server, shutdown
nice delay Powerfailure
   3) Master tells itself shutdown -k nice delay
   4) Master umounts all.
   5) Master tells nfs server: shutdown now
   6) Master completes its own shutdown.

tells in this scheme might be through nut, or more simply, ssh.  I
don't know
about nut.

And of course, somewhere around step 5, the power comes back on ;-)

Dave



Re: shutting down

2009-09-12 Thread bofh
I believe you can have nut with different thresholds for different boxes

On 9/11/09, Maurice Janssen maur...@z74.net wrote:
 Hi,

 I have a few systems that are powered by the same UPS.  All of them are
 running nut; one system is connected to the UPS over the serial port
 (the 'master'), the others are talking over the network to the master
 (the 'slaves').

 One of the slaves is acting as an NFS server and the master has a
 directory from the NFS-server mounted.

 I'm wondering what will happen if the battery goes low and the NFS
 server will shutdown first.
 Will the master shutdown normally, or will it stall while trying to
 umount the NFS share?  The slaves will shutdown first, so when the
 master goes down, the NFS server won't be responding.

 The master doesn't have to wait for the NFS server, so umount -at nonfs
 would be fine.  Does this happen automatically or is there some way to
 configure this?


 Thanks,
 Maurice



-- 
Sent from my mobile device

http://www.glumbert.com/media/shift
http://www.youtube.com/watch?v=tGvHNNOLnCk
This officer's men seem to follow him merely out of idle curiosity.
-- Sandhurst officer cadet evaluation.
Securing an environment of Windows platforms from abuse - external or
internal - is akin to trying to install sprinklers in a fireworks
factory where smoking on the job is permitted.  -- Gene Spafford
learn french:  http://www.youtube.com/watch?v=j1G-3laJJP0feature=related



Re: Shutting down OpenBSD VM when closing VMWare WS or ESX

2009-04-11 Thread Jim Razmus
* Alexander Farber alexander.far...@gmail.com [090411 16:42]:
 Hello,
 
 I use several OpenBSD/i386 (versions 4.3 and 4.4)
 VMs under VMWare Workstation and ESX.
 They work great for my purposes (few LAMP servers +
 1 OpenVPN server), but there is one annoyance:
 
 when I close the VMWare or shutdown the host,
 then the OpenBSD VMs aren't shutdown properly.
 
 I've tried to install the FreeBSD-version of VMWare-Tools
 as described in http://www.linux.com/feature/56683
 but still the proper shutdown doesn't happen
 even though I see the daemon being run in the VM:
 
 $ ps uawwwx | grep vmware
 root 26568 98.3  0.2   500   216 ??  Rs/0  12:24PM  607:02.63
 /emul/freebsd/sbin/vmware-guestd --background
 /var/run/vmware-guestd.pid --halt-command /sbin/shutdown -p -h now
 
 I wonder how does this daemon work?
 Does it listen at some TCP or UDP port maybe?
 

Take a look at the vmt driver dlg@ recently added to the tree.  Last I
tried it, it wasn't hooked to the build yet and didn't include the
shutdown functionality.  Just calling some attention to it in hopes that
greases the skids for further development.

Jim