Eurocardsharing

Go Back   Eurocardsharing > Sharing receivers > DreamBox > Chat

Chat Discussion, How can you auto start a program on DM500? at DreamBox forum; I am running rq-echo-client on DM500 but in order to start it I must telnet into box and start it ...

Reply
 
LinkBack Thread Tools Display Modes
How can you auto start a program on DM500?
Old
  (#1)
mreo
Junior Member
 
mreo's Avatar
 
Offline
Posts: 8

Level: 1 [♥ Bé-Yêu ♥]
Life: 0 / 18
Magic: 2 / 457
Experience: 73%

Thanks: 0
Thanked 2 Times in 2 Posts
Join Date: Jun 2009
How can you auto start a program on DM500? - 14-June-2009, 22:57

I am running rq-echo-client on DM500 but in order to start it I must telnet into box and start it manually. I would like to have it start automatically. Am using Pli image. Any help would be greatly appreciated.
   
Reply With Quote
Old
  (#2)
Markoni
ECS Master
 
Markoni's Avatar
 
Offline
Posts: 499

Level: 20 [♥ Bé-Yêu ♥♥ Bé-Yêu ♥♥ Bé-Yêu ♥♥ Bé-Yêu ♥]
Life: 0 / 491
Magic: 166 / 14881
Experience: 64%

Thanks: 40
Thanked 273 Times in 133 Posts
Join Date: Aug 2007
14-June-2009, 23:52

Quote:
Originally Posted by mreo View Post
I am running rq-echo-client on DM500 but in order to start it I must telnet into box and start it manually. I would like to have it start automatically. Am using Pli image. Any help would be greatly appreciated.
Look for file "init" in /var/etc/ If it does not exist, create it.

To init, add:

Code:
#!/bin/sh
{put complete path and rq-echo-client command here, as from telnet}
This runs the command you type at telnet to run rq-echo-client at every boot.

Running at certain times is much the same, except look in /var/spool/cron/crontabs for the file "root". If it and/or the directories do(es) not exist, make it and/or them. To root, add:

Code:
1 * * * * {put complete path and rq-echo-client command here, as from telnet}
This runs the cronjob once an hour at the first minute of the hour.

Remember to enable crond in the "Services to run" panel menu.
   
Reply With Quote
Sponsored Links
Old
  (#3)
mreo
Junior Member
 
mreo's Avatar
 
Offline
Posts: 8

Level: 1 [♥ Bé-Yêu ♥]
Life: 0 / 18
Magic: 2 / 457
Experience: 73%

Thanks: 0
Thanked 2 Times in 2 Posts
Join Date: Jun 2009
15-June-2009, 02:43

Quote:
Originally Posted by Markoni View Post
Look for file "init" in /var/etc/ If it does not exist, create it.

To init, add:

Code:
#!/bin/sh
{put complete path and rq-echo-client command here, as from telnet}
This runs the command you type at telnet to run rq-echo-client at every boot.

Running at certain times is much the same, except look in /var/spool/cron/crontabs for the file "root". If it and/or the directories do(es) not exist, make it and/or them. To root, add:

Code:
1 * * * * {put complete path and rq-echo-client command here, as from telnet}
This runs the cronjob once an hour at the first minute of the hour.

Remember to enable crond in the "Services to run" panel menu.
Thank you very much but unfortunately it did not work.

There was no init file in /var/etc/ so I created one as follows:

!/bin/sh
. /var/bin/rq-echo-client

after which the box would not boot. Tried it several times with same result. If I removed the init file the box would boot but if I added it the box would not boot up.

The cron option is not useful because it only works at certain times of the day. I am in Costa Rica, Central America, where we have sometimes have frequent power failures, especially during the rainy season, which is why I want it to start when the box powers on. But apparently this will only work if it starts after the box has already booted up.
   
Reply With Quote
Old
  (#4)
Markoni
ECS Master
 
Markoni's Avatar
 
Offline
Posts: 499

Level: 20 [♥ Bé-Yêu ♥♥ Bé-Yêu ♥♥ Bé-Yêu ♥♥ Bé-Yêu ♥]
Life: 0 / 491
Magic: 166 / 14881
Experience: 64%

Thanks: 40
Thanked 273 Times in 133 Posts
Join Date: Aug 2007
15-June-2009, 06:13

Quote:
Originally Posted by mreo View Post
Thank you very much but unfortunately it did not work.

There was no init file in /var/etc/ so I created one as follows:

!/bin/sh
. /var/bin/rq-echo-client

after which the box would not boot. Tried it several times with same result. If I removed the init file the box would boot but if I added it the box would not boot up.

The cron option is not useful because it only works at certain times of the day. I am in Costa Rica, Central America, where we have sometimes have frequent power failures, especially during the rainy season, which is why I want it to start when the box powers on. But apparently this will only work if it starts after the box has already booted up.
Code:
#!/bin/sh
./var/bin/rq-echo-client
exit 0
Just as written...

. /var/bin/rq-echo-client may not have a space between the "." and path, as you wrote it. This will certainly hang.

You may not need the first "." before the path, but it should not hurt. Try it either way, but without any space.

The # in #!/bin/sh is not a regular comment symbol. It must be there.

exit 0 should just be a formality, but I added it anyway.

Last edited by Markoni; 15-June-2009 at 06:28..
   
Reply With Quote
Old
  (#5)
mreo
Junior Member
 
mreo's Avatar
 
Offline
Posts: 8

Level: 1 [♥ Bé-Yêu ♥]
Life: 0 / 18
Magic: 2 / 457
Experience: 73%

Thanks: 0
Thanked 2 Times in 2 Posts
Join Date: Jun 2009
15-June-2009, 17:22

Still did not work. Here is a c/p of what I used:

Code:
#!/bin/sh

./var/bin/rq-echo-client
exit 0
Tried both with and without the leading ".". When this init file is placed in the /var/etc directory the first PLi screen comes up in b/w but hangs there.

Normally when db powers on the PLi screen first comes up in b/w for a second or two then goes black for a second or two then comes back in color. If RQcamd is installed then a second or two after the screen comes up in color a message box pops up that says RQcamd is running. It would appear that rq-echo-client must be started later in the boot up sequence.

Somebody else suggested editing the /etc/init.d/start script but I am unable to and lsattr and chattr are not available.
   
Reply With Quote
Old
  (#6)
Markoni
ECS Master
 
Markoni's Avatar
 
Offline
Posts: 499

Level: 20 [♥ Bé-Yêu ♥♥ Bé-Yêu ♥♥ Bé-Yêu ♥♥ Bé-Yêu ♥]
Life: 0 / 491
Magic: 166 / 14881
Experience: 64%

Thanks: 40
Thanked 273 Times in 133 Posts
Join Date: Aug 2007
15-June-2009, 17:38

Quote:
Originally Posted by mreo View Post
Still did not work. Here is a c/p of what I used:

Code:
#!/bin/sh

./var/bin/rq-echo-client
exit 0
Tried both with and without the leading ".". When this init file is placed in the /var/etc directory the first PLi screen comes up in b/w but hangs there.

Normally when db powers on the PLi screen first comes up in b/w for a second or two then goes black for a second or two then comes back in color. If RQcamd is installed then a second or two after the screen comes up in color a message box pops up that says RQcamd is running. It would appear that rq-echo-client must be started later in the boot up sequence.

Somebody else suggested editing the /etc/init.d/start script but I am unable to and lsattr and chattr are not available.
You could try

Code:
#!/bin/sh
cd var/bin
./rq-echo-client (or just rq-echo-client)
exit 0
I'd first remove the middle line and try to run the init script to see if having the init itself is the problem, or this to see if it can run commands:

Code:
#!/bin/sh
echo "Init works" > OK.txt
exit 0
I'm not sure why this is not working - I'll look around. You did CHMOD the init file, right?

You actually can use crontabs. You just check first whether process rq-echo-client is running before trying to start it. Running the check every half-hour or so should do what you want. Or just stop and restart rq-echo-client restart in crontabs if having it start fresh every time is not a problem, i.e. if rq-echo-client accepts a parameter like restart, root becomes:

Code:
1,31 * * * * ./var/bin/rq-echo-client restart
to restart every half hour at 1 and 31 minutes past the hour.

Last edited by Markoni; 15-June-2009 at 19:22..
   
Reply With Quote
Old
  (#7)
mreo
Junior Member
 
mreo's Avatar
 
Offline
Posts: 8

Level: 1 [♥ Bé-Yêu ♥]
Life: 0 / 18
Magic: 2 / 457
Experience: 73%

Thanks: 0
Thanked 2 Times in 2 Posts
Join Date: Jun 2009
15-June-2009, 20:45

Looks like we are on to something. This

Code:
#!/bin/sh
echo "Init works" > OK.txt
exit 0
caused the same problem. Receiver would not boot and no OK.txt file was written. And yes I did chmod it to 755.

As for the cron option don't see how that would help. My problem is frequent power failures so need it to start each time receiver boots up.

Last edited by mreo; 15-June-2009 at 20:55..
   
Reply With Quote
Old
  (#8)
Markoni
ECS Master
 
Markoni's Avatar
 
Offline
Posts: 499

Level: 20 [♥ Bé-Yêu ♥♥ Bé-Yêu ♥♥ Bé-Yêu ♥♥ Bé-Yêu ♥]
Life: 0 / 491
Magic: 166 / 14881
Experience: 64%

Thanks: 40
Thanked 273 Times in 133 Posts
Join Date: Aug 2007
16-June-2009, 00:19

Quote:
Originally Posted by mreo View Post
Looks like we are on to something. This

Code:
#!/bin/sh
echo "Init works" > OK.txt
exit 0
caused the same problem. Receiver would not boot and no OK.txt file was written. And yes I did chmod it to 755.
OK. Could we just make sure all is set as I am thinking it is?

1.) There is a file called init in /var/etc/ (not in /var/bin or some other directory that is not writeable).
2.) init has permissions set to 755.
3.) On boot, the box hangs if init is even present and looks like either of these:

Code:
#!/bin/sh
echo "Init works" > OK.txt
exit 0
Code:
#!/bin/sh
exit 0
Is all of the above correct?

If so, it should work: PLi Images website - Threads: Set Startup Channel

All I can suggest is running a log at boot to find what is going wrong.

Quote:
As for the cron option don't see how that would help. My problem is frequent power failures so need it to start each time receiver boots up.
The question is more whether it will cause you any problems if rq-echo-client is restarted while the box is running. I'm not sure what it is doing for you.

If rq-echo-client were stopped and re-started every half-hour, whether or not you had a power failure, would rq-echo-client still do what you want it to do?

If so, use a crontab:

Code:
1,31 * * * * ./var/bin/rq-echo-client restart
If rq-echo-client does not accept parameters like stop and restart,

Code:
1,31 * * * * killall -q rq-echo-client
2,32 * * * * ./var/bin/rq-echo-client
The script just gets a bit more complicated if you want or need to detect if rq-echo-client is running before killing it.

Last edited by Markoni; 16-June-2009 at 00:21..
   
Reply With Quote
Old
  (#9)
mreo
Junior Member
 
mreo's Avatar
 
Offline
Posts: 8

Level: 1 [♥ Bé-Yêu ♥]
Life: 0 / 18
Magic: 2 / 457
Experience: 73%

Thanks: 0
Thanked 2 Times in 2 Posts
Join Date: Jun 2009
16-June-2009, 01:51

Quote:
Originally Posted by Markoni View Post
OK. Could we just make sure all is set as I am thinking it is?

1.) There is a file called init in /var/etc/ (not in /var/bin or some other directory that is not writeable).
2.) init has permissions set to 755.
3.) On boot, the box hangs if init is even present and looks like either of these:

Code:
#!/bin/sh
echo "Init works" > OK.txt
exit 0
Code:
#!/bin/sh
exit 0
Is all of the above correct?
1. File called init in /var/etc/
2. permissions set to 755
3.
Code:
#!/bin/sh
exit 0
hangs on boot.

I have checked and double checked everything. I know it doesn't seem to make sense. Will try reloading PLi image and see what happens.

Last edited by mreo; 16-June-2009 at 02:30..
   
Reply With Quote
Old
  (#10)
Markoni
ECS Master
 
Markoni's Avatar
 
Offline
Posts: 499

Level: 20 [♥ Bé-Yêu ♥♥ Bé-Yêu ♥♥ Bé-Yêu ♥♥ Bé-Yêu ♥]
Life: 0 / 491
Magic: 166 / 14881
Experience: 64%

Thanks: 40
Thanked 273 Times in 133 Posts
Join Date: Aug 2007
16-June-2009, 02:47

Quote:
Originally Posted by mreo View Post
I have checked and double checked everything. I know it doesn't seem to make sense. Will try reloading PLi image and see what happens.
It probably does make sense. It's some small detail we haven't noticed.

Would you tell me which PLi image you are using?

You're not keen to use the crontabs even if it does work, are you? I'm not either. This is now something of a mission...

-----------------
Are you using a Unix editor?

Last edited by Markoni; 16-June-2009 at 02:58..
   
Reply With Quote
Reply

Bookmarks

Tags
auto, dm500?, program, start


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump



ECS on RSS ECS on Twitter ECS on Facebook ECS on Youtube
Follow us on:

Powered by vBulletin
Copyright 2002 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Dreambox