Re: [systemd-devel] Any published books on systemd? A cookbook?

2020-08-29 Thread Tom Browder
On Sat, Aug 29, 2020 at 12:22 PM Reindl Harald  wrote:
> Am 29.08.20 um 19:17 schrieb Tom Browder:
...
> make the script (besides that scripts don't belong to /etc) a

I will change that.

> 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

Thanks very much, Reind.

Best regards,

-Tom
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Any published books on systemd? A cookbook?

2020-08-29 Thread Reindl Harald


Am 29.08.20 um 19:17 schrieb Tom Browder:
> On Fri, Aug 28, 2020 at 11:12 Andrei Borzenkov  > 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

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Any published books on systemd? A cookbook?

2020-08-29 Thread Tom Browder
On Fri, Aug 28, 2020 at 11:12 Andrei Borzenkov  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)

Thanks.

Best regards,

-Tom

>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel