Make the restart command `init 6` configurable
Is your feature request related to a problem? Please describe.
As of now, the command to execute the restart is hardcoded as sudo init 6.
https://github.com/thin-edge/thin-edge.io/blob/main/crates/core/tedge_agent/src/agent.rs#L503
In docker container, init 6 doesn't work, exits with code 1. On the other hand, reboot works on docker container.
I think it's useful to make init 6 to customer configurable parameter.
Describe the solution you'd like
Add a configuration to system.toml file.
[init]
....
[system]
restart = "init 6"
Having dependency on https://github.com/thin-edge/thin-edge.io/issues/1031, #1031 should be done first.
Describe alternatives you've considered Option 1: Add it to tedge config
[device]
restart = "init 6"
Option 2: Add it inside c8y_Restart. But this implies it will apply only the operation created by c8y. Restart operation can be created locally.
[exec]
topic = "c8y/s/ds"
on_message = "522"
command = "init 6"