Antw: [EXT] Need a systemd unit example that checks /etc/fstab for modification and sends a text message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 >>> Tony Rodriguez <unixpro1970@xxxxxxxxx> schrieb am 09.02.2022 um 02:27 in
Nachricht <e8a7bcb0-1f80-475f-150a-e41d2cf5d51f@xxxxxxxxx>:
> From my understanding, it is frowned by systemd developers to 
> "automatically" reload systemd via "systemctl daemon-reload" when 
> /etc/fstab is modified.  Guessing this is why such functionality hasn't 
> already been incorporated into systemd.  However, I would like to send a 
> simple text message. Instructing users to manually invoke "systemctl  
> deamon-reload" after modifying /etc/fstab via dmesg command or inside 
> /var/log/messages.

The real mess is that a traditional mount works as soon as you have modified /etc/fstab. With systemd there are generators that convert fstab to units, and the generators have to be triggered, and the new units have to be read.
This is a simple example how things can be made more complicated to use and understand.

> 
> Unsure how to do so inside a systemd UNIT.  Will someone please provide 
> an example how to do so?

I had a similar scenario, but the idea of a unit triggering a generator that does reload the daemon in turn, just to be able to use the units that were created by the generator is just some unreliable mess (compared to LSB scripts where you simply started the script and all was fine).

Regards,
Ulrich

> 
> Thanks








[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux