Joe wrote:I would like to mention that changing the shell_exec with the exec on my DS207+ leads to endless, multiple media searches, when I manually start to refresh the media library. Well, I’m not encountering this type of problem, but in my system a media refresh from the “search for new media”-menu in the config screen doesn’t work at all. However, if I start from there a media refresh followed by a manual “http://<server_ip>:<port>/media_search.php” in my browser it does work smoothly. For some reason the file media_search.php isn’t called. So far I couldn’t find out the reason.
Joe wrote: I therefore now use your other suggestion, what you proposed on the Synology.NL forum, simply to "hard code":
Code:
function wget_location()
{
if (is_windows())
return os_path(SC_LOCATION.'ext/wget/wget.exe');
else
return $location= '/usr/syno/bin/php';
}
I’m note sure I fully understand the hard coded path as in my system function “wget” is located in ‘/usr/syno/bin/’ in stead of ‘/usr/syno/bin/php/’. I tried both hard coded paths (to be sure), but the only result was that I couldn’t update my RSS feeds from my TV anymore.
Therefore I think we shouldn’t try to avoid function exec(), but I suggest we find the reason why function “media search” isn't called automatically.
Hope this makes sense, regards, Klaas -----------------------------------------------------------------------------
SwissCenter 1.20.1
Simese 1.40 / PHP 4.4.4 / MySQL 4.0.21 / Windows XP
Apache 2.2.8 / PHP 5.2.6 / MySQL 5.0.51b / Linux Synology 2.6.15
Synology DS107+ (128), firmware: DSM 2.0-0637
Pinnacle SC200
| | The administrator has disabled public write access.
Joe_999
Visitor
Re: Synology Linux: “shell_exec()” and “exec() pro - 2008/08/04 14:19Hi Klaas,
thanks for opening this thread, what really addresses my problems as well.
First, you are right, I used the wrong directory for wget, it´s indeed in /usr/syno/bin. Now, I corrected it, but for me it seems that the wget function and background search of media is still not working. In the support.log I never see any media found but just:
Of course, I don´t know whether the background media refresh with wget writes into support.log. Anybody can comment here, pls.?
Additionally, there is no progress shown on the media refresh page. The percentages fields remain empty or remain at the previous values. With telnet the "top" commandy does not report any wget process running, I guess that´s not correct neither?
The world looks different with the http://IP-address/media_search, therefore I am in general using this to refresh my media DB:
Immediately scanned files and found files are written into the support.log (with the shellexec() in file.php) and everything seems to run sequentially.
With the exec() instead, multiple media searches run simultaneosly, that means you see photo files detected between music files in the support.log, and the media DB refresh takes in general many hours, e.g. 10 hours (300 GByte of media, 70% of which are movies). It´s easy to detect in the many support.log.old files which are overwritten during that 10 hours interval that several media files have been found many times. Therefore I conclude, that the media_refresh is started more than once. (I have to admit that due to the use of German characters in some of my media file names I don´t know, whether I have a special issue here!).
I also think that the scheduled media refresh (in my case at 3.15 AM) does not work neither, since at least the support.log doesn´t show any actions at that time.
I think we LINUX (or Synology) users have to try to exchange information on what happens (and what doesn´t) if we use the media refresh button on the config pages in order to get closer to the root cause of our problem.
Regards
Joe
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Synology Linux: “shell_exec()” and “exec() pro - 2008/08/04 15:06Hi Joe,
Got your point now, and I’ve got exactly the same problem: when I just carry out a manual media refresh (“http://<server_ip>:<port>/media_search.php”) having the function exec() in file “/base/php/” the media search takes ages and ages.
However, as mentioned in my previous post I want to maintain function exec() so I deal with this issue differently. I start the media refresh from the config screen followed by a manual “http://<server_ip>:<port>/media_search.php”. The results of a TV media refresh is attached.
Activating the media refresh from the config screen is presented in row 1 through 19. As you can see function wget() is called file “/media_search.php/”, but nothing happens. However, after I’ve entered the file manually (see row 20) the refresh starts working as it should and is limited to the TV media.
Again, I’m not sure why file “/media_search.php” is not called. Could this be caused by a malfunctioning of function wget. If so, what can we do?
----------------------------------------------------------------------------- SwissCenter 1.20.1 Simese 1.40 / PHP 4.4.4 / MySQL 4.0.21 / Windows XP Apache 2.2.8 / PHP 5.2.6 / MySQL 5.0.51b / Linux Synology 2.6.15 Synology DS107+ (128), firmware: DSM 2.0-0637 Pinnacle SC200
| | The administrator has disabled public write access.
Joe_999
User
Posts: 99
Re: Synology Linux: “shell_exec()” and “exec() pro - 2008/08/04 15:37Klaas,
I think, I can confirm your experience, since while using the exec() in file.php I also started the media refresh most of the times in the "dual step mode":
1. Trying to do the background search via wget through the config media refresh page and then 2. since nothing seemed to happen in support.log (no scanned/found media statements) manually started the refresh with http://<server_ip>:<port>/media_search.php” some minutes later
and voilá, the scanned/found statements in support.log appeared.
Obviously step 1 is required in order to prevent exec()/media_search to end up in a mess!
However, very likely wget is not working on our stations so far. Did you see the media refresh percentages increase? Did you ever detect scheduled actions in your support.log?
I will do a little googling for wget and Synology tonight!
Regards
JoeClients: Popcorn A-100 with 4 GB Flash-Memory, Mozilla Firefox on MS Vista Business SP1.0 Media storage on NAS: Synology DS207+ SC 1.22 latest SVN installed on DS207+ (RAID 1) with FW 2.0-8.03 utilizing: Apache 2.2.8 (Unix) mod_ssl/2.2.8, MySQL 5.0.51b, OpenSSL 0.9.8g, PHP 5.2.6 GbE network with Zyxel GS-108A PCH-A100 connected via HDMI in 1920x1080p to display.
| | The administrator has disabled public write access.
Joe_999
Visitor
Re: Synology Linux: “shell_exec()” and “exec() pro - 2008/08/09 05:36
Code:
function wget_location()
{
if (is_windows())
return os_path(SC_LOCATION.'ext/wget/wget.exe');
else
return $location= '/usr/syno/bin/php';
}
There was indeed an error in the function wget_location() beyond in file.php, the correct syntax (while not using the shell_exec() or exec()) would be for the Synology NAS:
function wget_location()
{
if (is_windows())
return os_path(SC_LOCATION.'ext/wget/wget.exe');
else
return $location= '/usr/syno/bin/wget';
However, when using this function I am getting the same result as when using the shell() command as supposed by Klaas:
function wget_location()
{
if (is_windows())
return os_path(SC_LOCATION.'ext/wget/wget.exe');
else
return trim(exec("which wget | grep '^/' | head -1"));
}
I have a new suggestion about the reason of having multiple media refreshes:
It seems that everything is fine (except the long time for processing the mysqld task, 4 ... 5 minutes after the media scan) if I just select to refresh one category (not touching the media type button) or if i just select to refresh a media type (not touching the media category button).
Could it be that selecting a media type and a category ends up in multiple media refreshes?
I understand that media type ormedia category is the offered choice, but probably (accidentially) selecting both (=and) creates the media refresh mess? In that case probably the possibility to select both media refresh modes should be blocked in the menu!
Joe
| | The administrator has disabled public write access.
Pernod
Admin
Posts: 1892
Re: Synology Linux: “shell_exec()” and “exec() pro - 2008/08/09 07:47I understand that media type or media category is the offered choice, but probably (accidentially) selecting both (=and) creates the media refresh mess? Being able to select both is intended and will not cause problems.Players : Netgear EVA700 & Popcorn A-100 (090204) Webserver : Simese v2.5.5 - PHP v5.2.9-1 - MySQL v5.0.6.7 Server : Vista SP2 Home Premium Spec : Intel C2Q Q6600 - 4GB RAM - 2TB HDD
| | The administrator has disabled public write access.
BABACHAN
User
Posts: 43
Re: Synology Linux: “shell_exec()” and “exec() pro - 2008/09/26 16:18I installed the latest FW 722 on my Synology NAS. So I reinstalled SwissCenter according to the manual. I followed step 1 through 10. After that I found out that the "Support Info" page reported an error with shell_exec. So I replaced shell_exec with exec in base/file.php. Now the correct wget location is reported. Then I started the "Search for new media" page. The search works fine. But the page remains blank until the search is completed. So it only shows the end result. And the logging is only updated when the logging level is > 5. I used level 9. So everything works fine except no progress is displayed.SwissCenter 1.21.1 client: Popcorn Hour A-100 servers: Synology DS207+ (128) firmware DSM 2.0-0722 servers: Windows XP SP2
| | The administrator has disabled public write access.
BABACHAN
User
Posts: 43
Re: Synology Linux: “shell_exec()” and “exec() pro - 2008/09/26 16:19Pernod,
Could you replace shell_exec() with exec() in the next release? Or does this cause problems in other areas?SwissCenter 1.21.1 client: Popcorn Hour A-100 servers: Synology DS207+ (128) firmware DSM 2.0-0722 servers: Windows XP SP2
| | The administrator has disabled public write access.
Pernod
Admin
Posts: 1892
Re: Synology Linux: “shell_exec()” and “exec() pro - 2008/09/26 16:45Dunno, I'll have to do some testing to see if it makes any difference on Windows. Rob should have a better idea since he chose to use shell_exec in the first place.
NigelPlayers : Netgear EVA700 & Popcorn A-100 (090204) Webserver : Simese v2.5.5 - PHP v5.2.9-1 - MySQL v5.0.6.7 Server : Vista SP2 Home Premium Spec : Intel C2Q Q6600 - 4GB RAM - 2TB HDD
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Synology Linux: “shell_exec()” and “exec() pro - 2008/09/27 03:18I would be in favour as well, but I'm not sure whether the change of "function shell_exec()" into "function exec()" works for me and BABACHAN only or it is really a general improvement. From this perspective I'm interested in Joe's latest experiences.
If fine and it won't create any problems with other systems, please go for BABACHAN's suggestion.
regards, Klaas --------------------------------------------------------------------------- SwissCenter SVN 1090 Simese 1.40 / PHP 4.4.4 / MySQL 4.0.21 / Windows XP Apache 2.2.8 / PHP 5.2.6 / MySQL 5.0.51b / Linux Synology 2.6.15 Synology DS107+ (128), firmware: DSM 2.0-0702 Pinnacle SC200
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Synology Linux: “shell_exec()” and “exec() pro - 2008/11/08 11:34Hi Nigel,
Any news on the request to replace "function shell_exec()" with "function exec()"?
regards, Klaas --------------------------------------------------------------------------- SwissCenter SVN 1113 Simese 1.40 / PHP 4.4.4 / MySQL 4.0.21 / Windows XP Apache 2.2.8 / PHP 5.2.6 / MySQL 5.0.51b / Linux Synology 2.6.15 Synology DS107+ (128), firmware: DSM 2.0-0702 Pinnacle SC200
| | The administrator has disabled public write access.
Pernod
Admin
Posts: 1892
Re: Synology Linux: “shell_exec()” and “exec() pro - 2008/11/08 11:39I was hoping that Rob would contribute some thoughts on the matter... Players : Netgear EVA700 & Popcorn A-100 (090204) Webserver : Simese v2.5.5 - PHP v5.2.9-1 - MySQL v5.0.6.7 Server : Vista SP2 Home Premium Spec : Intel C2Q Q6600 - 4GB RAM - 2TB HDD
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Synology Linux: “shell_exec()” and “exec() pro - 2008/11/08 12:04Not sure, but replacing the functions may have an effect on getting synopsis of movies in a "XP/Simese"-setup. Maybe caused by PHP 4?
If so, might there be an alternative code for this type of setup that also works with (Synology)Linux/Apache?
regards, Klaas --------------------------------------------------------------------------- SwissCenter SVN 1113 Simese 1.40 / PHP 4.4.4 / MySQL 4.0.21 / Windows XP Apache 2.2.8 / PHP 5.2.6 / MySQL 5.0.51b / Linux Synology 2.6.15 Synology DS107+ (128), firmware: DSM 2.0-0702 Pinnacle SC200
| | The administrator has disabled public write access.