LibreQoS
LibreQoS copied to clipboard
Running LibreQoS.py from other place like it's dir gives an error - small improvment needed
python3 /root/LibreQoS/v1.1/LibreQoS.py
Traceback (most recent call last):
File "/root/LibreQoS/v1.1/LibreQoS.py", line 243, in <module>
refreshShapers()
File "/root/LibreQoS/v1.1/LibreQoS.py", line 45, in refreshShapers
with open('Shaper.csv') as csv_file:
FileNotFoundError: [Errno 2] No such file or directory: 'Shaper.csv'
root@rty-libreqos:~# ls -la /root/LibreQoS/v1.1/Shaper.csv
-rw-r--r-- 1 root root 564 Aug 31 12:07 /root/LibreQoS/v1.1/Shaper.csv
Script should:
- use config file declared in parameter
--configShaper=Shaper.csv --configNetwork=network.json
, - if not is avaiable in parameter then use file from directory of the script,
- if no is avaiable print an error,
This would be small improvement because if we would like to run it's from crontab we have to use bash wrapper script.
a short term fix by using crontab, "cd therightdir; LibreQos whatever".
Certainly having more options that make sense would be good.
The same fix should be done for lqTools.py
.
done?
also lqos is shorter... - symlink?
This is still a thing.
lq.sh
?
Someday it wont be a shell script. lq has a high probability of colliding with something...
Sorry I mean lq.py
so You need always to write extension
I think we have settled for lqos as the script name. AS for the locking issue?
lqos.py
is a good name.
Fixed with https://github.com/LibreQoE/LibreQoS/commit/9ad1de6ef5afb7a06e059ab0025e367dbeafa7cd
@rchac You closed different issue than mentioned in commit. I reopened it - my tests
ssh sshuser@libreqos -c '/opt/libreqos/src/LibreQoS.py --updateonly'
lqosd is running
refreshShapers starting at 07/02/2023 15:20:13
Rust validated ShapedDevices.csv
Traceback (most recent call last):
File "/opt/libreqos/src/LibreQoS.py", line 1331, in <module>
refreshShapersUpdateOnly()
File "/opt/libreqos/src/LibreQoS.py", line 928, in refreshShapersUpdateOnly
if (validateNetworkAndDevices() == True):
File "/opt/libreqos/src/LibreQoS.py", line 139, in validateNetworkAndDevices
with open('network.json') as file:
FileNotFoundError: [Errno 2] No such file or directory: 'network.json'
Just to better understand, you're wanting this ability so that you can run from crontab instead of systemd?
I would like to have reloading done immediately after uploading file - so I run this magic command through SSH.
Doing it is good like that because I get back errors to my CRM when occurs.
@rchac how can I run --updateonly
with systemd?
In other scenario/method: I can wait less than minute. (and not run a trigger command with --updateonly) - but what about errors (in this scenario i would not see them)?
Is it possible to just SCP the ShapedDevices.csv file to /opt/libreqos then run --updateonly
? Both the python and rust side look for a bunch of files to be available to them in the /opt/libreqos/src folder.
@rchac I get few hours and do an update to current master branch state
# git status
HEAD detached from 6e92a07
nothing to commit, working tree clean
running command:
root@libreqos:~# /opt/libreqos/src/LibreQoS.py --updateonly
generates an error:
Running Python Version 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0]
lqosd is running
lqosd is running
refreshShapers starting at 21/03/2023 16:24:47
Rust validated ShapedDevices.csv
Traceback (most recent call last):
File "/opt/libreqos/src/LibreQoS.py", line 1369, in <module>
refreshShapersUpdateOnly()
File "/opt/libreqos/src/LibreQoS.py", line 952, in refreshShapersUpdateOnly
if (validateNetworkAndDevices() == True):
File "/opt/libreqos/src/LibreQoS.py", line 140, in validateNetworkAndDevices
with open('network.json') as file:
FileNotFoundError: [Errno 2] No such file or directory: 'network.json'
@interduo Your network.json file seems to be missing
@rchac
root@libreqos:~# ls -la /opt/libreqos/src/network.json
-rw-r--r-- 1 root root 3 Jan 20 14:20 /opt/libreqos/src/network.json
This looks complete?
No it isn't or what commit fixed that?