You are not logged in.

#1 2022-09-13 22:18:37

10maurycy10
Member
Registered: 2022-09-13
Posts: 1

Start service without blocking

I have several systemd services that take a long time to initialize, such as mariadb, updatedb, and tlp.

Systemd blocks the boot process during the startup, is it possible to get systemd to start them in the background.

Offline

#2 2022-09-14 01:43:57

ectospasm
Member
Registered: 2015-08-28
Posts: 119

Re: Start service without blocking

10maurycy10 wrote:

I have several systemd services that take a long time to initialize, such as mariadb, updatedb, and tlp.

Systemd blocks the boot process during the startup, is it possible to get systemd to start them in the background.

This can usually be done in the systemd service unit files.  By default, systemd launches everything in parallel, unless specific services have Wants= or After= parameters in the [Unit] section, known as systemd dependencies.  You can see this for e.g. mariadb.service like so:

systemctl cat mariadb.service

There is probably a systemd dependency (target or service) of these services which is actually holding up the boot.  You can try to determine what is causing this by running the following command:

systemd-analyze critical-chain

See the systemd-analyze manual (man systemd-analyze) for details.

My guess without any further information or details is that these services are waiting for the network-online.target.  If you can't tell from the output of systemd-analyze, you can post it here and see if we can assist.

Last edited by ectospasm (2022-09-14 01:46:59)

Offline

Board footer

Powered by FluxBB