Disable ModemManager service manually on BalenaOs image

Hey,

I run an app on container which communicate with 3G key in order to have cellular connectivity. Nonetheless, ModemManager corrupts my app. I would like to disable it by default. I can’t remove ModemManager symslink on /etc/system.d/system/… because root system is in read-only mode. If it’s possible I would like to avoid to remove it of BalenaOS via YoctoProject.

What kinds of solutions have I ?

Thanks,
Ben

Hi @benat,

You could achieve this by defining custom UDEV rules. I think a solution like this would work for you as well:

Some of the links don’t work due to earlier naming refactor. So the new links are:



As noted in that first link, be careful as you update config.json file since you might break your system by inserting invalid json or invalid content into this file. We suggest trying out such modifications on a device that you can easily access the SD card of and keeping a backup of your config.json.

Cheers…

Thanks for you answer. I noted Udev rules can be a solution but in my case it’s not flexible solution. I don’t work with only one 3G key and in the future modem model can be change. I work around the issue by removing symlinks ModemManager.service in /etc/systemd/system/multi-user.target.wants/ folder and ModemManager don’t start during boot.

Ben

It is not possible indeed to modify those locations. As an alternative can you please check whether ModemManager still corrupts your application with the v2.41.1 release available from our staging environment? It contains a newer ModemManager version. Link to staging is https://dashboard.balena-staging.com/.
Thanks,
Zahari

At the moment, I don’t need to have ModemManager running. I found solution to modify this location and remove symlink.

Ben

That would be a temporary solution, as any OS upgrade will override that change.
Thanks,
Zahari

Sure it’s a temporary solution.

Ben

Another alternative would be to stop the ModemManager service using the systemd D-Bus API from a running container, but this will probably not work for your case as ModemManager will still probe the port. If you however stop the ModemManager service and then re-initialize the USB port with unbind/bind, then that may do it. Please let us know if we can be of further help.
Thanks,
Zahari