Score:0

How to fix ipfm daemon failing to start because of unavailable wifi interface?

tt flag

I have a metered Wifi connection that has lately started reaching the prepaid data limit faster than I expect. To figure out what specifically is using up bandwidth, I installed ipfm 0.11.5-4.2 with apt-get from the universe repository on my Ubuntu 21.04 system. I read through the man pages, configured ipfm.conf and ran the daemon for a few hours, and everything seemed to work as I expected. I got hourly dumps in /var/log/ipfm and was happy.

The next time I restarted my computer, I expected more logs to be produced but to my surprise found out that ipfm didn't seem to be running. The apt package had installed /etc/init.d/ipfm and all the appropriate /etc/rc[0-6].d/*ipfm symlinks, so I went to check syslog and found the following:

Sep 22 17:24:19 mycomputer ipfm[760]: Starting IP Flow Meter:
Sep 22 17:24:19 mycomputer ipfm[764]: [pcap] error opening pcap: wlo1: That device is not up
Sep 22 17:24:19 mycomputer ipfm[764]: [ipfm] Unable to open pcap descriptor on device wlo1
Sep 22 17:24:19 mycomputer systemd[1]: Started ipfm.service.

If I start ipfm manually by typing systemctl start ipfm, it starts logging as it should, so I guess the problem is that at bootup ipfm tries to start before the wifi interface is up, and while the daemon technically stays running, it doesn't log anything because when it started, the interface was not available. What's the proper way of postponing a startup service, or is there anything else I need to do to make the daemon work? I have tried changing the rc.d priorities by naming all the S01ipfm files to S02ipfm (everything else is S01*) but to no avail; I still get the same error message in my syslog. Any advice?

waltinator avatar
it flag
Grab my `net-o-matic` script from `https://github.com/waltinator/net-o-matic`. It monitors network status for "`DOWN`" and does something..
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.