Koozali.org: home of the SME Server

Add start program

thefff-fr

Add start program
« 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.

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
Re: Add start program
« Reply #1 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
............

thefff-fr

Add start program
« Reply #2 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  ;-)

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
Add start program
« Reply #3 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.
............

thefff-fr

Add start program
« Reply #4 on: January 07, 2006, 06:20:56 PM »
Hello,

I can't find anything that help me.

Can somebody here can help me ?

Offline byte

  • *
  • 2,183
  • +2/-0
Add start program
« Reply #5 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 &
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

thefff-fr

Add start program
« Reply #6 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.

Offline byte

  • *
  • 2,183
  • +2/-0
Add start program
« Reply #7 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
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline smeghead

  • *
  • 563
  • +0/-0
Add start program
« Reply #8 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
..................

thefff-fr

Add start program
« Reply #9 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

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
Add start program
« Reply #10 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.
............

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
Add start program
« Reply #11 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
............