* Fix the Python code to actually call `is_lqosd_alive()` instead of just
checking that it exists (`is_lqosd_alive`).
* Fix the os.exit command syntax.
* Cleanup the blocking Tokio/lqosd request handler to pass better messages.
* Catch the "file not found" and replace it with a nicer message.
I exclude .json from my rg searches, and when going through code
via things like "rg" - having the json show up is kind of painful.
use .txt for text, .json for .json, .whatever.gz for compressed.
The default total summar was the opposite of the table below,
and confusing.
Ideally the layout of the topmost bar should be:
LibreQos 'NOT CONNECTED' 'OTHER STATUS' 'down bps' 'up bps' 'pps' 'pps'
But my table-fu failed me.
By using the handy fmt macros this is feasible if the cell width
is known, via "{:>11}" for example.
However my intuitive thought that this was a "Constraint",
that you could apply to a Cell or Span, and it isn't. There are
multiple calls on the github for this. Until such a day, fmt
goes to 11.
Modern linuxes add fields all the time. On a kernel upgrade we
shouldn't crash just because there's a new json field.
Also there are some further optimizations to represent the kernel
structures themselves. Some fields can overflow which would lead
to some surprizing behaviors in polling the json over time.
FIXME - always check for overflow elsewhere, in packets, overlimits
etc. Could that be a trait?
On systems that support it, `jemallocator` will replace the default
allocator for `lqosd` and `lqos_node_manager`. The Jem allocator
is a LOT more friendly to Rust's preferred vector allocation patterns,
and actually cares about your cache.
Enable "fat" Link-Time Optimization. This slows down compilation a lot,
but results in smaller binaries and permits the LLVM optimizer to
cross crate boundaries when inlining, optimizing tail calls and a
few other optimizations.
FIXME: We need, in general, to check for wrapping in long term runs
* FIXME: Need a test to ensure fq_codel is still parsing
* Still want a size before and after test.
Lastly...
Newer versions of the kernel now have newer options for fq_codel
such as ce_threshold. The present implementation will spam the log
on encountering a newer kernel and tc.
Added a note for where `n_rows` gains the current terminal size.
`tui` turns out to consume the `Event::Resize` event, so it's
never received - instead, we have to calculate it from the
creation of the UI "chunks".
The rendering length turned out to be an artefact of forgetting
to remove a height constraint from a UI chunk that was tested
and never used. (It briefly contained some graph data).
* At any time, you can ask a BusClient if it is connected.
* If `lqtop` loses connectivity while running, it displays NOT
CONNECTED in red on the title bar.
* If `lqtop` can't reach the daemon on start, it bails out with
an error message.
The file locking is "smart": it checks to see if a lock is
valid before refusing to run (and updates the lock if
it can run anyway).
The locking mechanism will fail if you manually create
the lock file and dump random data into it that doesn't
readily convert to an i32.
Affects issue #54 and issue #52
* Add a new structure `FileLock` to `lqosd`.
* FileLock first checks /run/lqos/lqosd.lock. If it exists,
it opens it and attempts to read a PID from it. If that PID
is running and the associated name includes "lqosd", the
FileLock returns an error.
* If no lock exists, then a file is created in
/run/lqos/lqosd.lock containing the running PID.
* Includes Drop and signal termination support.
Since guarantying the execution of Drop traits on process
termination from signals is now "unsound" in the Rust specs,
provide an explicit clean-up path for `lqosd`, called when
a termination signal is processed. This removes the Unix
stream socket on termination.