thin-edge.io
thin-edge.io copied to clipboard
inotify starts to work only after restarting c8y_configuration_plugin
Describe the bug inotify starts to work only after restarting c8y_configuration_plugin
To Reproduce
Precondition:
- c8y-configuration-plugin is installed
- DUT is connected to c8y
- c8y-configuration-plugin service is started
Steps:
- change the configuration file
/etc/tedge/c8y/c8y-configuration-plugin.toml
- Observe that in the on the cloud-side in the configuration management tab the changes will not be shown
Only after restarting c8y_configuration_plugin service inotify will start to work as expected and the changes in the configuration file will be shown after every change of the file even without restart
Expected behavior changes in the configuration file to be reflected on cloud without the need of rastarting the c8y_configuration_plugin service
Screenshots
Environment (please complete the following information):
- OS [incl. version]
- Hardware [incl. revision]
- System-Architecture [e.g. result of "uname -a"]
- thin-edge.io version [e.g. 0.1.0]
Additional context
First step, a developer needs to investigate this issue. Let's spend 1 day for that.
Update: Ignore this post. I had missed a step in the explanation above and the comments below are improvements rather than a bug find.
~OK, so. Here are my observations on the c8y configuration plugin:~
-
[ ] ~The c8y configuration plugin does not run
--init
as root user. See: (https://github.com/thin-edge/thin-edge.io/blob/main/configuration/debian/c8y_configuration_plugin/postinst).~ ~No-where in the service file is root user specified (https://github.com/thin-edge/thin-edge.io/blob/main/configuration/init/systemd/c8y-configuration-plugin.service);~ ~Nor in the Cargo.toml for the pluing: (https://github.com/thin-edge/thin-edge.io/blob/main/plugins/c8y_configuration_plugin/Cargo.toml).~ -
[ ] ~The service is not started on install of the debian package. This is the issue. As reported above, the service is required to be restarted for anything to work. This is because we are missing to start the plugin out of the box. To fix this we should simply add something along the lines of:~
[package.metadata.deb.systemd-units]
unit-scripts = "../../../configuration/init/systemd"
enable = true
start = true
stop-on-upgrade = true
~to the plugin's Cargo.toml (https://github.com/thin-edge/thin-edge.io/blob/main/plugins/c8y_configuration_plugin/Cargo.toml).~
~I will address in a PR the second box, but I am not sure what to do about the first. @rina23q since you are the owner of these files, I want to ask you what you think about the first box? And @didier-wenzek, @albinsuresh I want to ask your general opinion.~
~I declare the investigation phase closed. And I estimated this task will take 0.5 to complete.~
I can not reproduce this. The following steps were followed:
- uninstall thin-edge with the new uninstall script using the
remove
option. - removed
/etc/tedge/c8y
and/etc/tege/operations
(to force the plugin to create them) - install thin-edge with the install script
- connected to c8y
- started plugin
- edited file in
/etc/tedge/c8y/c8y-configuration-plugin.toml
All the messages are fine. I see 114 and 119 messages are sent correctly.
Cannot reproduce it.