Rc.local in my template does nothing

I had the same problem with wg-quick only on Fedora. If you send the stdout/err to a file when executing the command from rc.local, it says that it can’t find the config file even if it exists. This is due to the introduction of selinux in all Fedora templates since 4.2, which blocks wg-quick from accessing the file. One way to fix this is to set wireguard_t to permissive:

sudo semanage permissive -a wireguard_t

Then you can do this in /rw/config/rc.local:

ln -s /path/to/config /etc/wireguard/
wg-quick up config_name
2 Likes