Buildroot has three possible init systems, so there are three ways to do this:
BusyBox init
With this, one adds an entry to /etc/inittab
.
::respawn:/bin/myprocess
Note that BusyBox init
has an idiosyncratic /etc/inittab
format. The second field is meaningless, and the first field is not an ID but a device basename.
Linux "System V" init
Again, one adds an entry to /etc/inittab
.
myprocess:2345:respawn:/bin/myprocess
systemd
One writes a unit file in, say, /etc/systemd/system/myprocess.service
:
[Unit]
Description=My Process
[Service]
ExecStart=/bin/myprocess
Restart=always
[Install]
WantedBy=multi-user.target
Enable this to autostart at bootup with:
systemctl enable myprocess.service
Start it manually with:
systemctl start myprocess.service
Further reading