FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We are updating our platform to a new
system.
Read more: Important
information on the platform change.
10-30-2023 09:25 AM
Hi everyone, we are investigating if there is a way to restart a snap programmatically.
According to our use case, user uploads a new configuration for the snap via UI, and it needs to be restarted for changes to take effect.
We had already thought putting the ctrlX core in service mode->disable the app->enable the app ->putting the ctrlx core back in operating. And a complete a reboot of ctrlX core. But is there any direct approach than this?
We would be glad if you can help us or direct us to someone who can. Thanks in advance.
Solved! Go to Solution.
10-30-2023 05:50 PM - edited 10-30-2023 06:18 PM
Hi,
I think the best option here is REST API. There are endpoints available as part of the package-manager API to restart snap services.
I tried to run the bash command below from within a confined snap and permission is denied. Even with the snapd-control interface connected, this will not execute.
snap restart snap-name
Since all of the real-time applications on the CORE are integrated into the Celix framework, I don't believe there would be any way to restart the framework without restarting the entire system. @nickH please correct me if I'm wrong about this.
If you have SSH access on the system, you could of course programatically restart the snap from outside of the snap environment.
11-02-2023 08:05 AM
Because the celix framework is inside the Automation Core snap, you can restart celix if you restart the automation core snap.