0

We have written a service script to start an executable on system start up. The service script restarts every 90 seconds on a consistent basis. If we disable the service and run the executable, it runs as expected. We are using Yocoto Linux on an Intel Edison.

Here is our startup script.

[Unit]
Description=patsuit
After=network-online.target
Wants=network-online.target

[Service]
WorkingDirectory=/home/root
Type=forking
ExecStart=/bin/PatDownSuitFirmware/PatDown_V3
User=root
Restart=on-failure
RestartSec=10s

[Install]
WantedBy=multi-user.target
1

You have a readiness protocol mismatch. You've told systemd that your program forks a child process and then exits the parent process to signal that it is ready. But in fact your program does not do that. Since it hasn't stated that it is ready within 90 seconds (the default start timeout), systemd has decided that your service has failed. Failed services get everything killed off. Becuase of on-failure, your failed service is then restarted, and the cycle repeats.

Use the readiness protocol that correctly describes what your program actually does. That, you have not told us.

Further reading

  • What we would like to do is start the process when the system boots and have it run until the system is shut down. Do any of the methods support that? – joshwl2003 Jan 10 '17 at 5:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.