ffnord / mesh-announce

Discussion at #mesh-announce:irc.hackint.org and (separately) at
https://matrix.to/#/!MjLIHcALOcENXZWQlH:irc.hackint.org/$1547640760901FmKaD:matrix.eclabs.de
13 stars 45 forks source link

fastd is always on #67

Closed AiyionPrime closed 3 years ago

AiyionPrime commented 3 years ago

This one is related to #66 and hasn't bothered me much since now, but is there a way we could determine the state of fastd a little more dynamic? I'd even vote for some ps greppery if we could get rid of https://github.com/ffnord/mesh-announce/blob/2736f7b835d68aea2315264c4b8418469e9b2832/providers/nodeinfo/software/fastd/enabled.py#L5

Has somebody ideas how to implement this better?

AiyionPrime commented 3 years ago

One option would be to specify a list of fastd status sockets to check. This could be a stat, or even an open call like in software.fastd.version.

Another way to go would be subprocess with a px grep.

The first has the drawback of intrducing yet another configparameter, as status sockets are not placed at a fixed directory iirc?

in hanover we put them under /var/run/fastd*.socket.

AiyionPrime commented 3 years ago

found a cleaner approach similar to the second, using psutil.

AiyionPrime commented 3 years ago

... Which has the drawback of adding a dependency.