[systemd-devel] can't start shell script in the background

Barry Scott barry at barrys-emacs.org
Fri Dec 2 15:40:08 UTC 2022



> On 2 Dec 2022, at 14:56, Lentes, Bernd <bernd.lentes at helmholtz-muenchen.de> wrote:
> 
> [Service]
> ExecStart=/root/skripte/dev_shm_inotifywait.sh
> Type=exec
> # ExecStart=/usr/bin/inotifywait "-e delete -d -o /var/log/monitordev_shm.log -r --timefmt %d.%m.%Y-%H:%M:%S --format %w%f:%e:%T /dev/shm"
> # Restart=always

The Type= does not match how inotifywait is being run. You would need Type=fork (I think).

But use Type=simple and remove the -d. With systemd its not necessary to use a "daemon" mode.
Daemon mode is legacy in an systemd wolld and will just make maintaining the service harder then is necessary.

Barry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20221202/e6ba643a/attachment.htm>


More information about the systemd-devel mailing list