Linux
Welcome to c/linux!
Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!
Rules:
-
Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.
-
Be respectful: Treat fellow community members with respect and courtesy.
-
Quality over quantity: Share informative and thought-provoking content.
-
No spam or self-promotion: Avoid excessive self-promotion or spamming.
-
No NSFW adult content
-
Follow general lemmy guidelines.
view the rest of the comments
Disclaimer, I'm not in front of my computer to check, but it looks like its /etc/netplan/
https://netplan.readthedocs.io/en/stable/netplan-tutorial/
Looked url, searched 'custom' and 'script' (page and site) with no match that im looking for. All i know now and looking more around; netplan way to use custom script when interface comes up is networkd-dispatcher way, that in Ubuntu 24.04 do not work.
Ahh I see, I didn't know what tc was and assumed it was a typo and ignored it. I searched for a bit for your specific problem and didn't come up with much other than this:
You could also try
/usr/lib/networkd-dispatcher/routable.d/
Looks like you can also specify the scripts directoy with -S flag
https://manpages.ubuntu.com/manpages/noble/en/man8/networkd-dispatcher.8.html
My other thought is: maybe the location for the scripts is correct, but you're having another issue thats causing the unknown state error?
You might also want to make sure all the required environment variables are set correctly?
Per the man page:
"Scripts are executed with some environment variables set."
'journalctl -u networkd-dispatcher' says:
That error comes either I have my script there or not.
I think scripts in '/etc/networkd-dispatcher/routable.d' or '/usr/lib/networkd-dispatcher/routable.d' are not ran because networkd-dispatched do not get interface state.
Based on https://netplan.io/faq > 'Use pre-up, post-up, etc. hook scripts'; routable.d is correct location in my case.