Sample Header Ad - 728x90

Remove connman without disrupting ethernet connection

1 vote
0 answers
2143 views
For a bunch of historical and justifiable reasons, I have a situation where I need to programmatically configure a device with a fresh Debian installation, over a ssh connection. Think of it like a production line where the device arrives fresh and needs to be configured over the network via a script. One of the things I need to do as part of that configuration is remove connman. If I do the most obvious thing and call apt purge connman from my script, it gets 20% the way through and the ssh connection is dropped. When I power cycle the computer and log back in, all is well, connman is gone and the network is configured the way I want. The user experience though, is a little less than desirable. Here are some workarounds I thought of and why they haven't been satisfactory: 1. echo a warning from the configuration script that the purge process will halt, and that the user needs to wait a period of time and then power cycle the device. * Not only is that a poor user experience, it means this has to be the last thing the script does, and I can't check for error or report success. 1. Require the user to plug in a keyboard and monitor instead of using ssh. * Pretty neat fix, but might not always be practical. 1. Do something like apt purge connman && reboot. * Difficult to provide user feedback; ssh needs to be re-established (in a different way because part of the configuration changes the network and ssh settings); takes an unpredictable while. 1. Schedule the purge for sometime in the future. * Neither at or crontab have a @before_reboot equivalent and a @reboot or other arbitrary time might be too late, can't report success, and requires cleaning up after itself so it only fires once successfully. 1. Configure connman to do nothing, rather than deleting it. * Leaves a lingering doubt that it is indeed inert. So is there a way to remove connman without killing the active ethernet connection? Can I prop up the connection until the next reboot, or just schedule the purge to be done during the next shutdown?
Asked by Heath Raftery (1652 rep)
Feb 6, 2020, 01:53 AM
Last activity: Feb 23, 2022, 11:48 PM