New IT forum
12 August 2022, 03:13:32 pm *
Welcome, %1$s. Please login or register.

: CubieBoard 2 and Cubietruck both now in stock.
 
Pages: [1]

Author Topic: Creating a daemon  (Read 3203 times)

erich

  • Newbie
  • *
  • Posts: 17
Creating a daemon
« on: 12 March 2012, 05:12:30 pm »

I want to  run a shell script every time the Dreamplug starts. The script nohups some python code. If I run the script manually the python code runs as background process perfectly. I linked the shell script to /etc/init.d directory and made it executable. Then linked that link to /etc/rc2.d directory S04...sh and made it executable. As far as I can tell it does not try to start my script. Please can someone give me some pointers?
Logged

Confusticated

  • New IT customer
  • Hero Member
  • *
  • Posts: 663
Re: Creating a daemon
« Reply #1 on: 12 March 2012, 05:22:25 pm »

Call your script from /etc/rc.local

EDIT: or if your script is a one-liner just insert the contents
Be sure to end the line with a '&' (backgrounds the process which prevents the boot procedure from hanging when something goes wrong).
« Last Edit: 12 March 2012, 05:27:15 pm by Confusticated »
Logged
Advocatus Diaboli - My agenda is not to give you the answer, but to guide your thoughts so you derive it for yourself!

erich

  • Newbie
  • *
  • Posts: 17
Re: Creating a daemon
« Reply #2 on: 13 March 2012, 02:28:07 pm »

Thanks that got things moving  - then  discovered a couple of school boy errors in the script paths
Logged
Pages: [1]
 
 

Powered by MySQL Powered by PHP SMF 2.0.10 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!