1. Subscriptions
  2. Services
  3. Hardware
  4. Support

ClearFoundation

Forums
Welcome, Guest
Making a scirpt run in startup
(1 viewing) 1 Guest
Go to bottomPage: 1
TOPIC: Making a scirpt run in startup
#24075
Making a scirpt run in startup 1 Year, 3 Months ago  
Hi all,

I've been tinkering with tvheadend and CCcam ( a software cam emulator and server for DVB-S ). I have this working now but have one problem. To use the CCcam server i have to run a .sh script (see below).

Cccam.sh
Code:


!/bin/bash

case "$1" in
  start)
        touch /root/CCcam/CCcam.log && chmod 777 /root/CCcam/CCcam.log
        LD_PRELOAD=/root/CCcam/capmt_ca.so /root/CCcam/CCcam -d -C /root/CCcam/$
        ;;
  stop)
        killall -9 CCcam
       esac
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop}" >&2
        exit 3
        ;;
esac



This script is located in /root/CCcam/Cccam.sh

To start is i run:
Code:


~/CCcam/CCcam.sh start



The cardserver starts and i can see my scrabled channels. The problem is, when i close my terminal window, the cardserver stops. I've added some rules to /etc/rc.local (see below)
Code:


!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
~/CCcam/CCcam.sh start &
#/root/CCcam/CCcam.sh start &
before
exit 0



I've treid to start the script from root and ~/ but no succes, it doesnt starts I've also treid to put the script in /etc/init.d and renamed CCcam.sh to CCcam and chmodded it to 775, no succes. What can i do to run the script at startup/boot ?

Greetz

Barry
mrrepel
Junior Boarder
Posts: 22
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2011/02/05 07:39 By mrrepel.
The administrator has disabled public write access.
 
#24085
Re:Making a scirpt run in startup 1 Year, 3 Months ago  
Found a solutions, a nice site that discribes the /etc/rc.local and /etc/init.d functions is found here www.ghacks.net/2009/04/04/get-to-know-li...-etcinitd-directory/

I've added /etc/init.d/CCcam to /etc/rc.local and at boot it works

Learning by the day
mrrepel
Junior Boarder
Posts: 22
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2011/02/05 17:36 By mrrepel.
The administrator has disabled public write access.
 
Go to topPage: 1
  get the latest posts directly to your desktop