Script to restart docker service


Recommended Posts

  • 3 weeks later...
  • 3 months later...
On 6.12.2017 at 5:08 PM, bcjenkins said:

/etc/rc.d/rc.docker ?
usage /etc/rc.d/rc.docker start|stop|restart|status

 


Lets say i want to restart all dockers ondce a week, could i just restart the docker service? Will it close the dockers "correct" - soft?!

edit1:

Okay a simple restart didng seemed to work.

 

I have now:
 

#!/bin/bash
/etc/rc.d/rc.docker stop
echo "stopping docker"
/etc/rc.d/rc.docker start
echo "starting docker"

 

Edit2: Okay it worked once, now its not working anymore, any idea? (if i click run script, its just empty)

 

Edited by nuhll
Link to comment
  • 1 month later...
On 3/15/2018 at 8:38 AM, nuhll said:

Edit2: Okay it worked once, now its not working anymore, any idea? (if i click run script, its just empty)

 

 

Did you get this figured out?  Is what you have working now? 

 

You probably already know that In the scripts sub-directory for the cron you want to run, the script should be in a file simply called script.  First time I tried to setup a script, I created the script in the cron directory (i.e. nightly_reboot) and called it nightly_reboot.cron, which was ignored by user scripts and it created a file in the nightly_reboot folder called script, which was empty and thus ran that instead.

Edited by jeffreywhunter
Link to comment
  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.