Re: [rundeck] reboot server using rundeck

2,127 views
Skip to first unread message

Anthony Shortland

unread,
Jul 23, 2012, 11:58:51 AM7/23/12
to rundeck...@googlegroups.com
You can ssh in and reboot, but it's the "wait for the server to come back" part that takes some thought, of course ... it can be implemented as a separate step of the same workflow job and should probably run on the Rundeck server itself (or some other administration node)

Do you already have a script that can decide whether the server is back to run? I could imagine pinging the box's interface and trying to reach other services once it came available.

Do you have bare-metal infrastructure? If it's virtual of cloud there may be an interface to your "infrastructure manager" to implement restarting the system.

Anthony.

On Jul 20, 2012, at 8:25 AM, Craig Smith wrote:

> Hi,
>
> I'm intending to use rundeck to manage our Linux patching process. Using the ssh executor/file copiers, I've got a bunch of scripts that do some checking, apply the updates, then some post checking.
>
> Now I'd like to be able to reboot a client before continuing with the patching process.
>
> Is there a way to do this - i.e. execute init 6 and wait for the server to come back before continuing the job?
>
> Thanks
>
> Craig.
>


Craig Smith

unread,
Jul 24, 2012, 3:44:53 AM7/24/12
to rundeck...@googlegroups.com
Thanks Anthony, I think after playing with rundeck a bit more I've realised I can approach this in two ways:

1) have a separate 'Reboot' job that runs on my infrastructure server.  I can add this job as a step in my patching job.

2) or implement a custom node execution script that normally ssh's to the target server to run a command/script but also recognises a 'reboot' command.  In that case, it will reboot the target and wait for it to come back via a combination of ping and netcat to port 22.

I've gone with (2) for the moment and it seems to work well.

Anthony Shortland

unread,
Jul 24, 2012, 10:53:19 AM7/24/12
to rundeck...@googlegroups.com
Cool.

Usually #1 would have been the more natural way to do this, but perhaps you have particular requirements that make #2 the best approach?

If you're inclined to post your custom node execution script, I'm sure the list will appreciate seeing it ...

Anthony.

Daniel Valente

unread,
Jul 14, 2017, 12:55:42 PM7/14/17
to rundeck-discuss
Hi,

I'm trying to use my rundeck server(on Linux) to update and install patches on Windows nodes.
Which is the best way to reboot the node, wait for node to come up, and execute a script on node?
How to wait for reboot completion?

Best regards
Daniel Valente

Alex Honor

unread,
Jul 17, 2017, 6:18:13 PM7/17/17
to rundeck-discuss
Hi Daniel,

You can use a command step to do things like install the patch and reboot the Windows nodes. You'll need a step that can check if the Window server is ready to execute another script. 
You could check if the winrm port is open and ready for connections to determine when the Windows node is ready. See the nixy/waitfor/port-open step here as a possible check: https://github.com/rundeck-plugins/nixy-step-plugins

Thanks
Reply all
Reply to author
Forward
0 new messages