docker-simple-mail-forwarder icon indicating copy to clipboard operation
docker-simple-mail-forwarder copied to clipboard

Update instructions for starting container on reboot

Open Mygod opened this issue 5 years ago • 7 comments

Related: https://stackoverflow.com/a/57532307/2245107

Mygod avatar May 01 '20 04:05 Mygod

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 01 '20 04:05 CLAassistant

Thanks for your contribution! But I believe the --restart=always docker run parameter has already made the container start on reboot?

huan avatar May 01 '20 06:05 huan

According to my test it only starts after logon.

Mygod avatar May 01 '20 06:05 Mygod

I don't think do, because I have many servers and I don't remember there's any cases that the container can not get started after the server reboot.

Could you please double confirm it?

huan avatar May 02 '20 06:05 huan

Actually it only runs after I run docker ps. Selection of syslog:

May  3 09:22:55 server kernel: [    0.000000] Linux version 5.3.0-51-generic (buildd@lgw01-amd64-018) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04))
#44~18.04.2-Ubuntu SMP Thu Apr 23 14:27:18 UTC 2020 (Ubuntu 5.3.0-51.44~18.04.2-generic 5.3.18)
...
(log in)
May  3 09:27:45 server systemd[1]: Starting User Manager for UID 0...
...
(run docker ps)
May  3 09:30:08 server systemd[1]: Reached target Network is Online.
May  3 09:30:08 server systemd[1]: Starting Docker Application Container Engine...

Using crontab fixes this.

Mygod avatar May 03 '20 16:05 Mygod

I'll have a test about it when I got time.

Basically I don't think that there's any need to add anything into the crontab.

huan avatar May 10 '20 08:05 huan

I believe the answer in the StackOverflow link agree with me that there's no crontab need to be added: https://stackoverflow.com/a/30450350/1123955

huan avatar Dec 12 '20 04:12 huan