Systemctl service restarts if depend service restarts

32 Views Asked by At

I created a systemctl service which initializes an application and prepares dependencies (processing values) for the application's web interface. The web interface is done via nginx. s-prepare.service is started during system start once. It is just a bash script, that is finished after some seconds.

My target is to start my service s-prepare.service before nginx.service is started. If nginx.service is restarted, s-prepare.service should not be re-started.

I implemented s-prepare.service:

[Unit]
Description=my Description

[Service]
ExecStart=/bin/s-init

[Install]
WantedBy=multi-user.target nginx.service

My current problem is, that a restart of nginx.service causes a restart of s-prepare.service.

Do anyone know, how to solve this?

Thanks Tobias

0

There are 0 best solutions below