Hello, I have a droplet with CoreOS and system reboots once a two/three days accidentally. After every reboot I need to restart my docker containers. To get it I create systemd unit ***.service with the next structure:
[Unit] Description=*** service After=docker.service [Service] ExecStart="/usr/bin/docker run -d -p 80:80 *** /usr/sbin/apache2ctl -D FOREGROUND" [Install] WantedBy=multi-user.target
When I try to start it as:
sudo systemctl start ***.service
It crashes with error:
Oct 08 07:18:47 *** systemd: [/etc/systemd/system/***.service:6] Executable path is not absolute, ignoring: "/usr/bin/docker run -d -p 80:80 *** /...-D FOREGROUND" Oct 08 07:18:47 *** systemd: ***.service lacks ExecStart setting. Refusing.
How can I restrict CoreOS accidental reboots? And how can I fix my error with systemctl?
Thanks in advance!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!