| diagrams | created documentation for my current configuration | |
| images | created documentation for my current configuration | |
| system | added ntpd-rs service definition (and its pre script) | |
| user/dinit.d | renamed the service file to a more standard pattern; added a system variable for the User ID; adapted the documentation | |
| .gitignore | updated .gitignore to exclude the backup files created by drawio | |
| LICENSE | Initial commit | |
| README.md | fixed a typo | |
dinit-services repository
This repository contains my own dinit service files, with some explanations.Their content, the naming and parameters are my own arbitrary choices, which might be good or not for anyone else.
Table of Contents
I. dinit logging
By default, in Artix dinit does not produce too much information in the logs, so when I need to diagnose a service I find no traces.
I decided to instal syslog-ng and its corresponding syslog-ng-dinit service definition
The configuration file for syslog-ng is located at /etc/syslog-ng/syslog-ng.conf
II. system level
These are service defined in the system default location (/etc/dinit.d)
Artix pre-installs a number of system services; I defined my own supplementary services based on specific needs.
These are my custom services added to the system location:
- adguardhome (this one needs probably a bit of work)
- ntpd-rs and ntpd-rs-pre (I just started using it, we'll see how it goes)
- technitium-dns (I use it daily - it is my solution to filter ads)
II.1. adguardhome
II.2. ntpd-rs
A new NTP client (and server) that implements the NTP and NTS protocols (see documentation ); it is developped in Rust - hopefully it is performant and robust.
It requires a pre script, in order to create the path where the socket will reside.
II.3. technitium-dns
III. user level
These are services defined in my own local uses session
III.1. dinit start as a local service manager
I use KDE Plasma as desktop environment, so I decided to use the login and logout scripts feature (found in System Settings / System / Autostart).
I started by defining a location for all the scripts and service definition files.
The required location is ~/.config/dinit.d, so I
created it.
Note
dinit will search for the service files definition at exactly this location.
For more details, please consult the wiki of dinit
Here is a diagram that describes the architecture:
There are two essential elements in the ~/.config/dinit.d folder:
- the
bootfile - it is the predefined service that initializes the whole local service collection - the
boot.dfolder - here dinit will store links to the services that are enabled (will be started automatically every time dinit starts)
Next, I created a scripts sub-folder, to regroup all the needed script files in it:
- dinit-start.sh (more details here)
- dinit-shutdown.sh (more details here)
III.1.a. dinit-start.sh
This script launches dinit in user mode to allow me to define services that start when I login and terminate when I logout.
Also it allow me to specify the location where the dinit logs will be stored.
III.1.b. dinit-shutdown.sh
This script terminates local dinit session when I logout.
III.2. my local dinit services
III.2.a. podman
I needed Podman to create the socket when I open my user session; so that it could be found by Pods
For this I have defined a local podman service that needs a pre script - in order to make sure the path for the podman socket exists.
III.2.b. syncthing
I need to start from time to time a synchthing session, so I made a dinit syncthing service definition, for the fun of it.
IV. dinit service usage
The following commands are to be issued in the terminal, while logged as the current user (we are managing local services, so there is no need to escalate rights); in my case, I use Konsole with zsh shell.
<service name> is to be replaced with the name of the service file.
In order to start a service, the command is dinitctl start <service name>.
In order to stop a service, the command is dinitctl stop <service name>
In order to display a list of services, the command is dinitctl list