Gentoo Archives: gentoo-user

From: Mark Knecht <markknecht@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Gracefully shut down program by request through ssh?
Date: Wed, 03 Feb 2010 03:51:12
Message-Id: 5bdc1c8b1002021950i2a4228dcodb17075273695911@mail.gmail.com
In Reply to: Re: [gentoo-user] Gracefully shut down program by request through ssh? by Xi Shen
1 On Tue, Feb 2, 2010 at 6:52 PM, Xi Shen <davidshen84@××××××××××.com> wrote:
2 > On Wed, Feb 3, 2010 at 9:10 AM, Iain Buchanan <iaindb@××××××××××××.au> wrote:
3 >> On Tue, 2010-02-02 at 16:12 -0800, Mark Knecht wrote:
4 >>> Hi,
5 >>>    I was running VMWare and the program inside of Windows has crashed.
6 >>> (Or maybe Windows crashed or maybe VMWare crashed - I cannot tell.)
7 >>>
8 >>>    Gentoo is still alive and I can log in and look around but the
9 >>> mouse on that computer but its mouse is frozen so I cannot do anything
10 >>> at its screen. It seems the keyboard is dead also.
11 >>
12 >> So can you do things once logged in?  Which screen are you talking
13 >> about?  Sounds like you're host is locked up, not just the guest?
14 >>
15 >>>    top says there's nothing going on. No CPU cycles at all.
16 >>>
17 >>>    Is there a way for me to ask Linux to talk to VMWare and see if it
18 >>> can shut itself down before I hit the reset button?
19 >>
20 >> as in "tell VMWare to do a windows shutdown"?  Not that I'm aware of.
21 >>
22 >> killall -15 vmware
23 >>
24 >> will send the SIGTERM to all vmware named processes.  (You may need to
25 >> use vmware-workstation, or just use ps to get the PID).  If that doesn't
26 >> work, follow up with a
27 >> killall -9 vmware
28 >>
29 >> Then if you're still stuck, gnome-session-save with either --logout or
30 >> --force-logout should log you out nicely.  If that gets stuck, try
31 >>
32 >> kill -15 -1
33 >> from your user login (not root) to kill all your processess.  Again,
34 >> maybe a
35 >> kill -9 -1
36 >> is required.  It will log you out of the ssh session.
37 >>
38 >> If that fails (as you can tell I've done this before) try an acpi
39 >> shutdown.  If that fails, use the magic SysRq, but I don't think you'll
40 >> need to go that far since you can ssh in.
41 >> --
42 >> Iain Buchanan <iaindb at netspace dot net dot au>
43 >>
44 >> Simon: "My God - you're like a trained ape.  Without the training."
45 >>                                --Episode #7, "Jaynestown"
46 >>
47 >>
48 >>
49 >
50 > i think Mark want to know if it is possible to send commands from host
51 > to guest. try "vmrun". i used it use send "showdown" command to my
52 > windows guest once, and it worked. but it is not very nice to use. you
53 > need to give the full path of the command you are going to execute.
54 >
55 >
56 > --
57 > Best Regards,
58 > David Shen
59 >
60
61 Yes, that was exactly the sort of thing I was looking for. It seems to
62 me that if the machine is alive and vmware is alive (as I beleive they
63 were) then it would be cool to tell vmplayer to reboot or shutdown
64 Windows gracefully so as to cause as little problems with the disk
65 image as possible.
66
67 I got anxious about 30-40 minutes after sending the original post to
68 the list and just issued a kill with no numeric value in top. vmware
69 closed immediately. When I restarted vmplayer Windows acted like it
70 does when you had to pull the plug on a physical box - complaining
71 that it wasn't shut down properly, etc., and went through it's checks.
72 The image came up fine and off it went to do some work.
73
74 Very nice thinking that since WinXP is just a disk file that I have
75 backed up on my network I can reload this machine in a couple of
76 minutes or even move it to another machine to run and not lose too
77 much time.
78
79 I didn't have as much luck with VirtualBox that didn't seem to like me
80 moving copies from one partition to another. I must go back and give
81 that another try as I'd like to be using Open Source but for now
82 VMWare is very nice.
83
84 Thanks for your responses.
85
86 Cheers,
87 Mark

Replies

Subject Author
Re: [gentoo-user] Gracefully shut down program by request through ssh? Keith Dart <keith@×××××××××.biz>
Re: [gentoo-user] Gracefully shut down program by request through ssh? Neil Bothwick <neil@××××××××××.uk>