On Thu, May 27, 2010 at 9:59 PM, Neal Hogan <nealho...@gmail.com> wrote: > On Thu, May 27, 2010 at 2:52 PM, Israel Garcia <igalva...@gmail.com> wrote: >> Hi, >> >> I need to daemonize this command on a debian lenny? >> >> ruby apd.rb >> >> It's a simple app for my network. >> >> I was thinking to use nohup ruby app.rb & at rc.local, but I want to >> know if there's other ways to do it. > > It's been awhile since I wrote such a script, so the details aren't at > the tip of my tongue, but the following helped me when I did. Perhaps > it will help. > > http://www.debian-administration.org/article/Making_scripts_run_at_boot_time_with_Debian Hi Neal,
I did it this way.. look my init script :-) #! /bin/sh # /etc/init.d/apd # # Some things that run always # Carry out specific functions when asked to by the system case "$1" in start) echo "Starting postfix policy daemon...." sleep 1 ruby /usr/local/bin/apd.rb & > /dev/null echo "" > /dev/null ;; stop) echo "Stopping postfix policy daemon...." sleep 1 kill -9 `ps afx|grep "ruby /usr/local/bin/apd.rb"|grep -v grep|awk '{print $1}'` >/dev/null ;; restart) $0 stop sleep 1 $0 start ;; *) echo "Usage: /etc/init.d/apd {start|stop|restart}" exit 1 ;; esac exit 0 > >> >> -- >> Regards; >> Israel Garcia >> >> >> -- >> To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org >> with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org >> Archive: >> http://lists.debian.org/aanlktildf701nd0cdwoegvxjp56o3m7h3zszqg882...@mail.gmail.com >> >> > -- Regards; Israel Garcia -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/aanlktik2t52eckeypk8ce1dlnvzml0oleu1d_yedi...@mail.gmail.com