<div dir="ltr">The only solution I can think of is to either: add a wait at the beginning of the install hook, so you have time to get in, or possibly we could  pass the need to run debug hooks into the deploy command.  Perhaps this could be a flag like --delay-hook-executions or just --wait-for-debug, so that the agent knows not to run install until an debug-hooks connection is active. <div>
<br></div><div>--Mark Ramm</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 6, 2013 at 1:49 AM, David Cheney <span dir="ltr"><<a href="mailto:david.cheney@canonical.com" target="_blank">david.cheney@canonical.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In theory you should be able to debug the install hook, but the timing<br>
is quite tricky. You won't be able to execute the debug-hooks command<br>
until the unit has been written into the state, and then you are<br>
racing with the install hook starting. I tried a few times and wasn't<br>
able to catch it at just the right point, even with a machine pre<br>
deployed via add-machine.<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, Sep 6, 2013 at 3:25 AM, Gustavo Niemeyer<br>
<<a href="mailto:gustavo.niemeyer@canonical.com">gustavo.niemeyer@canonical.com</a>> wrote:<br>
> Regarding juju-run, not that I'm aware of, but it's at least a great<br>
> feature that I'm sure is still somewhere in the TODO list.<br>
><br>
> As for the debug-hooks omission of the install hook, that would be a bug.<br>
><br>
><br>
> On Thu, Sep 5, 2013 at 6:04 AM, Matt Rae <<a href="mailto:matt.rae@canonical.com">matt.rae@canonical.com</a>> wrote:<br>
>> Just found this on the juju list, did the juju-run command ever materialize?<br>
>><br>
>> Seems like it would be very valuable to be able to run arbritrary hooks<br>
>> rather than waiting for debug-hooks to intercept.<br>
>><br>
>> I've noticed debug-hooks doesn't seem to work for the install hook??<br>
>><br>
>><br>
>> On Thu, Nov 15, 2012 at 2:34 AM, Peter M. Petrakis<br>
>> <<a href="mailto:peter.petrakis@canonical.com">peter.petrakis@canonical.com</a>> wrote:<br>
>>><br>
>>><br>
>>><br>
>>> On 11/14/2012 11:42 AM, Gustavo Niemeyer wrote:<br>
>>>><br>
>>>> On Wed, Nov 14, 2012 at 2:36 PM, Peter M. Petrakis<br>
>>>> <<a href="mailto:peter.petrakis@canonical.com">peter.petrakis@canonical.com</a>> wrote:<br>
>>>>><br>
>>>>> It would be neat if we could run debug-hooks directly on the host<br>
>>>>> or just setup the entire environment on demand. This would also<br>
>>>>> help with ancillary scripts that support complex charms. Currently<br>
>>>>> I have to save away any envvars necessary at install time and<br>
>>>>> echo | sed them into local scripts to maintain context.<br>
>>>><br>
>>>><br>
>>>> We're actually on the way to have something very handy, but I'm not<br>
>>>> sure if it's exactly what you're looking for. We'll soon have a<br>
>>>> juju-run command that can be execute any script out-of-band, and have<br>
>>>> the full hook context so that the host can do whatever is needed even<br>
>>>> when no hooks are up.<br>
>>>><br>
>>>> Would that help your use case?<br>
>>><br>
>>><br>
>>> Hmm, maybe. The use case is creating supporting scripts and include files<br>
>>> that are used by other programs on the file system. Like an upstart job<br>
>>> that calls functions included from a common include location. Currently<br>
>>> I save away the charm home at install time and template this in.<br>
>>> Alternatively<br>
>>> I would have to create a space somewhere and copy said files to new<br>
>>> location,<br>
>>> and ensure they're overwritten during install/upgrade. Keeping them in the<br>
>>> charm root ensures that they're unconditionally over written like the hook<br>
>>> scripts themselves.<br>
>>><br>
>>> See:<br>
>>><br>
>>> <a href="http://bazaar.launchpad.net/~peter-petrakis/charms/precise/opengrok/trunk/files/head:/" target="_blank">http://bazaar.launchpad.net/~peter-petrakis/charms/precise/opengrok/trunk/files/head:/</a><br>

>>><br>
>>> inc/common is leveraged by two additional scripts in scripts/ that are<br>
>>> called from<br>
>>> an upstart job I install.<br>
>>><br>
>>> juju-run is neat, but it's still client side. I would also like the<br>
>>> freedom to<br>
>>> just fool around with the get/set agents outside of the debug-hooks<br>
>>> context<br>
>>> on the target e.g. to get a better feel for hacking new config.yaml keys.<br>
>>> Currently,<br>
>>> my only alternative is to intentionally create a broken hook and run<br>
>>> debug-hooks<br>
>>> from the discomfort of a screen'ish session.<br>
>>><br>
>>><br>
>>>><br>
>>>><br>
>>>> gustavo @ <a href="http://niemeyer.net" target="_blank">http://niemeyer.net</a><br>
>>>><br>
>>><br>
>>> --<br>
>>> Juju mailing list<br>
>>> <a href="mailto:Juju@lists.ubuntu.com">Juju@lists.ubuntu.com</a><br>
>>> Modify settings or unsubscribe at:<br>
>>> <a href="https://lists.ubuntu.com/mailman/listinfo/juju" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju</a><br>
>><br>
>><br>
><br>
><br>
><br>
> --<br>
> gustavo @ <a href="http://niemeyer.net" target="_blank">http://niemeyer.net</a><br>
><br>
> --<br>
> Juju mailing list<br>
> <a href="mailto:Juju@lists.ubuntu.com">Juju@lists.ubuntu.com</a><br>
> Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju</a><br>
<br>
--<br>
Juju mailing list<br>
<a href="mailto:Juju@lists.ubuntu.com">Juju@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju</a><br>
</div></div></blockquote></div><br></div>