Re: [systemd-devel] How to chain services driven by a timer?

2024-04-11 Thread Brian Reichert
On Thu, Apr 11, 2024 at 04:58:05PM +0300, Andrei Borzenkov wrote: > There are no ordering dependencies between your services, so they are > started as soon as possible. if post-rotate.service must be started > after logrotate.service, it needs > > After=logrotate.service > > This is also needed

Re: [systemd-devel] How to chain services driven by a timer?

2024-04-11 Thread Andrei Borzenkov
On Thu, Apr 11, 2024 at 4:17 PM Brian Reichert wrote: > > On Thu, Apr 11, 2024 at 11:16:36AM +0300, Andrei Borzenkov wrote: > > Show full unit definition for both logrotate.service and your service. > > Sure: > > 10-153-68-34:~ # cat /usr/lib/systemd/system/logrotate.service > [Unit] >

Re: [systemd-devel] How to chain services driven by a timer?

2024-04-11 Thread Brian Reichert
On Thu, Apr 11, 2024 at 11:16:36AM +0300, Andrei Borzenkov wrote: > Show full unit definition for both logrotate.service and your service. Sure: 10-153-68-34:~ # cat /usr/lib/systemd/system/logrotate.service [Unit] Description=Rotate log files Documentation=man:logrotate(8) man:logrotate.conf(5)

Re: [systemd-devel] How to chain services driven by a timer?

2024-04-11 Thread Dave Howorth
On Wed, 10 Apr 2024 17:07:36 -0400 Brian Reichert wrote: > Hopefully someone here can assure me this is just due to an artifact > of bookkeeping. I'm specifically trying to avoid doing any work > while logrotate is running. I know it's a bodge, but put a short delay at the start of your

Re: [systemd-devel] How to chain services driven by a timer?

2024-04-11 Thread Andrei Borzenkov
On Thu, Apr 11, 2024 at 12:07 AM Brian Reichert wrote: > > On Wed, Apr 10, 2024 at 01:47:47PM -0600, Dan Nicholson wrote: > > Restarting the timer doesn't make the service run immediately. Are you > > sure logrotate.service has run again since you made this change? Just > > simulate the timer and

Re: [systemd-devel] How to chain services driven by a timer?

2024-04-10 Thread Brian Reichert
On Wed, Apr 10, 2024 at 01:47:47PM -0600, Dan Nicholson wrote: > Restarting the timer doesn't make the service run immediately. Are you > sure logrotate.service has run again since you made this change? Just > simulate the timer and start logrotate.service again. All the timer > does is activate

Re: [systemd-devel] How to chain services driven by a timer?

2024-04-10 Thread Dan Nicholson
On Wed, Apr 10, 2024 at 1:32 PM Brian Reichert wrote: > > On Wed, Apr 10, 2024 at 10:21:32PM +0300, Andrei Borzenkov wrote: > > On 10.04.2024 22:04, Brian Reichert wrote: > > > [Install] > > > WantedBy=logrotate.service > > > > > > > Links in [Install] section are created by "systemctl

Re: [systemd-devel] How to chain services driven by a timer?

2024-04-10 Thread Brian Reichert
On Wed, Apr 10, 2024 at 01:29:10PM -0600, Dan Nicholson wrote: > On Wed, Apr 10, 2024 at 1:21???PM Andrei Borzenkov > wrote: > Just to be complete, your unit won't be triggered until you see it in > "systemctl show -p Wants logrotate.service". With > WantedBy=logrotate.service, you'll also find

Re: [systemd-devel] How to chain services driven by a timer?

2024-04-10 Thread Brian Reichert
On Wed, Apr 10, 2024 at 10:21:32PM +0300, Andrei Borzenkov wrote: > On 10.04.2024 22:04, Brian Reichert wrote: > > [Install] > > WantedBy=logrotate.service > > > > Links in [Install] section are created by "systemctl enable". I could have sworn I did this, but did so (again) just to be sure:

Re: [systemd-devel] How to chain services driven by a timer?

2024-04-10 Thread Dan Nicholson
On Wed, Apr 10, 2024 at 1:21 PM Andrei Borzenkov wrote: > > On 10.04.2024 22:04, Brian Reichert wrote: > > On Wed, Apr 10, 2024 at 09:06:09AM -0600, Dan Nicholson wrote: > >> On Wed, Apr 10, 2024 at 8:50???AM Brian Reichert > >> wrote: > >>> > >>> My current service file: > >>> > >>>[Unit]

Re: [systemd-devel] How to chain services driven by a timer?

2024-04-10 Thread Andrei Borzenkov
On 10.04.2024 22:04, Brian Reichert wrote: On Wed, Apr 10, 2024 at 09:06:09AM -0600, Dan Nicholson wrote: On Wed, Apr 10, 2024 at 8:50???AM Brian Reichert wrote: My current service file: [Unit] Description=Activities after logrotation Requires=logrotate.service

Re: [systemd-devel] How to chain services driven by a timer?

2024-04-10 Thread Brian Reichert
On Wed, Apr 10, 2024 at 09:06:09AM -0600, Dan Nicholson wrote: > On Wed, Apr 10, 2024 at 8:50???AM Brian Reichert wrote: > > > > My current service file: > > > > [Unit] > > Description=Activities after logrotation > > > > Requires=logrotate.service > > Wants=logrotate.service > >

Re: [systemd-devel] How to chain services driven by a timer?

2024-04-10 Thread Dan Nicholson
On Wed, Apr 10, 2024 at 8:50 AM Brian Reichert wrote: > > My current service file: > > [Unit] > Description=Activities after logrotation > > Requires=logrotate.service > Wants=logrotate.service > After=logrotate.service > > [Service] > #Type=oneshot > Type=simple > >

Re: [systemd-devel] How to chain services driven by a timer?

2024-04-10 Thread Mantas Mikulėnas
On Wed, Apr 10, 2024 at 5:50 PM Brian Reichert wrote: > My goal is to implement a service that runs after logrotate.service > completes. > > logrotate.service is triggered by a timer logrotate.timer. > > I don't want to modify either of logrotate.service or logrotate.timer, > as they are

[systemd-devel] How to chain services driven by a timer?

2024-04-10 Thread Brian Reichert
My goal is to implement a service that runs after logrotate.service completes. logrotate.service is triggered by a timer logrotate.timer. I don't want to modify either of logrotate.service or logrotate.timer, as they are provided by the OS vendor (SLES 12 SP5, in my case.) I've tried to apply