Is your feature improvement request related to a problem? Please describe.
Executing tedge connect c8y or tedge reconnect c8y rebuilds the bridge configuration and automatically restarts the tedge-agent regardless if it is running. The restarting of the tedge-agent is problematic and no longer required since the decoupling of the tedge-agent to any mapper specific logic.
Being able to update the c8y bridge configuration is useful when performing firmware updates, however if the tedge-agent is restarted, this causes teh firmware update workflow to be interrupted as the tedge-agent is responsible for running the firmware update workflow (e.g. the workflow step would essentially kill the process which is running it.)
Describe the solution you'd like
Don't restart tedge-agent if the service is already running when running the following commands:
tedge reconnect c8y
tedge connect c8y
Generally service managers already support starting a service in an idempotent way, so it should be a simple case of just using starting the service rather than restarting (you probably don't even need to check if the service is already running yourself)
Is your feature improvement request related to a problem? Please describe.
Executing
tedge connect c8y
ortedge reconnect c8y
rebuilds the bridge configuration and automatically restarts the tedge-agent regardless if it is running. The restarting of the tedge-agent is problematic and no longer required since the decoupling of the tedge-agent to any mapper specific logic.Being able to update the c8y bridge configuration is useful when performing firmware updates, however if the tedge-agent is restarted, this causes teh firmware update workflow to be interrupted as the tedge-agent is responsible for running the firmware update workflow (e.g. the workflow step would essentially kill the process which is running it.)
Describe the solution you'd like
Don't restart
tedge-agent
if the service is already running when running the following commands:tedge reconnect c8y
tedge connect c8y
Generally service managers already support starting a service in an idempotent way, so it should be a simple case of just using starting the service rather than restarting (you probably don't even need to check if the service is already running yourself)
Describe alternatives you've considered
Additional context