Is it safe to restart jenkins from within a job using this groovy code?
I have been asked to schedule a restart of jenkins once a
week. I do not want to restart if a job a running, and unfortunately,
I do not have access to the jenkins CLI to issue a restart command.
So, I came up with the following groovy script that gets invoked from
a jenkins job:
Execute system Groovy script:
It seems to work correctly on my test system with Jenkins 1.399. A
worker is stating that is works most of time on while testing on an
older version of hudson. (I believe it it Hudson 1.395) Here is the
issue he is
Sometimes it (hudson) is not able to attach the correct PID and not
able to access Hudson after the restart
So, I am curious if my Groovy Script implementation should reliable
work? Or, is this untested waters.