You are not logged in.
Hey,
After setting up my VPN I wanted to install a killswitch, so i downloaded VPNDemon. It kills a process if the VPN is disconnected.
I would love to try it, but what process should i kill to kill the internet. I have no network manager, i set it up manually with a script.
Or maybe anyone has a better alternative.
Last edited by stuff (2017-01-14 19:35:47)
Offline
If you set it up manually with a script then you must know how to disconnect it, no?
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I know how to disconnect it via the terminal, but not via process killiing.
Offline
"Kill the Internet"? - these are bizarre requirements, it sounds like there's a much better solution, but first you'll need to describe the problem in more detail.
Offline
If you know how to disconnect via the terminal, what are you asking? How would you disconnect via the terminal? How do you connect in this script that you wrote that none of us yet know anything about? How do you expect anyone to help you if you wont tell us anything about how/what you are running?
The only direct answer we could give you so far is systemd or pid 1. Kill that, and your network connection will go down. I doubt that's the answer you want, but if you want a better answer, ask a better question.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Well, the easiest way would be to set the internet interface down, but as others have already mentioned, post your setup in detail.
Offline
I know how to disconnect it via the terminal, but not via process killiing.
Ok, your first post was unclear but I think I understand what you want to do now. You want to use the daemon to completely disconnect your computer if the VPN goes down, presumably to prevent leaking connections over the normal non-VPN process. Is that it? If so, tell us how you configure your connection. If you are using dhcpcd, then killing that process should cause you to lose your connection.
If all else fails, you could write a simple custom daemon that does nothing except wait for the kill signal and then disconnect your computer (or run a custom script).
edit
Here's a simple script to use as a starting point (it depends on Python (3)).
#!/usr/bin/env python3
import os
import signal
import subprocess
import sys
SIGNALS = (signal.SIGINT,)
print('PID: {}'.format(os.getpid()))
sig = signal.sigwait(SIGNALS)
cmd = sys.argv[1:]
if cmd:
subprocess.run(cmd)
Save it as something like "run_on_exit" then invoke it with the command that you want to execute.
$ run_on_exit echo "Goodbye cruel world!"
PID: 3431
It will print its PID then wait for a SIGINT signal. You can test the signal from another terminal:
kill -n sigint 3431
Which results in
$ run_on_exit echo "Goodbye cruel world!"
PID: 3431
Goodbye cruel world!
Instead of the echo command, pass it the path to a script that will disconnect the internet.
Last edited by Xyne (2017-01-14 17:59:31)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Thank you xyne. Thats exactly what i meant and what i needed. Im sorry, that i was unclear, but from here on i can do it myself.
Offline