On 06/24/2010 07:22 PM, James wrote:
> On looking at the documentation for older vmware-guestd it shows
> the option of specifying different commands for halt and reboot.
>
>> /etc/vmware/vmware-guestd --halt-command<command>
>> where<command>  is the command to execute when ESX Server asks the guest 
>> service to halt the guest operating system.
>> /etc/vmware/vmware-guestd --reboot-command<command>
>> where<command>  is the command to execute when ESX Server asks the guest 
>> service to reboot the guest operating system.
>
> This is done in the /etc/vmware/dualconf.vm startup script.
>
> I can't find anything about dualconf.vm in open-vm-tools and the two options
> above are not even available for vmtoolsd.
>
> I figured out that I can specify custom poweron-script, resume-script,
> suspend-script, and poweroff-script in the [powerops] group of tools.conf
> but the only arguments to these scripts is the powerop type.  Looking
> at the source code I found some reference to halt and reboot but they
> both end up pointing to the same poweroff script.
>
> Of course I also see that I can just add custom user scripts to
> the /etc/vmware-tools/scripts/poweroff-vm-default.d/ directory
> and that is just what I'm doing now.  The problem of course is that
> if my script does the power off at the end the reboot doesn't happen,
> and if my script just completes a shutdown and then halts the
> power is not "turned off".

James,

As the code is written, you're out of luck.  For better or worse, reboot and 
power off have been handled identically since ... forever.

If you want to hack it yourself, you can probably get away with the following:

"Correct" way:
- Add appropriate CONFNAME_REBOOTSCRIPT and CONFVAL_REBOOTSCRIPT_DEFAULT macros 
to conf.h.
- Change CONFNAME_POWEROFFSCRIPT to CONFNAME_REBOOTSCRIPT in powerOps.c for the 
reboot case.
- Define your own handler for "reboot-vm".

Quick'n'dirty way:
- Hack System_Shutdown in systemLinux.c.

Hope this helps.

-- 
Ryan Beasley :: MTS, Guest Components - Applications :: VMware, Inc.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
open-vm-tools-devel mailing list
open-vm-tools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-vm-tools-devel

Reply via email to