Click here to go to the forum index Click here for the home page
 
Author Message

<  TAP and patch development  ~  Using Puppy with PERL on LinkStation

Page 3 of 3
Goto page Previous  1, 2, 3
EMJB
Posted: Sun Feb 28, 2010 9:40 am Reply with quote
Frequent contributor Joined: 08 Jul 2005 Posts: 3632 Location: Maldon Essex
@birdman,

Many thanks for all your help.

Have been looking at what I call the crashes when starting from rcS, that is the perl script stops running (as reported by "ps") when it should be in an endless loop looking for a Toppy connection (and if found, for emails). The same script initiated from a telnet session is OK, so the only way of investigating seemed to be to add logging to disc and reboot each time to make it run from rcS.

The "crash" occurs on the line:
Code:
my $exit_status = WIFEXITED($sys_res)? WEXITSTATUS($sys_res): 999;

which I suspect is being caused by the child process being incomplete. When I run from telnet, the child process has already run, so perhaps I am getting the results from the previous run (which would explain some very peculiar results at times, and my total confusion!). Does that sound reasonable? When I next get a chance to look at this, I will try adding:
Code:
do {my $kid = waitpid(-1, WNOHANG);} while $kid > 0;
before the above.

With regards to the patched versions of puppy and ftpd-topfield, I had found that link but there was no version listed there that seemed appropriate to the LinkStation (the version I currently was identified as "arm9").

Thanks again,

EMJB

Update - seem to have made major progress, thanks to help above and a bit of trial and error. Have included the wait for the child process to end, which then gave me the situation where it didn't crash when run from boot.

However when run from boot it indicated that it cound'nt find puppy in "/opt/bin". Adding a check that puppy really exists using in the relevant directory using '(-e "/opt/bin/puppy")' beforehand seems to confirm that puppy is not there. On the other hand when I run exactly the same code in a telnet session it works perfectly.

Can't do any more any more experiments now, but would be grateful for any explanations.

EMJB
View user's profile Send private message
birdman
Posted: Mon Mar 01, 2010 2:14 am Reply with quote
Frequent contributor Joined: 13 Dec 2006 Posts: 1765 Location: Hitchin, HERTS Tx: Sandy Heath
EMJB wrote:
Does that sound reasonable?
No. You're getting the result of system() call. Any previous child process should have nothing to do with it at all.
and also wrote:
However when run from boot it indicated that it cound'nt find puppy in "/opt/bin". Adding a check that puppy really exists using in the relevant directory using '(-e "/opt/bin/puppy")' beforehand seems to confirm that puppy is not there. On the other hand when I run exactly the same code in a telnet session it works perfectly.
Looks like you are trying to run it before all of your disks are mounted, then. You mentioned rcS. Not sure what that is (i.e. when it gets run). The "usual" place to put as service startup script would be in rc3.d with a high Snn number (and in rc0.d with a low Knn one to stop it).

_________________

Toppy: TF5800PVR/250 - Black, now 1TB WD10EURX
F/W: MS6 Recommended F/W 12/9/2009 -FmVrXp+BmC0CbFsIPsUUuWfZXl,
Loader: C5.14, Hardware: 1.01
TAPs: SecCache (UK) v0.4; EPG2MEI v0.96; FontManager 1.0d; QuickJump 1.71; MhegOnOff(Now1) A3; EIT Sub v0.6; MyStuff 6.6
USB connected: SheevaPlug with Debian wheezy
Sig mostly from MyInfo on 26/10/09
View user's profile Send private message
EMJB
Posted: Mon Mar 01, 2010 6:07 pm Reply with quote
Frequent contributor Joined: 08 Jul 2005 Posts: 3632 Location: Maldon Essex
@birdman

Did wonder a bout a problem mounting drives or similar, but a "sleep(30)" did not get round the problem, so was beginning to wonder whether it was a permissions issue. Anyway I have copied puppy to another directory and used it from there, and I now have had it running for about 7 hours with Toppy on & off, and with extended ftpd-topfield use.

If I can't find anything else seriously wrong in the next few days, I will probably post the perl script, the associated TAP, and notes on both in case anyone else either wants to use them as is, or develop them further.

Thanks again for all your help,

EMJB
View user's profile Send private message
birdman
Posted: Tue Mar 02, 2010 2:25 am Reply with quote
Frequent contributor Joined: 13 Dec 2006 Posts: 1765 Location: Hitchin, HERTS Tx: Sandy Heath
EMJB wrote:
Did wonder a bout a problem mounting drives or similar, but a "sleep(30)" did not get round the problem
That would depend where you put it. You might just be delaying the whole of the boot process by 30s? You really need to make sure that starting up your own service daemons is done at the very end of the boot process. I don't know where rcS comes into the order of things (since I know of no system with rcS).

_________________

Toppy: TF5800PVR/250 - Black, now 1TB WD10EURX
F/W: MS6 Recommended F/W 12/9/2009 -FmVrXp+BmC0CbFsIPsUUuWfZXl,
Loader: C5.14, Hardware: 1.01
TAPs: SecCache (UK) v0.4; EPG2MEI v0.96; FontManager 1.0d; QuickJump 1.71; MhegOnOff(Now1) A3; EIT Sub v0.6; MyStuff 6.6
USB connected: SheevaPlug with Debian wheezy
Sig mostly from MyInfo on 26/10/09
View user's profile Send private message
EMJB
Posted: Tue Mar 02, 2010 9:11 am Reply with quote
Frequent contributor Joined: 08 Jul 2005 Posts: 3632 Location: Maldon Essex
@birdman

Unfortunately this exercise is proving to need a much greater depth of understanding of Linux in general, and the LinkStation implementation in particular, than I had anticipated when I started (e.g. "starting up your own service daemons" means nothing to me).

However with your help I seem to have managed to bodge something together which meets my needs, and if you or others would like to tidy it up and remove the remaining bugs/limitations for general use that would be great - I will put together some notes together on what I have done, the known limitations/bugs, and the associated TAP over the next week or so.

EMJB
View user's profile Send private message

Display posts from previous:  

All times are GMT + 1 Hour
Page 3 of 3
Goto page Previous  1, 2, 3

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum