If you can, your best option would be to do whatever this script does in
the image itself. That way, you never need to restart any services; your
image would already contain whatever the result of that script is. You can
do that with a postinstall script. Pay attention to paths; the postinstall
script will not run in the chroot environment. And of course do not restart
any services in a postinstalls script, as it would affect the wrong system.

But sometimes that's not an option (or updating on-the-fly without reboot
can be desirable). In that case, your second-best option is what you are
doing: in your postscript, run systemctl restart on whatever services need
to be restarted.

_______________________________________________________________________
Kevin Keane | Systems Architect | University of San Diego ITS |
kke...@sandiego.edu
Maher Hall, 192 |5998 Alcalá Park | San Diego, CA 92110-2492 | 619.260.6859
| Text: 760-721-8339

*REMEMBER! **No one from IT at USD will ever ask to confirm or supply your
password*.
These messages are an attempt to steal your username and password. Please
do not reply to, click the links within, or open the attachments of these
messages. Delete them!




On Tue, Jul 7, 2020 at 6:31 PM Lachlan Musicman <data...@gmail.com> wrote:

> Is there an easy way to restart or reload a service in systemd?
>
> We are currently distributing a .post file va synclist? The problem is
> that it's a script that essentially runs systemctl restart  - and the
> file gets left behind.
>
> It feels clumsy - I presume we are doing something wrong.
>
> cheers
> L.
>
>
> _______________________________________________
> xCAT-user mailing list
> xCAT-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xcat-user
>
_______________________________________________
xCAT-user mailing list
xCAT-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xcat-user

Reply via email to