Skip to main content
Topic: Opensnitch FIREWALL on OpenRC init (Read 1930 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

Opensnitch FIREWALL on OpenRC init

Opensnitch is a firewall on linux, from my experience similar to Simplewall on Windows, user friendly, shows every connection made to which domain/ip, rules, apps, ports, even as which user
By default it adds a systemd script to run at boot so it won't work on OpenRC, but with this simple script it can be made to run at boot
if anyone has a better script or has recommendations on how to better write scripts, please do reply as i am still new to this

First you have to download the opensnitch/opensnitch-git AUR package and then add/modify this script to /etc/init.d/opensnitchd

Code: [Select]
#!/usr/bin/openrc-run

command=/usr/bin/opensnitchd
command_args="-rules-path /etc/opensnitchd/rules"
pidfile="/run/${RC_SVCNAME}.pid"
start_stop_daemon_args="--background --make-pidfile"

name="OpenSnitch daemon"
description="OpenSnitch is a GNU/Linux port of the Little Snitch application firewall>

depend() {
        need net
}

EDITED by a moderator to include code tags.

Re: Opensnitch FIREWALL on OpenRC init

Reply #1
I know it is an old thread but Had anyone success running opensnitch on Artix? I only managed to install GUI. I tried to include this script but only get an error that opensnitchd is not executable.

Re: Opensnitch FIREWALL on OpenRC init

Reply #2
I know it is an old thread but Had anyone success running opensnitch on Artix? I only managed to install GUI. I tried to include this script but only get an error that opensnitchd is not executable.
What do you mean not executable?

What exactly is the error when you try to run opensnitchd from terminal?

 

Re: Opensnitch FIREWALL on OpenRC init

Reply #3
As I said GUI works but no service and OS doesn't show any connections.
Code: [Select]
/etc/init.d$ cat opensnitchd 

#!/usr/bin/openrc-run

command=/usr/bin/opensnitchd
command_args="-rules-path /etc/opensnitchd/rules"
pidfile="/run/${RC_SVCNAME}.pid"
start_stop_daemon_args="--background --make-pidfile"

name="OpenSnitch daemon"
description="OpenSnitch is a GNU/Linux port of the Little Snitch application firewall>

depend() {
        need net
}

/etc/init.d$ rc-update add opensnitchd default

 * rc-update: service `opensnitchd' is not executable
 

Re: Opensnitch FIREWALL on OpenRC init

Reply #4
As I said GUI works but no service and OS doesn't show any connections.
Code: [Select]
/etc/init.d$ cat opensnitchd 

#!/usr/bin/openrc-run

command=/usr/bin/opensnitchd
command_args="-rules-path /etc/opensnitchd/rules"
pidfile="/run/${RC_SVCNAME}.pid"
start_stop_daemon_args="--background --make-pidfile"

name="OpenSnitch daemon"
description="OpenSnitch is a GNU/Linux port of the Little Snitch application firewall>

depend() {
        need net
}

/etc/init.d$ rc-update add opensnitchd default

 * rc-update: service `opensnitchd' is not executable
 
Did you make the service file executable?

Re: Opensnitch FIREWALL on OpenRC init

Reply #5
Yeah thanks, now there is no error and I can add opesnitchd with rc-update but still it doesn't work besides GUI. I tried to reboot and Opensnitch still  doesn't show any connections.

Re: Opensnitch FIREWALL on OpenRC init

Reply #6
Yeah thanks, now there is no error and I can add opesnitchd with rc-update but still it doesn't work besides GUI. I tried to reboot and Opensnitch still  doesn't show any connections.

Did you manage to get it working?
If the service is working, the opensnitch gui should say running and show the connections
If not, try using this script with minor changes from the previous one
Code: [Select]
#!/usr/bin/openrc-run

command=/usr/bin/opensnitchd
command_args="-rules-path /etc/opensnitchd/rules"
#pidfile="/run/${RC_SVCNAME}.pid"
supervisor="supervise-daemon"
required_files="/etc/opensnitchd/rules"

name="OpenSnitch daemon"
description="OpenSnitch is a GNU/Linux port of the Little Snitch application firewall."

depend() {
        need net
}

Re: Opensnitch FIREWALL on OpenRC init

Reply #7
Thanks a lot!  :D  Now it works and shows connections. How did you know what to change in the script?

Re: Opensnitch FIREWALL on OpenRC init

Reply #8
Thanks a lot!  :D  Now it works and shows connections. How did you know what to change in the script?
I just removed start-stop-daemon-args since it seemed unnecessary
I ran into the same issue when i was trying to get it to work, so i checked out examples of other scripts and edited mine so it would work