On Mon, Nov 7, 2022 at 4:56 PM Lynx de Cat <lynx.lig...@gmail.com> wrote: > > Beyond my skill level but as a temporary fix the following works well > for me - namely just amend the 10-report-down script so that it ends > with: > > ``` > IFUP=$(ifstatus ${CFG} | jsonfilter -e '@.up') > > logger -t "modemmanager" "interface ${CFG} (network device > ${INTERFACE}) ${STATE}" > proto_init_update $INTERFACE 0 > proto_send_update $CFG > > [ "${IFUP}" = "true" ] && ifup ${CFG} > ``` > > That is, work out if the interface was up before it is set down, and > after it was set down, then bring it back up if it was up. >
This could indeed fit more or less your usecase, don't see why not. You could also check whether the user had configured 'auto' for this interface, because if auto is not set, there should be no autoreconnection triggered. Also, you would need to differentiate between a user-triggered disconnection (i.e. a ifdown) and a network-initiated disconnection, because in the former you should not attempt to reconnect. So, I see how this could solve your problem, but it also hides completely the autoreconnection logic that netifd already has, and would require a lot of quirks to make it work as everyone expects it to work. A better solution, IMHO, would be to have netifd monitor the watcher process that I suggested in a previous email. It's a more complex solution though, but it's really the way of autoreconnection that was envisioned when the MM disconnection dispatchers support was introduced. -- Aleksander