Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opensnitch.d fails with code=exited, status=2 #88

Closed
xtc0r opened this issue Nov 14, 2020 · 7 comments
Closed

Opensnitch.d fails with code=exited, status=2 #88

xtc0r opened this issue Nov 14, 2020 · 7 comments

Comments

@xtc0r
Copy link

xtc0r commented Nov 14, 2020

Describe the bug
Opensnitch.d fails starting it with systemctl.

To Reproduce

Using AUR package from : https://aur.archlinux.org/packages/opensnitch-git
Version: opensnitch-git 1.2.0.r0.6a8670c-1

Steps to reproduce the behavior:

  1. Install opensnitch-git 1.2.0.r0.6a8670c-1 from https://aur.archlinux.org/packages/opensnitch-git
  2. sudo systemctl start opensnitchd
  3. Check status: sudo systemctl status opensnitchd
  4. See error:

opensnitchd.service - OpenSnitch is a GNU/Linux port of the Little Snitch application firewall.
Loaded: loaded (/usr/lib/systemd/system/opensnitchd.service; enabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2020-11-14 14:02:19 CET; 14s ago
Docs: https://github.com/gustavo-iniguez-goya/opensnitch/wiki
Process: 8159 ExecStartPre=/bin/mkdir -p /etc/opensnitchd/rules (code=exited, status=0/SUCCESS)
Process: 8160 ExecStart=/usr/bin/opensnitchd -rules-path /etc/opensnitchd/rules (code=exited, status=2)
Main PID: 8160 (code=exited, status=2)

Expected behavior
opensnitch.d starts and does not exit

OS (please complete the following information):
OS: 5.4.74-1-MANJARO #1 SMP PREEMPT Sun Nov 1 13:43:13 UTC 2020 x86_64 GNU/Linux

@xtc0r
Copy link
Author

xtc0r commented Nov 14, 2020

Only happens for me after updating to the latest version. Before it worked fine.

@gustavo-iniguez-goya
Copy link
Owner

ouch, can you post the following files?

  • /var/log/opensnitchd.log (only last 15 lines or so will be sufficient)
  • /etc/opensnitchd/default-config.json

Additionaly, launch it from a terminal as root:

/usr/bin/opensnitchd -rules-path /etc/opensnitchd/rules -debug
And see it fails. If it does, post the messages here.

Thank you!

@xtc0r
Copy link
Author

xtc0r commented Nov 14, 2020

Hi,

thanks for the reply. See the logs below. Let me know if you want me to check something else.

/var/log/opensnitchd.log

[2020-11-14 16:21:58] IMP Start writing logs to %!(EXTRA string=/var/log/opensnitchd.log)
[2020-11-14 16:21:58] ERR Error parsing firewall configuration /etc/opensnitchd/system-fw.json: unexpected end of JSON input
[2020-11-14 16:22:28] IMP Start writing logs to %!(EXTRA string=/var/log/opensnitchd.log)
[2020-11-14 16:22:28] ERR Error parsing firewall configuration /etc/opensnitchd/system-fw.json: unexpected end of JSON input
[2020-11-14 16:22:58] IMP Start writing logs to %!(EXTRA string=/var/log/opensnitchd.log)
[2020-11-14 16:22:58] ERR Error parsing firewall configuration /etc/opensnitchd/system-fw.json: unexpected end of JSON input

/etc/opensnitchd/default-config.json

{
"Server":
{
"Address":"unix:///tmp/osui.sock",
"LogFile":"/var/log/opensnitchd.log"
}
"DefaultAction": "allow",
"DefaultDuration": "once",
"InterceptUnknown": false,
"ProcMonitorMethod": "proc",
"LogLevel": 2
}

/usr/bin/opensnitchd -rules-path /etc/opensnitchd/rules -debug

2020-11-14 16:27:04] DBG Worker #6 started.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x55655ddbf358]

goroutine 118 [running]:
github.com/gustavo-iniguez-goya/opensnitch/daemon/firewall.StartCheckingRules(0x0)
github.com/gustavo-iniguez-goya/opensnitch/daemon/firewall/rules.go:219 +0x38
created by github.com/gustavo-iniguez-goya/opensnitch/daemon/firewall.Init
github.com/gustavo-iniguez-goya/opensnitch/daemon/firewall/rules.go:292 +0x89

@gustavo-iniguez-goya
Copy link
Owner

Does the file /etc/opensnitchd/system-fw.json exist? If not, copy this one https://github.com/gustavo-iniguez-goya/opensnitch/blob/main/daemon/system-fw.json to /etc/opensnitchd/system-fw.json and try to launch it again.

If it already exists, please, paste the content.

@xtc0r
Copy link
Author

xtc0r commented Nov 14, 2020

The file did not exist. I creaed it and it starts now.
I only get an error now that the daemon uses 1.3.0rc1 and the UI is only 1.2.0.
But it seems to work now. Thanks!

image

@gustavo-iniguez-goya
Copy link
Owner

great, the message is ok, because I've not updated the GUI yet. The maintainer of the AUR package has packaged latest sources, which I don't expect them to be stable for now.

He or she should distribute with the AUR package the file system-fw.json, so I guess someone should tell her/him about it.

Anyway, we shouldn't fail if the system-fw.json does not exist, or if it's invalid. I'll fix it soon.

@xtc0r
Copy link
Author

xtc0r commented Nov 14, 2020

Thanks for the support.
I left a comment for the package maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants