<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 8 Jan 2024 at 11:49, port19 <<a href="mailto:port19@port19.xyz">port19@port19.xyz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi all,<br>
<br>
we currently have a monitoring check that alerts us of a service-specific config file having changed more recently than the services last restart.<br>
We retrieve the restart time via `systemctl show <service> --property=ActiveEnterTimestamp`.<br>
Is there a comparably elegant way to retreive the reload timestamp?<br>
To avoid confusion, by reload I do not mean `systemctl daemon-reload`, I mean `systemctl reload <service>`.<br>
<br>
Alternatively, is there a way to let systemd handle the reloading of services on change of related config files?<br></blockquote><div>You didn't say what systemd version you use (mine is 255) </div><div>systemctl show httpd | fgrep -i rel<br>ReloadResult=success<br>ReloadSignal=1<br>ExecReload={ path=/usr/bin/httpd ; argv[]=/usr/bin/httpd -k graceful ; ignore_errors=no ; start_time=[Mon 2024-01-08 17:08:45 GMT] ; stop_time=[Mon 2024-01-08 17:08:45 GMT] ; pid=1476187 ; code=exited ; status=0 }<br>ExecReloadEx={ path=/usr/bin/httpd ; argv[]=/usr/bin/httpd -k graceful ; flags= ; start_time=[Mon 2024-01-08 17:08:45 GMT] ; stop_time=[Mon 2024-01-08 17:08:45 GMT] ; pid=1476187 ; code=exited ; status=0 }<br>ManagedOOMMemoryPressureLimit=0<br>CanReload=yes</div><div><br></div><div>So with a bit of awk you can get at it this way</div><div>failing that, every reload is actually done via an ExecReload command in the service file, so you could intercept this with your own command instead</div><div><br>NeedDaemonReload=no<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Best,<br>
port19<br>
</blockquote></div></div>