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

Added documentation for Dinit #104

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions portmaster/install/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ __6.__ Start it on boot

In case you are not using `systemd` as your init system - you most likely know if that is the case - these guides contributed by the community will get you started:
- [Runit](#start-portmaster-automatically-with-runit)
- [Dinit](#start-portmaster-automatically-with-dinit)

In order to get the Portmaster Core Service to automatically start when booting, you need to create a systemd service unit at `/etc/systemd/system/portmaster.service`.
The following unit file works but excludes most of the security relevant settings. For a more restricted version [use this portmaster.service file](https://github.com/safing/portmaster-packaging/blob/master/linux/portmaster.service).
Expand Down Expand Up @@ -366,6 +367,29 @@ sudo sv up portmaster

Artix Linux users can find the [portmaster-runit](https://aur.archlinux.org/packages/portmaster-runit/) package in the AUR

#### Start Portmaster Automatically with Dinit
__6.__ Start it on boot (Runit)

In order to get the Portmaster Core Service to automatically start when booting, you need to create a dinit service file at `/etc/dinit.d/portmaster`.
The following service file works, but may need to be apdated to your distribution as they do not all ship the same services.
```sh
type = process
command = /opt/safing/portmaster/portmaster-start --data /opt/safing/portmaster core
depends-on = NetworkManager
pid-file=/opt/safing/portmaster/core-lock.pid
restart = yes
restart-delay = 10
working-dir = /opt/safing/portmaster
```
By default Dinit ships an environment file located at `/etc/dinit/environment`, make sure it exists and that it exports the PATH environment viariable, otherwise Portmaster Core won't be able to find the `iptables` binary
It may look like that this (but can be different):
```
PATH=/usr/bin
```
Finnally enable and start the Portmaster: `sudo dinitctl enable portmaster`

Artix Linux users can find the [portmaster-dinit](https://aur.archlinux.org/packages/portmaster-dinit) package in the AUR

### Frequently Asked Questions

You can find solutions to common problems in the [FAQ]({{ site.faq_url }})