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

systemd: Don't install services in basic.target, but use multi-user.t… #574

Closed
wants to merge 1 commit into from

Conversation

LocutusOfBorg
Copy link
Contributor

…arget instead.

The specified systemd service file declares an unusual WantedBy= relationship.

Most services that want to be started automatically at boot should use WantedBy=multi-user.target or WantedBy=graphical.target. Services that want to be started in rescue or single-user mode should instead use WantedBy=sysinit.target

Please refer to https://wiki.debian.org/Teams/pkg-systemd/rcSMigration for details.

…arget instead.

The specified systemd service file declares an unusual WantedBy=
relationship.

Most services that want to be started automatically at boot should use
WantedBy=multi-user.target or WantedBy=graphical.target. Services that
want to be started in rescue or single-user mode should instead use
WantedBy=sysinit.target

Please refer to https://wiki.debian.org/Teams/pkg-systemd/rcSMigration for
details.
@minminlittleshrimp
Copy link
Collaborator

minminlittleshrimp commented Nov 24, 2023

dlt should be booted after basic.target phase when everything is setup.
sysinit ->[timers, paths, sockets]->basic

Main dependencies involved

The main issue is that Debian systemd makes all rcS.d ordered Before=sysinit.target, which in turn is ordered Before=basic.target. On the other hand, systemd by default orders all units After=basic.target (this can be removed with DefaultDependencies=no). 

Of course, /tmp must be mounted first for socket creation.
Suggestion of dlt.service:

...
DefaultDependencies=no --> this means After=basic.target
After=tmp.mount
[Service]
...
[Install]
WantedBy=

Moreover:

multi-user.target[¶](https://www.freedesktop.org/software/systemd/man/latest/systemd.special.html#multi-user.target)

    A special target unit for setting up a multi-user system (non-graphical). This is pulled in by graphical.target.

    Units that are needed for a multi-user system shall add Wants= dependencies for their unit to this unit during installation. This is best configured via WantedBy=multi-user.target in the unit's [Install] section.

We do not need any dependency here in dlt.service

Regards

@minminlittleshrimp minminlittleshrimp self-assigned this Nov 24, 2023
@LocutusOfBorg
Copy link
Contributor Author

Can you please followup with your changes then?

@minminlittleshrimp
Copy link
Collaborator

Since I cannot edit your repo, I close this one and continue with mine in which I add you as coauthor.
Regards

@LocutusOfBorg LocutusOfBorg deleted the fix-systemd branch November 27, 2023 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants