Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: thefff-fr on December 30, 2005, 09:06:04 PM

Title: Add start program
Post by: thefff-fr on December 30, 2005, 09:06:04 PM
Hi,

I would like to run "  ./boinc "  locate in " /home/boinc/BOINC/ " at the start of SME 7.

Is there a way ?

Thanks.
Title: Re: Add start program
Post by: gordonr on January 02, 2006, 10:53:15 AM
Quote from: "thefff-fr"
Hi,

I would like to run "  ./boinc "  locate in " /home/boinc/BOINC/ " at the start of SME 7.

Is there a way ?

Thanks.


Two easy ways:
- Add a startup script to /etc/rc7.d
- Add a script in /etc/e-smith/events/local
Title: Add start program
Post by: thefff-fr on January 02, 2006, 01:39:19 PM
Hi,

I made a script that i name "binstall.sh" like this :

#!/bin/sh
/root/BOINC/run_client

I put him in /etc/e-smith/events/local

He start ok, but, in the server, the boot stop when i lunch it, and the server does go to the consol.

I can accet to it whith Putty with another PC but, no console ins the server.

What's wrong with my script ? Can you help me ?

Thanks for the links etc/e-smith/events/local  ;-)
Title: Add start program
Post by: gordonr on January 02, 2006, 11:37:55 PM
Quote from: "thefff-fr"

What's wrong with my script ? Can you help me ?

Thanks for the links etc/e-smith/events/local  ;-)

Your startup script will need to be careful to background itself and disassociate itself from the console. Do some googling to find out how.
Title: Add start program
Post by: thefff-fr on January 07, 2006, 06:20:56 PM
Hello,

I can't find anything that help me.

Can somebody here can help me ?
Title: Add start program
Post by: byte on January 07, 2006, 08:24:00 PM
Quote from: "thefff-fr"
Hi,

I made a script that i name "binstall.sh" like this :

#!/bin/sh
/root/BOINC/run_client

I put him in /etc/e-smith/events/local

He start ok, but, in the server, the boot stop when i lunch it, and the server does go to the consol.

I can accet to it whith Putty with another PC but, no console ins the server.

What's wrong with my script ? Can you help me ?

Thanks for the links etc/e-smith/events/local  ;-)


try adding & to end of line so looks like this...

#!/bin/sh
/root/BOINC/run_client &
Title: Add start program
Post by: thefff-fr on January 07, 2006, 10:01:41 PM
Thanks for the answer.

But it doesn' t works.


The server boot up, launche the script, and stop booting, no acces to console. Stay in screen with differnet module on boot.
Title: Add start program
Post by: byte on January 07, 2006, 11:25:00 PM
How bout this way then?!

Code: [Select]
exec /usr/local/bin/svc -o /root/BOINC/run_client
Title: Add start program
Post by: smeghead on January 08, 2006, 04:02:15 AM
.. or perhaps:

unset DISPLAY
nohup nice /root/BOINC/run_client &

Breakdown:

unset DISPLAY - don't display output to a window (tty)
nohup (nohangup) - ensures process doesn't get killed when user logs off
nice - allows prog to use 100% CPU when its not needed by any other process
& - forces program to run in the background returning control to the forground process (the shell) immediately

HTH
Title: Add start program
Post by: thefff-fr on January 08, 2006, 12:44:20 PM
Sorry, but nothing do it.

So, i launch nice /root/BOINC/run_client &  at the boot, directly on the serveur. Not serius. I reboot the server 1 time per month, so..............

Thanks for the help.

Maybe i do something wrong.

If someone wont to do a HOW TO for a noob like me, i take it
Title: Add start program
Post by: gordonr on January 08, 2006, 11:45:45 PM
Quote from: "thefff-fr"

If someone wont to do a HOW TO for a noob like me, i take it

The issue is what the 'BOINC' program does and how it interacts with the terminal. Ensuring that it properly disassociates itself from the running terminal (often also called daemonizing) is not a newbie question. If you get it wrong, the machine wil lhang on startup, as you have found.

Usually a nohup with a redirect of stdout, stdin and stderr will do it. But not always.
Title: Add start program
Post by: gordonr on January 08, 2006, 11:48:21 PM
Quote from: "byte"
How bout this way then?!

Code: [Select]
exec /usr/local/bin/svc -o /root/BOINC/run_client


The program would need to be configured as a supervised service for that to work:

http://cr.yp.to/daemontools/svc.html