|
From: Elliot L. <el...@vm...> - 2007-11-09 02:21:45
|
On 11/6/07 7:44 PM, "Justin M. Forbes" <jmf...@li...> wrote:
>> From an appliance standpoint, it would be nice to give appliance
> developers the ability to add startup or shutdown scripts without
> modifying the open-vm-tools package themselves. In this vein, we
> shipped the following script
> for /etc/vmware-tools/{poweroff,poweron,suspend,resume}-vm-default:
>
> #!/bin/bash
>
> execscript=$(basename $0)
> scriptdir=/etc/vmware-tools/scripts/$execscript.d
>
> for file in $scriptdir/*
> do
> [ -x $file ] && $file
> done
>
> # To match output from older VMware Tools
> echo `date` ": Executing '$0'"
>
> Realistically, the reboot or shutdown does a shutdown -r or -h so init
> does it's job normally, and I don't think that the scripts will get much
> use. Unfortunately the host complains and an error dialog appears if
> they are not there, so we might as well give them the potential to be
> useful.
Hey Justin,
Thanks for the explanation. I think a .d scheme would be very useful and
very easy to do. Can't promise it for the next release (which I'm hoping
will be ready in a week or so), but I'll try if there's time. The main thing
I'd like feedback from others on is the actual directory path that these
scripts will be dropped into. I'm thinking of either
Scriptsdir="`dirname $0`"/scripts/`basename $0`.d"
(to match your current setup) or just
Scriptsdir=$0.d
The main constraint is that it has to work properly even if the scripts are
in /usr/local/etc or /var/fooblah.
Thoughts?
Best,
-- Elliot
|