I need to make a fully GUI app using Qt/C++ (Intended for users with no CLI knowledge).
It is a parental control app (it SHOULD NOT be usable for non-root users).
It needs to change DNS servers on one hand and restore them to automatic on the other hand (based on the options given).
For this, it writes a shell script and launches it as root (via su-to-root , which is bundled in the final AppImage)
Now, it is required to support old systems with SysV init (and I want to support distros like MX/antiX too).
We can change the DNS servers by removing /etc/resolv.conf , editing it and then making it chattr +i
In systemd, we can restore automatic (ISP) DNS by
Code: Select all
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
in SysV, we can restore automatic (ISP) DNS with:
Code: Select all
ln -sf /run/resolvconf/resolv.conf /etc/resolv.conf
Is there a better way to do it on SysV systems ?
I think this may cause breakage on switching between SysV and systemd (like in MX Linux).
Is there a better way to do it on such systems as MX Linux (with both SysV and systemd) ?