0

Help! I want to set up a monitoring service on my Debian server, that will monitor and start wen needed the updater for tiny tiny rss. The problem is that it is a php foreground process normally run in a screen on a non-root user.

I can run it as:

php ./update_daemon2.php

or better putting it in the background and in order to run it from a different account

sudo -u tinyrssuser php ./update_deamon2.php -daemon > /dev/null & disown $!

I have installed monit, but cant seem to find a way to have it detect if t is running. I would prefer to keep with monit but it is not necessary.

Any ideas would be appreciated.

Chaqosmagnetx
  • 55
  • 1
  • 5

2 Answers2

1

Found the answer at: http://510x.se/notes/posts/Install_Tiny_Tiny_RSS_on_Debian/

But use this instead under /etc/init.d/ http://mylostnotes.blogspot.co.il/2013/03/tiny-tiny-rss-initd-script.html

make sure to set the user and group

Chaqosmagnetx
  • 55
  • 1
  • 5
0

Create an upstart script /etc/init/ttrss.conf:

description "TT-RSS Feed Updater"
author "The Epyon Avenger <epyon_avenger on TT-RSS forums>"

env USER=www-data
env TTRSSDIR=/var/www/ttrss

start on started mysql
stop on stopping mysql

respawn

exec start-stop-daemon --start --make-pidfile --pidfile /var/run/ttrss.pid --chdir $TTRSSDIR --chuid $USER --group $USER --exec /usr/bin/php ./update_daemon2.php >> /var/log/ttrss/ttrss. log 2>&1

Start the script:

sudo start --system ttrss

Add the following lines to your monit conf:

check process ttrss with pidfile /var/run/ttrss.pid
  start program = "/sbin/start ttrss"   
  stop program = "/sbin/stop ttrss"
DmitrySandalov
  • 3,879
  • 3
  • 23
  • 17