1
1
Fork
You've already forked dinit-services
0
my own dinit service files with some explanations
  • Shell 100%
2024年10月29日 07:14:36 +01:00
diagrams created documentation for my current configuration 2024年10月13日 09:54:51 +02:00
images created documentation for my current configuration 2024年10月13日 09:54:51 +02:00
system added ntpd-rs service definition (and its pre script) 2024年10月19日 13:37:40 +02:00
user/dinit.d renamed the service file to a more standard pattern; added a system variable for the User ID; adapted the documentation 2024年10月13日 11:50:59 +02:00
.gitignore updated .gitignore to exclude the backup files created by drawio 2024年10月13日 10:13:21 +02:00
LICENSE Initial commit 2024年10月13日 05:05:36 +00:00
README.md fixed a typo 2024年10月29日 07:14:36 +01:00

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:

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:

architecture

There are two essential elements in the ~/.config/dinit.d folder:

  • the boot file - it is the predefined service that initializes the whole local service collection
  • the boot.d folder - 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:

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