This solution does work, but it increases the system boot time. And, it seems to me, the system, because of this, shutting down the system began to take a lot of time.
What are the ways to run similar tasks, but somehow more… right? I probably need to run this asynchronously as the system doesn’t need this process right now, it just needs to always run in the background.
Well, systemd starts the services in paralell, but in steps as I know. So there are targets and each target has dependencies. When all dependencies has been started (this goes parallel), it goes to the next target.
systemctl list-dependencies multi-user.target
Well I guess there is no real solution here. More services means always a little longer boot time.
If I understand correctly, this will deprive me of the opportunity to check the operation of the program through systemctl status so this doesn’t look like a good solution.
Hmm… But systemd-analyze blame tells me that my docker services take a long time to start. Not docker itself, but 2 images. And the duration of the system startup felt increased after they were added. It looks like they are not running in parallel, but in series.
I decided to take another look at the analysis and noticed that systemd continues to initialize after the system boots.
It seems to me that I understand something wrong. Are these services bottleneck or is it something else? Maybe I don’t need to do anything with them and they don’t affect the loading speed.
systemd runs everything async - as in creating new threads - so in theory you can create services which interferes with eachother causing unwanted delays
remove this line - only pull the docker image if it has actually been changed.
you may create a service and a timer to do a periodically pull and reload
Start existing containers with docker start. docker run creates a new container and it will error when you try to create over an existing container name.
It became faster because you are not pulling the image anymore, but I meant that there is likely no need to recreate the container on every start.
Create it manually once with run, then you can use it so: