Built-in is also possible: just fork once after start, and you have parent as watchdog and restarter.