Hi Alvaro, Thank you for the reply!

I have nothing to check until the restart is completed.

Packer check if the restart is success by checking if winlogon service is 
running(if I m not wrong)

After that I also want to wait until the msiexe process is finished. 
So I assume the below command meant, the restart is considered as completed 
only when no msiexec process is running. AMI I Right? 

"restart_check_command": "powershell -command \"& {Get-Process | 
Where-Object { $_ProcessName -ne 'msiexec' }}\""" 





On Wednesday, December 5, 2018 at 12:41:05 PM UTC-8, Alvaro Miranda 
Aguilera wrote:
>
> the command will only check if the restart happened.
>
> if the command can be run, then will continue.
>
> So you should separate your logic, from the restart and the command.
>
> - first command
> - restart
> - next command
>
>
> and in the next command do wait while that process is running or something.
>
>
> https://www.packer.io/docs/provisioners/windows-restart.html#restart_check_command
>
>
>
> On Wed, Dec 5, 2018 at 2:10 AM Subhashini Radhakrishnan <[email protected] 
> <javascript:>> wrote:
>
>> While provisioning, I install a software which needs to complete a part 
>> of installation on rebooting the machine.
>>
>> So after I run my powershell script to install the software, I issue 
>> windows_restart with a restart check command.
>>
>> "provisioners": [
>>     {
>>       "type": "powershell",
>>       "elevated_user": "myuse",
>>       "elevated_password": "{{ user `admin_pass` }}",
>>       "script": "./scripts/install_software.ps1"
>>    },
>>    {
>>       "type": "windows-restart",
>>       "restart_check_command": "powershell -command \"& {Get-Process | 
>> Where-Object { $_ProcessName -ne 'msiexec' }}\""
>>       "restart_timeout": "30m"
>>     },
>> ]
>>
>>
>> So, I am asking packer to assume the restart is completed only when there 
>> is no misexec process is running. After which I run some clean up scripts. 
>>
>> my post installation step installs some drivers and it takes atleast 20 
>> mins to finish.
>>
>> but the instance gets terminated even before running the cleanupscripts. 
>> Any clue?
>>
>> TIA
>>
>> -- 
>> This mailing list is governed under the HashiCorp Community Guidelines - 
>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>> violation of those guidelines may result in your removal from this mailing 
>> list.
>>  
>> GitHub Issues: https://github.com/mitchellh/packer/issues
>> IRC: #packer-tool on Freenode
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Packer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/packer-tool/43549505-00aa-46a9-b794-19275297aaeb%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/packer-tool/43549505-00aa-46a9-b794-19275297aaeb%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Alvaro
>
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/922c849b-8422-4f51-827a-0a9a41a2bc23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to