evilsocket / opensnitch

OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch.
GNU General Public License v3.0
9.92k stars 490 forks source link

Daemon doesn't appear to start #763

Closed ThePwnd closed 1 year ago

ThePwnd commented 1 year ago

Disclaimer: I am something of a noob to Linux still, so if anything I say sounds off or nonsensical, please bare with me.

I'm on Pop!_OS 22.04 LTS. I initially tried the graphical installer from Eddy, but noticed the installation wiki says Eddy can cause problems. So I ran the install command from the terminal: sudo apt remove opensnitch --purge. It removed 24.8 MB, which is the same amount it says get installed, but it did give me a message that /etc/opensnitchd is not empty so it was not removed. I also ran the same command for opensnitchd and opensnitch-ui, but I got the error that neither package could be located. So, with that out of the way, I went ahead and opened the terminal, pointed it to my Downloads folder, and ran the Debian commands listed in the wiki.

After completing the install, I got a notice that "Download is performed unsandboxed as root as file couldn't be accessed by user ''_apt''. - pkgAcquire::Run (13: Permission denied)" However, upon researching this error, I am told that it should have installed correctly anyway, and that this is some kind of bug with apt. So I ran the next commands in the wiki to enable and start opensnitch. The commands appeared to run successfully, but nothing else happened. So I tried running sudo opensnitch, but I got a "'command not found" error. Then I tried running sudo opensnitchd instead, and that appeared to start something, but it stopped almost immediately after with an error that it couldn't find a rules folder in my Downloads folder, where the .deb package was.

So I deleted opensnitch again, and this time moved the .deb package to /etc/opensnitchd, where there was already a rules folder, installed it, enabled it, started it, and ran it from the terminal. This time, it found the rules folder, but stopped just 2 lines later with an error that said "Error while creating queue #0: Error binding to queue: operation not permitted."

I've used sudo for every command I've run, so I'm not sure why I would be getting a permissions error. I'm pretty confused what I need to be doing differently. I'm hoping it's something obvious I've overlooked in the wiki somewhere. Let me know if you need me to provide any more detailed errors from the terminal output, log files (I may need to know where to find those), or elaborate on anything else that I did. Thanks!

gustavo-iniguez-goya commented 1 year ago

Hi @ThePwnd ,

ok, first of all, let's see what's the state of the installation. Please, post the following information:

In order to run the daemon don't call it opensnitch directly, use systemctl or service:

$ sudo service opensnitch stop
$ sudo service opensnitch start
ThePwnd commented 1 year ago

So running sudo dpkg -l '*opensnitch*' returns: Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-=====================-============-============-===========================> ii opensnitch 1.5.2-1 amd64 GNU/Linux firewall applicat> ii python3-opensnitch-ui 1.5.2-1 all opensnitch application fire> lines 1-7/7 (END)

sudo ls -l /etc/opensnitchd: total 4812 -rw-r--r-- 1 root root 361 Jul 27 11:29 default-config.json -rwx------ 1 aaron aaron 4452384 Oct 23 19:48 opensnitch_1.5.2-1_amd64.deb -rw-r--r-- 1 root root 457544 Jul 27 11:29 opensnitch.o drwxr-xr-x 2 root root 4096 Oct 23 19:48 rules -rw-r--r-- 1 root root 318 Jul 27 11:29 system-fw.json

sudo pgrep -a opensnitch: 28730 /usr/bin/opensnitchd -rules-path /etc/opensnitchd/rules 33071 /usr/bin/python3 /usr/bin/opensnitch-ui

sudo systemctl status opensnitch: ● opensnitch.service - OpenSnitch is a GNU/Linux application firewall. Loaded: loaded (/lib/systemd/system/opensnitch.service; enabled; vendor pr> Active: active (running) since Sun 2022-10-23 20:51:12 EDT; 16h ago Docs: https://github.com/gustavo-iniguez-goya/opensnitch/wiki Main PID: 28730 (opensnitchd) Tasks: 15 (limit: 38273) Memory: 65.9M CPU: 1min 7.451s CGroup: /system.slice/opensnitch.service └─28730 /usr/bin/opensnitchd -rules-path /etc/opensnitchd/rules

Oct 23 20:51:12 pop-os systemd[1]: Starting OpenSnitch is a GNU/Linux applicati> Oct 23 20:51:12 pop-os systemd[1]: Started OpenSnitch is a GNU/Linux applicatio> Oct 23 20:51:12 pop-os opensnitchd[28730]: [2022-10-24 00:51:12] IMP Starting> Oct 23 20:51:12 pop-os opensnitchd[28730]: [2022-10-24 00:51:12] INF Loading > Oct 24 10:47:40 pop-os opensnitchd[28730]: Timed out while sending packet to qu>

I'm most surprised by the last command, that seems to show that it is running..

ThePwnd commented 1 year ago

So, I'm not entirely sure what happened... I installed pip3, and then followed the instructions to force install the appropriate version of grpcio... now when I run opensnitch from the launcher, it appears in my system tray (or whatever the equivalent is on Pop OS), and the UI opens and it's prompting me every time a new app or service tries to connect to the internet now...

Maybe it was already installed properly the whole time, but I just wasn't launching it correctly. What is supposed to happen after I run sudo systemctl start opensnitch? When I ran it before, nothing seemed to happen. I had tried to open it from the launcher before, but I think this was the first time I had opened it from the launcher after running the start command.

gustavo-iniguez-goya commented 1 year ago

grreat, everything seems to be working fine :)

What is supposed to happen after I run sudo systemctl start opensnitch?

If the daemon is not running that command will launch it. If you need to stop or start it use that command.

gustavo-iniguez-goya commented 1 year ago

closing this issue as it seems solved. If you have any other doubt please ask!