[systemd-devel] Any published books on systemd? A cookbook?
Reindl Harald
h.reindl at thelounge.net
Sat Aug 29 17:22:04 UTC 2020
Am 29.08.20 um 19:17 schrieb Tom Browder:
> On Fri, Aug 28, 2020 at 11:12 Andrei Borzenkov <arvidjaar at gmail.com
> <mailto:arvidjaar at gmail.com>> wrote:
>
> 28.08.2020 17:47, Tom Browder пишет:
> > I want to create a service file that has to consider other services.
>
> ...
>
> If you tell us what you try to achieve, someone may have an idea how
> to express it using systemd.
>
>
> Okay, here is my situation:
>
> I have a single Apache2 httpd instance listening on ports 80 and 433.
> All on port 80 is forced to 433. I am running multiple SNI virtual hosts
> on the same IPv4 address via an Apache2 macro.
>
> The apache server is successfully handled with its systemd service file
> "apache2.service".
>
> Some of the virtual hosts are running behind a reverse proxy and I will
> have a script that will start them all after the "apache2.service" is
> confirmed to be running.
>
> So I need a service file called, say, "reverse-proxies.service" that would:
>
> 1. wait for the "apache2.service" to start successfully
> 2. execute the proxy start script called, say,
> "/etc/proxy-service/start-proxy-servers"
> 3. restart the proxies after apache restarts
> 4. stop the proxies before apache stops (not strictly required)
make the script (besdies that scripts don't belong to /etc) a
oneshot-service and learn about
https://www.freedesktop.org/software/systemd/man/systemd.target.html
the probably easier option would be ExecStartPost/ExecStopPost in a
dropin in /etc/systemd/system/apache2.service.d/whatever.conf
https://coreos.com/os/docs/latest/using-systemd-drop-in-units.html
no need for books, these are basic tasks
More information about the systemd-devel
mailing list