LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Where to find error messages for tc? (https://www.linuxquestions.org/questions/linux-networking-3/where-to-find-error-messages-for-tc-4175453784/)

systemlordanubis 03-12-2013 10:25 AM

Where to find error messages for tc?
 
Hi All,

I'm having a strange situation where it appears that some 'tc class' replace/add commands being run by a script are not actually taking place; and when the script later wants to remove these classes, it dies because the classes don't exist.

The strangest thing is that if I run the commands manually, there's no error and as far as I can tell, it happens at random.

Is there somewhere I can see errors that may be logged by tc? The script is not reporting any error when it tries to add the class; tc simply replies with an empty response; indicating success.

Any thoughts welcome.

Thanks
Anubis.

suicidaleggroll 03-12-2013 12:12 PM

Have you tried checking the exit status of tc with "$?" ?

No response doesn't necessarily mean it was successful.

systemlordanubis 03-17-2013 10:17 PM

Hi Suicidaleggroll,

Thanks for the reply; upon deeper investigation this seems to be a 'hiccup' in tc.

Looking back through the processing logs, the first attempt which returns the 'RTNETLINK answers: No such file or directory' exits leaving the rest of my script triggers in place; at a later time a few minutes later the attempts to process the removal again and this time it goes through successfully!

So, the issue seems to be some kind of read error when processing the deletion of the tc records.

I am using a locking mechanism on all my scripts to ensure that only one script is modifying tc at any one time, so I don't think it should be an overwriting problem, but I'm not sure what else could be causing this issue?

I did try what you suggested to check $?, but this returns 0 on each tc rule insertion.

Thanks
Anubis.

systemlordanubis 03-17-2013 10:59 PM

Hi Suicidaleggroll,

Thanks very much for your help; upon even further investigation and the fortunate luck of catching an issue as it happens, I've located the problem to a locking issue whereby another process was able to utilize the same class identifier when it shouldn't have.

Many thanks for your assistance.
Anubis.


All times are GMT -5. The time now is 12:45 AM.