I need to restart a systemd service (running as root) every time a new user is created. I saw that some systems have a way to make an adduser hook but this isn't an option in RHEL8. What is the best (least invasive; most secure) way to do this?
Currently only thing I can think of is adding a script to /etc/profile.d but I'm not sure if there's a way to make it run scripts as root (without doing something insecure)
/etc/profile.dwould restart the service when a user logs in, not when the user is created.