Starting the update daemon on Synology NAS/generic Unix

Howtos, instructions and links to related software. Do not ask questions here.
feader
Bear Rating Master
Bear Rating Master
Posts: 160
Joined: 26 Dec 2012, 20:03

Starting the update daemon on Synology NAS/generic Unix

Postby feader » 24 Mar 2013, 23:33

This command should work on most Unixes where no fancy stuff like screen or start-stop-daemon is available. The only Synology specific thing is the user http, this should be replaced by the name of the user running the web server.

This starts the update daemon as user http (the user apache is run by her):

Code: Select all

su -m http -c "(trap '' SIGHUP && /usr/bin/php /var/services/web/ttrss/update.php --daemon >> /var/log/ttrss_daemon.log 2>&1) &" 2> /dev/null

Substitute /var/services/web/ttrss with the path to your Tiny Tiny RSS installation.
The log file in /var/log/ttrss_daemon.log must be writable to http, so it should be created beforehand. Note that the daemon is very wordy, but adding --quiet to the options fixes this, see here.

Edit: Updated for DSM 5.
Last edited by feader on 11 Apr 2014, 03:25, edited 5 times in total.

Cinnamon
Bear Rating Trainee
Bear Rating Trainee
Posts: 24
Joined: 15 Mar 2013, 17:42

Re: Starting the update daemon on Synology NAS

Postby Cinnamon » 26 Apr 2013, 13:30

Hello,

after the update to the new DSM-Version and restart, update daemon is not running. I´ve used the following commands:

Code: Select all

$ su -m nobody -c "(trap '' SIGHUP SIGINT SIGQUIT && /usr/bin/php /var/services/web/ttrss/update.php --daemon > /dev/null 2>&1) &"


Code: Select all

su -m nobody -c "cd /var/services/web/ttrss && /usr/bin/php /var/services/web/ttrss/update.php --feeds >/dev/null 2>&1"


Nothing happened. Only the manual update works, but I want automatic update of all RSS-Feeds.

feader
Bear Rating Master
Bear Rating Master
Posts: 160
Joined: 26 Dec 2012, 20:03

Re: Starting the update daemon on Synology NAS

Postby feader » 26 Apr 2013, 16:14

For me, it still works, and i have a pretty newish version of DSM 4.2. Only things that come to my mind:
  • You have to substitute /var/services/web/ttrss with your actual installation path of Tiny Tiny RSS (note that on most configurations, /var/services/web/ is the same mountpoint as /volume1/web/),
  • the --daemon version must be started anew after each reboot,
  • the --feeds version must be called for each update, you can do this with a cron job.
To be sure that the daemon is not running, check with

Code: Select all

ps|grep php

on a shell.

Edit: First point was very misleading
Last edited by feader on 26 Apr 2013, 20:48, edited 1 time in total.

Cinnamon
Bear Rating Trainee
Bear Rating Trainee
Posts: 24
Joined: 15 Mar 2013, 17:42

Re: Starting the update daemon on Synology NAS

Postby Cinnamon » 26 Apr 2013, 19:29

Hello feader,

thanks for your answer. TTRSS is installed for to months on my NAS.

The only running process after typing

Code: Select all

ps | grep php


is

Code: Select all

15957    root 2984 S grep php


Which process is this?

ibreakcellphones
Bear Rating Trainee
Bear Rating Trainee
Posts: 31
Joined: 28 Mar 2013, 09:49

Re: Starting the update daemon on Synology NAS

Postby ibreakcellphones » 26 Apr 2013, 20:10

That's your grep process. What you probably want to run is:

Code: Select all

ps | grep "php" | grep -v "grep"


This will eliminate your grep process from showing up in your results.

feader
Bear Rating Master
Bear Rating Master
Posts: 160
Joined: 26 Dec 2012, 20:03

Re: Starting the update daemon on Synology NAS

Postby feader » 26 Apr 2013, 20:42

Cinnamon wrote:The only running process is

Code: Select all

15957    root 2984 S grep php


Yeah, what ibreakcellphone said. If the daemon was running, the output should include something like

Code: Select all

11522 nobody   33160 S    /usr/bin/php /var/services/web/ttrss/update.php --daemon --quiet

so your daemon is not running. It's hard to debug that from here, so you may want to start a cron job as described here instead; you have to edit /etc/crontab for that.

Cinnamon
Bear Rating Trainee
Bear Rating Trainee
Posts: 24
Joined: 15 Mar 2013, 17:42

Re: Starting the update daemon on Synology NAS

Postby Cinnamon » 27 Apr 2013, 01:15

I fixed it myself.

I have done the following: I symlink to the php directory and type the daemon command into the shell. After that the feeds update automatically.

Are their any bugs in DSM according to safe_mode_exec_dir? I deactivated the safe_mode_exec_dir but obviously it wasn't deactivated at all.

Sorry for mispelling and false grammar.

feader
Bear Rating Master
Bear Rating Master
Posts: 160
Joined: 26 Dec 2012, 20:03

Re: Starting the update daemon on Synology NAS

Postby feader » 27 Apr 2013, 17:49

Cinnamon wrote:I have done the following: I symlink to the php directory and type the daemon command into the shell. After that the feeds update automatically.

Are their any bugs in DSM according to safe_mode_exec_dir? I deactivated the safe_mode_exec_dir but obviously it wasn't deactivated at all.

For clarities sake: You executed

Code: Select all

ln -s /usr/bin/php /usr/syno/bin/php

on the shell, and then it worked? BTW, you can inspect the DSes PHP environment with the application "PHPInfo" in the DSM GUI. I see
safe_mode_exec_dir no value no value

Cinnamon
Bear Rating Trainee
Bear Rating Trainee
Posts: 24
Joined: 15 Mar 2013, 17:42

Re: Starting the update daemon on Synology NAS

Postby Cinnamon » 27 Apr 2013, 21:01

Yes I executed it and then I started the update daemon with the command in my first post. Then everything functioned well.

I'm sure safe_mode_exec_dir has no value before the update. After it I'm not sure. The GUI seems to me more comfortable but system settings should be changed via shell.

Thanks for help.

anthonyl
Bear Rating Trainee
Bear Rating Trainee
Posts: 1
Joined: 28 Apr 2013, 02:18

Re: Starting the update daemon on Synology NAS

Postby anthonyl » 28 Apr 2013, 02:22

How could I add the daemon to init.d so that I don't have to manually restart it after reboot?

feader
Bear Rating Master
Bear Rating Master
Posts: 160
Joined: 26 Dec 2012, 20:03

Re: Starting the update daemon on Synology NAS

Postby feader » 28 Apr 2013, 18:12

anthonyl wrote:How could I add the daemon to init.d so that I don't have to manually restart it after reboot?

There is a solution using a start stop script, but not fully satisfying (at boot time, commands that should be executed as nobody aren't). I PM you.


Return to “Knowledge Base”

Who is online

Users browsing this forum: No registered users and 1 guest