How to restart gitlab runner safely?

Sometimes I need to restart gitlab runner v11.0.2. But I don’t know wether it is running a job.
If it is running a job, I restart it, the job will show “ERROR: Job failed (system failure): aborted: terminated” for me.
I have tried use docker ps command to check wether there is running docker container, but when gitlab runner start a job, maybe it does not create a docker container yet.
So, How to restart gitlab runner safely?

1 Like