Re: shell script run in backend
Hello,
On Sun, May 14, 2023 at 05:04:50PM +0800, Tom Reed wrote:
> I know convert it to a perl script and run it under App::Daemon for
> background jobs.
Having it as a systemd service is a much cleaner solution, whether
it is shell or Perl or any other language.
The main point of the App::Daemon module is to detach from shell,
redirect stdout etc and provide start/stop/status commands, all of
which are provided by systemd.
I suppose if aiming for it to be portable to other init systems it
could still be useful, but even so if on a machine with systemd I'd
run it as a systemd service and tell App::Daemon to run it
foreground (so that systemd takes care of backgrounding it).
Cheers,
Andy
--
https://bitfolk.com/ -- No-nonsense VPS hosting
Reply to: