mirror of
https://github.com/QubesOS/qubes-doc.git
synced 2025-02-17 21:34:17 -05:00
now using systemd to start openvpn
This commit is contained in:
parent
a9ae590f6f
commit
c6da0b0664
@ -120,36 +120,10 @@ You need an openvpn server and a DNS server accessible through the vpn (use one
|
|||||||
`sudo chmod +x /rw/config/qubes-firewall-user-script`
|
`sudo chmod +x /rw/config/qubes-firewall-user-script`
|
||||||
|
|
||||||
4. Setup the vpn's autostart:
|
4. Setup the vpn's autostart:
|
||||||
Add `openvpn --config /home/user/vpn.cfg &` to `/rw/config/rc.local` and make it executable (`sudo chmod +x /rw/config/rc.local`).
|
Edit to `/rw/config/rc.local`, make it executable (`sudo chmod +x /rw/config/rc.local`) and add:
|
||||||
|
|
||||||
If your ProxyVM takes long to shut down, this may be caused by the vpn connection.
|
ln -s /home/user/vpn.cfg /etc/openvpn/vpn.conf;
|
||||||
You can fix this by killing the connection on shutdown (issue `killall openvpn` on shutdown).
|
systemctl --no-block start openvpn@vpn.service;
|
||||||
This can be done by adding
|
|
||||||
|
|
||||||
echo "[Unit]
|
|
||||||
Description=shutdown
|
|
||||||
Before=shutdown.target reboot.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
RemainAfterExit=yes
|
|
||||||
ExecStart=/bin/true
|
|
||||||
ExecStop=/rw/config/rc.local.shutdown
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=shutdown.target multi-user.target reboot.target
|
|
||||||
" > /usr/lib/systemd/system/user_shutdown_hook.service;
|
|
||||||
|
|
||||||
systemctl start user_shutdown_hook;
|
|
||||||
|
|
||||||
to `/rw/config/rc.local`.
|
|
||||||
This creates and starts a service executing the script `/rw/config/rc.local.shutdown` on shutdown.
|
|
||||||
The service will be deleted after each shutdown, since the `root.img` gets reset at each reboot.
|
|
||||||
|
|
||||||
Now create `/rw/config/rc.local.shutdown`, make it executable `chmod +x /rw/config/rc.local.shutdown` and put the kill command in it:
|
|
||||||
|
|
||||||
#!/bin/bash
|
|
||||||
killall openvpn
|
|
||||||
|
|
||||||
|
|
||||||
5. Configure your AppVMs to use the new VM as a NetVM.
|
5. Configure your AppVMs to use the new VM as a NetVM.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user