PDA

View Full Version : [Question(s)] Create service intel edison



javilez
10-12-2016, 08:58 AM
Hi. I wanted to ask how I can create a service in intel edison? I need get processes that are currently running every 5 minutes, and if a sketch is not running start it. Is similar a watchdog.


One idea is to run the 'ps' command and save the result in a txt file. Then read the file and look if the scketch (my main program) is running. If it is not running, it starts. But, I can't khow how can I do it?

Tanks.

Javier.
Hi. I wanted to ask how I can create a service in intel edison engaged in consultation processes that are currently running, and if a sketch is not running start it.

KurtEck
10-12-2016, 12:28 PM
You might have better luck if you ask up on the Edison forum: https://communities.intel.com/community/tech/edison/content

jwatte
10-12-2016, 01:11 PM
If you're running Linux, then there are already parts of Linux that monitor services and re-start them if they crash.
Original Linux used "init" for that (configured in /etc/inittab)
More modern Linux uses upstart, or systemd, or other such systems. I don't know what Edison uses.
Finally, there's a command-line tool called "monit" which does a similar thing, you can try using that.

r3n33
10-19-2016, 01:01 PM
I needed something similar with an Edison project in the past. You can find my solution on github:

https://github.com/r3n33/EddieBalance/tree/master/extras

Can't guarantee Intel has changed things with later releases of the Yocto image but this was the last good information I had on the subject.

Good luck!