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

behavior when using with KDE #15

Closed
deathtrip opened this issue May 2, 2020 · 7 comments
Closed

behavior when using with KDE #15

deathtrip opened this issue May 2, 2020 · 7 comments

Comments

@deathtrip
Copy link

Hi,
I use the latest OpenSnitch revision on my machine daily, and found the following problem:

When using KDE go to System Settings -> System Administration -> OpenSnitch Firewall
Just going there will launch another instance of opensnitch-ui, even if one is already running.
The new instance will report the daemon is not running.

Since the system settings panel only contains a button to relaunch OpenSnitch, i'm not sure it's necessary. I was even surprised it was there.

OS: Arch Linux

@Ph0rk0z
Copy link

Ph0rk0z commented May 3, 2020

hehe, I too installed arch on another pc with KDE. That behavior is weird, I agree. What was worse was logging out and getting the same thing from the UI when I logged back in.

I confirmed with systemd that opensnitch was still running. Not sure if the UI kept running when I logged out. I have it set to start blank session.

@gustavo-iniguez-goya
Copy link
Owner

will launch another instance of opensnitch-ui, even if one is already running.
The new instance will report the daemon is not running. The new instance will report the daemon is not running.

This is a known problem (7ef2c1a)

I have planned to fix it, because it can be interesting to display stats for a particular node in a new window, or perhaps having 2 GUIs running, one connected to the local daemon, and another to a remote one.

However, if there's a GUI listening for events on a local unix socket, I think that there should only be one window.

Not sure if the UI kept running when I logged out. I have it set to start blank session.

I haven't tested that scenario, but I'll take a look at it when I finish the rules editor.

@Ph0rk0z
Copy link

Ph0rk0z commented May 5, 2020

Just checked again, if you kill the old opensnitch-ui after logging back in, you can open a working one.

@gustavo-iniguez-goya
Copy link
Owner

OMG, I've just reproduced it. I'll start working on this.

@gustavo-iniguez-goya
Copy link
Owner

I don't know if this is the best way to do it:

mkdir -p ~/.config/plasma-workspace/shutdown
echo -e "#!/bin/sh\n/usr/bin/pkill -15 opensnitch-ui" > ~/.config/plasma-workspace/shutdown/opensnitch
chmod u+x ~/.config/plasma-workspace/shutdown/opensnitch

https://docs.kde.org/trunk5/en/kde-workspace/kcontrol/autostart/index.html

I'll check what's the behaviour on other window managers.

@gustavo-iniguez-goya
Copy link
Owner

Modify ~/.config/autostart/opensnitch_ui.desktop, and change the line Exec=opensnitch-ui by:

Exec=/bin/sh -c 'pkill -15 opensnitch-ui; opensnitch-ui'

Now on every new session there will be only one instance of the UI. It would be good to know why the UI keeps running after logout, but for now this solves this problem.

On the other hand, if you click on the menu entry while the UI is running, a new instance will be launched. I don't want to block it, because you may want to have 2 UIs running, for example one listening on a local (unix) socket, and another one on a network socket.

If it works, please close the issue.

@Ph0rk0z
Copy link

Ph0rk0z commented May 12, 2020

That works on my system. The trouble is remembering to fix the shortcut.

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

3 participants