As you probably know, Google Reader will be shutting down, come July, 2013. Instead of looking for a different hosted service to migrate to, I thought it would be better to use a self-hosted solution. I picked a PHP application called Tiny Tiny RSS.
After I set up a new subdomain and an nginx config file, the installation instructions were pretty easy to follow, except the part about setting up the script responsible for updating the feeds.
Starting The Daemon
Since I’m hosting this on a VPS, I have the possibility of running the updater as a daemon (a process that runs continually in the background). After a bit of googling and some trial and error, I came up with the following command to start it up:
sudo -u www-data php ./update.php -daemon > /dev/null & disown $!
sudo -u www-data part makes it so that the process is owned by the
www-data user, instead of my user or root.
disown $!, the process will continue to run even after I end the SSH session.
Stopping The Daemon
If I ever want to terminate the daemon, I just need to find it’s process ID and send it the kill signal:
pgrep './update.php' | xargs kill -9
Also, it seems I need to delete the
./lock/update_daemon.lock file, to avoid getting a nag in the UI.