[systemd-devel] Antw: [EXT] Re: Help understanding "notify" (SLES15 SP3 restarting smartd)

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Thu Feb 10 10:41:26 UTC 2022


>>> Ulrich Windl schrieb am 10.02.2022 um 11:16 in Nachricht <6204E61B.426 :
161 :
60728>:
>>>> Mantas Mikulenas <grawity at gmail.com> schrieb am 10.02.2022 um 10:34 in
> Nachricht
> <CAPWNY8Wi94qqXUM5gPzuAWS8ffCFk=VeTebZ3vtN_a8M+oJgMw at mail.gmail.com>:
> > On Thu, Feb 10, 2022 at 11:21 AM Ulrich Windl <
> > Ulrich.Windl at rz.uni-regensburg.de> wrote:
> > 
> >> Hi!
> >>
> >> I have a support case for SLES15 SP3 (systemd-246.16-7.33.1.x86_64)
where
> >> smartd is restarted for no obvious reason. Support says everything is
fine,
> >> but I disagree.
> >> Specifically smartd.service uses:
> >>
> >> [Service]
> >> Type=notify
> >> EnvironmentFile=-/var/lib/smartmontools/smartd_opts
> >> ExecStart=/usr/sbin/smartd -n $smartd_opts
> >> ExecReload=/bin/kill -HUP $MAINPID
> >>
> >> And mostly I wonder to what types of changes "notify" does react.
> >>
> > 
> > None. It's not an activation mechanism and not a configuration monitoring
> > mechanism – it's a readiness indication mechanism.
> > 
> > Type=notify expects the service to send a message to a Unix socket (at
> > $NOTIFY_SOCKET) indicating that it is "ready". (And optionally some
custom
> > text to show in 'systemctl status'.)
> 
> Mantas,
> 
> thanks for explaining; obviously I was wrong. But still: How can I find out

> why the smartd.service restarts?

Hi!

I digged further into it:
smartd_generate_opts.path has:
[Path]
Unit=smartd_generate_opts.service
PathChanged=/etc/sysconfig/smartmontools

smartd_generate_opts.service has:
[Service]
Type=oneshot
ExecStart=/usr/lib/smartmontools/generate_smartd_opts

Finally /usr/lib/smartmontools/generate_smartd_opts is not documented.

But running that program causes a restart of smartd!

h16:~ # stat /etc/sysconfig/smartmontools
  File: /etc/sysconfig/smartmontools
  Size: 1377            Blocks: 8          IO Block: 4096   regular file
Device: 2dh/45d Inode: 92175       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-02-10 00:13:44.843774074 +0100
Modify: 2022-01-27 09:19:36.000000000 +0100
Change: 2022-02-09 00:03:12.774336278 +0100
 Birth: 2020-11-27 09:05:09.867171140 +0100

The "Change" date was most likely caused by backup software resetting the
Access time.

So back to systemd: What time stamp does it use for PathChanged=?
(I failed to find documentation in the obvious systemd.* manual pages; whare
is it documented?)

Regards,
Ulrich

> 
> Regards,
> Ulrich
> 
> > 
> > -- 
> > Mantas Mikulėnas
> 
> 
> 
> 





More information about the systemd-devel mailing list