gustavo-iniguez-goya / opensnitch

OpenSnitch is a GNU/Linux application firewall
GNU General Public License v3.0
395 stars 20 forks source link

Another init systems #92

Closed LibreHacker closed 3 years ago

LibreHacker commented 3 years ago

You can add support init systems like OpenRC and s6?

https://wiki.gentoo.org/wiki/OpenRC https://www.skarnet.org/software/s6/

gustavo-iniguez-goya commented 3 years ago

Hi!

Yes, I think so. Just out of curiosity, where are you planning to use it? Gentoo, AlpineLinux, ...?

LibreHacker commented 3 years ago

Hi, @gustavo-iniguez-goya !

I'm using Artix Linux, it's having s6 and openrc too.

gustavo-iniguez-goya commented 3 years ago

I was thinking about this, and while I can create an init script for Artix, wouldn't it better to ask Artix devs/packagers to package opensnitch for the distro? I'm not planning in packaging opensnitch for Arch, because it's already packaged https://aur.archlinux.org/packages/opensnitch-git/

What do you think?

deathtrip commented 3 years ago

Arch uses systemd, so there's no need for other init systems there.

LibreHacker commented 3 years ago

@gustavo-iniguez-goya I think Artix packages do not planning to add opensnitch to repos. https://forum.artixlinux.org/index.php/topic,2011.msg13446.html

gustavo-iniguez-goya commented 3 years ago

Ok @LibreHacker , I can write an init script but how are you going to install it? Could you use the AUR package from Arch?

I ask you this because I think we should not duplicate efforts, and reuse what is already working. Would someone (from Arch/Artix) be willing to package it for Artix if I create the init scripts? Maybe AUR opensnitch packager?

Having it packaged for a distro and added to the distro repositories ease the end user experience. Think that in order to update the package you should download it from here (which is the case for deb/rpm packages unfortunately), which is a pain... and not optimal.

LibreHacker commented 3 years ago

I mention this issue in AUR, PKGBUILD having systemd strings, but i think adding new s6 script not broken work with systemd

gustavo-iniguez-goya commented 3 years ago

Sorry @LibreHacker , this is out of scope and it's not going to be supported for now.

I think that you could create a s6 service like this:

opensnitchd-srv/
   run.user
   run

run.user:

#!/usr/bin/execlineb -P
foreground { touch /var/log/opensnitchd.log }
foreground { mkdir -p /etc/opensnitchd/rules/ }
fdmove -c 2 1
exec /usr/bin/opensnitchd -rules-path /etc/opensnitchd/rules/

run:

#!/usr/bin/execlineb -P
fdmove 1 0
s6-fdholder-retrieve ../s6rc-fdholder/s "pipe:s6rc-w-opensnitchd-log"
fdswap 0 1
./run.user

I think that you have also to recreate the init db, etc... but I have no idea really. Try asking on Artix forum and see if they help you. Good luck!

Alex9001 commented 2 weeks ago

Please re-open, there is no clear way to run with openrc