start my application

sherry 2010-06-01 12:54:55 Link
Dear All,

  I want to boot my application (Example yy2) automatically once the power
is switched on without any user interface or without logging.

Jon Ambrose 2010-06-01 14:28:09 Link
During bootup it would be /etc/rc.local or a startup 
script in /etc/init.d with links in the /etc/rc.d/rcX.d directories 
and only run during boot up or runlevel changes.

sherry 2010-06-02 07:46:21 Link
Thanks Jon 

can you please elaborate the procedure above u said with an example....


it will be great support if u help me.

Jon Ambrose 2010-06-02 10:56:54 Link
I will have alook tonight when I have my board in front of me.

What I said above was generic for Linux machines. It may be that its
slightly different on the Mini2440.

sherry 2010-06-03 07:01:25 Link
Actually I tried to put my application in rc.local file and rebooted the 
board it booted normally but my application did not pop up???


I want to try by putting script file in /etc/init.d and link with 
/etc/rc2.d  but I am confused what should be written in script file...

please any one has ready script it will be great help to me.

davef 2010-06-03 07:54:10 Link
Have you got an & at the end of the command line?

Look in the factory distro /etc/init.d/rcS for an example and the last line
when it boots up Qtopia.

sherry 2010-06-03 09:01:31 Link
thanks davef,

 yes but where exactly I should do modification can please give any ready 
available script.

 one thing where should  I copy my a.out file in target(mini2440) board
I mean i did it in /home

sherry 2010-06-03 09:15:49 Link
Dear Devef,


suppose I have following appache.sh file in /etc/init.d


now I want to modify this script file for my application for example yy

please will you tell me how to and where to modify in this file


#!/bin/bash
#
# apache-ssl    Start the apache-ssl HTTP
#
# The variables below are NOT to be changnetd
# script more readable.
                                         ll
NAME=apache-ssl
DAEMON=/usr/sbin/$NAME
PIDFILE=/var/run/$NAME.pid               --exec $DAEMON > /dev/null
CONF=/etc/$NAME/httpd.conf
APACHECTL=/usr/sbin/${NAME}ctl
# note: SSD is required only at startup o
SSD=`which start-stop-daemon`
ENV="env -i LANG=C PATH=/bin:/usr/bin:/us
                                         dfile $PIDFILE --signal HUP; then
trap "" 1                                ILE --exec $DAEMON > /dev/null

# Check that we're not being started by i
if egrep -q -i "^[[:space:]]*ServerType[[
then
    exit 0                              
|stop|reload|reload-modules|force-reloa
fi

est_config() {
    if [ ! -x $APACHECTL ]; then
        echo "$APACHECTL is not executable, exiting"
        exit 0
    fi

    # ensure we don't leak environment vars into apachectl
    APACHECTL="$ENV $APACHECTL"

    if ! $APACHECTL configtest 2> /dev/null
    then
        printf "Configuration syntax error detected. Not reloading.\n\n"
        $APACHECTL configtest
        exit 1
    fi
}

should_start() {
    if [ ! -x $DAEMON ]; then
        echo "apache-ssl is not executable, not starting"
        exit 0
    fi

case "$1" in
  start)
    should_start
    test_config
    echo -n "Starting web server: $NAME"
    $ENV $SSD --start --pidfile $PIDFILE --exec $DAEMON > /dev/null
    ;;

  stop)
    echo -n "Stopping web server: $NAME"
    start-stop-daemon --stop --pidfile $PIDFILE --oknodo
    rm -rf /var/lib/apache/mod-bandwidth/link/*
    ;;

  reload | force-reload)
    test_config
    echo -n "Reloading $NAME configuration"
    start-stop-daemon --stop --pidfile $PIDFILE --signal USR1
    ;;

  reload-modules)
    test_config

   echo -n "Reloading $NAME modules"    IDFILE --oknodo --retry 30
    start-stop-daemon --stop --pidfile $P
    should_start                         --exec $DAEMON > /dev/null
    $ENV $SSD --start --pidfile $PIDFILE
    ;;

  restart)
    test_config
    echo -n "Restarting $NAME"           dfile $PIDFILE --signal HUP; then
    if ! start-stop-daemon -q --stop --piILE --exec $DAEMON > /dev/null
        $ENV $SSD --start --pidfile $PIDF
    fi
    ;;

  *)
    echo "Usage: /etc/init.d/$NAME
{start|stop|reload|reload-modules|force-reloa
d|restart}"
    exit 1
    ;;
esac

if [ $? -eq 0 ]; then
        echo .

        exit 0
else
        echo " failed"
        exit 1
fi

davef 2010-06-03 10:37:22 Link
Sorry, but you quickly exceeded my knowledge limits!

To start Qtopia on the factory distro:

/bin/Qtopia &

Someone will have to help.

Good luck!

sherry 2010-06-04 13:21:48 Link
Hey I got it...

my application in booting once power is switched on

Jon Ambrose 2010-06-04 15:08:18 Link
Nice!

Sorry I didn't have time to look into it.

What was the solution?

david 2010-08-30 18:43:27 Link
hi, i have the same problem, how did you make it??

Tom 2010-08-30 19:09:16 Link
You must add starting script to rcS. In script You must export all needed
environment variables and then run application.

best regards
Tom

david 2010-09-10 16:40:42 Link
hi Tom i tried what you told me, on file rcS i put this line:

/home/cherokee/sbin/./cherokee with this my webserver started automatic,
but my system couldnt start. i saw the system's proccess by my host compute
(by hyperterminal) and it seems that it started cherokee, but it didnt
continue with the others proccess.

what could i did wrong? 

i hope you can helpme, thanks alot !!

david 2010-09-10 18:58:54 Link
excuseme this was the exactly command line i used:

/home/cherokee/sbin/cherokee start

david 2010-09-13 15:30:27 Link
thanks to davef the solution was:

/home/cherokee/sbin/cherokee start &

Reply

Name
eMail (not visible)
Subject (no text only in upper case; no HELP, URGENT...)
Text
HTML tags are not supported and links are generated automatically if they start with http or ftp.
Please submit long source code or log files as attachment (only registered users).
Please enter the number 6661