On 05/03/2013 06:37 PM, S. Dale Morrey wrote: > I have a daemon that has the potential to cause havoc if started as root. > It was designed to run as root, fortunately the binary does know how to > daemonize itself. > > This is on ubuntu 13.04. > > Normally I would just create a bash script to start & stop it, but I > remember a few weeks ago we were saying init scripts were not best practice > anymore. So what's the best way now, or was that whole discussion only for > other distros? > > Thanks! > > /* > PLUG: http://plug.org, #utah on irc.freenode.net > Unsubscribe: http://plug.org/mailman/options/plug > Don't fear the penguin. > */ > *I* personally like to use Perl and it's Proc::Daemon module https://metacpan.org/module/Proc::Daemon it's a clean and easy interface. You can set a * * * * * cron to slap it and if it's running it quietly exits, or else starts the daemon. I wrote a poor man's script here: https://github.com/jnbek/misc_scripts/blob/master/daemon.pl and I use it to start my gitit wiki's, Gisgraphy, and a number of other things on my FreeBSD server and it brings me great joy. The Proc::Daemon approach has the benefit of running on pretty much any *nix system and maybe even Windoze.
-- John D Jones III Perl/Javascript/Systemd Zealot [email protected] http://www.zoelife4u.org/ /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
