Daemoninsing a rake task

前端 未结 4 1646
遥遥无期
遥遥无期 2020-12-17 03:52

I have a rake task which runs mailman under the rails environment.

I\'d like to ensure that rake task is always running via a daemon.

My rake task is r

4条回答
  •  不思量自难忘°
    2020-12-17 04:22

    If you are on linux you could consider using start-stop-daemon.

    start-stop-daemon -S --pidfile /var/run/incoming_mail.pid -u rails_user -d /path/to/your/rails/app -b -a "rake incoming_mail"

    To later gracefully kill the process you can use most of the arguments but replace -S with -K.

    As always you can find more information on start-stop-daemon by reading the man pages.

提交回复
热议问题