Hi,
 
The answer to this depends on what form your application & system takes. Does 
the application require user input/output, does the final system have a 
console, is there a GUI etc.....
 
The simple method (where you need console I/O and do not need the board to do 
anything else but run the application) is to bypass the login and automatically 
start the app. You can do this by changing the getty line parameters to add -n 
(no user prompt) and -l app_name to run 'app_name' instead of /bin/login. No 
idea if this will work as I have never tried it but I have used a similar 
option in 'mingetty' that Fedora uses to auto login to a user & then have a 
custom .bashrc to start the required app.
 
The second approach (no console on final system) is to run your application as 
a service (or daemon) program. To do this your application needs to be changed 
so it can run as a daemon... typically this means adding a command line option 
and then an extra function within the app to do the required thing. You should 
be able to find what is needed by searching the list - I have previously posted 
a suitable function to the list that is working for me. Once the application 
supports daemonisation, you can then add a start script - use one of the 
scripts pointed to by links in /etc/rc.d/rc3.d as guidance. Note that the 
script actually lives in /etc/init.d and needs to be able to take 
'start|stop|restart'  as a parameter.
 
Regards
 
Phil Q
 
Phil Quiney, Senior Software Engineer
Trinity Convergence
Cambridge Business Park
Cowley Road
Cambridge CB4 0WZ, UK
T: +44(0)1223-435536
F: +44(0)1223-435560
www.trinityconvergence.com <http://www.trinityconvergence.com/> 

 

________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Deepak 
Shankar-TLS,Chennai.
Sent: 06 October 2008 17:25
To: davinci-linux-open-source@linux.davincidsp.com
Subject: RE: Automatic Process spawning before login in dm355 with ramdisk


Could someone please suggest me a best way to start a process in Linux instead 
of landing in the automatic login prompt?

________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Deepak 
Shankar-TLS,Chennai.
Sent: Thursday, October 02, 2008 7:57 PM
To: davinci-linux-open-source@linux.davincidsp.com
Subject: Automatic Process spawning before login in dm355 with ramdisk


Hi,
 
I've created a ramdisk for the applications that I created in the NFS mounts.
As long as I have a terminal,  I can login and execute the program.
 
However, I'm trying to start the processes automatically from something like a 
startup script.
example: running encodedecode demo automatically as the system starts up. 
 
The problem is its working well in the NFS mounts. But does not work in the 
ramdisk.
the cnmemory pools are not loadable at this stage.
 
Could someone please tell me what am I missing.
 
Please suggest on any other alternative methods to invoke scripts automatically 
before logging in.
 
This is how the /etc/init.d/rcS appears in my rootfs - (Last 2 lines added by 
me)
#############################################################################################3
#! /bin/sh
#
# rcS  Call all S??* scripts in /etc/rcS.d in
#  numerical/alphabetical order.
#
# Version: @(#)/etc/init.d/rcS  2.76  19-Apr-1999  miquels_at_cistron_dot_nl 
<mailto:[EMAIL PROTECTED]> 
#
 
PATH=/sbin:/bin:/usr/sbin:/usr/bin
runlevel=S
prevlevel=N
umask 022
export PATH runlevel prevlevel
 
#
# See if system needs to be setup. This is ONLY meant to
# be used for the initial setup after a fresh installation!
#
if [ -x /sbin/unconfigured.sh ]
then
  /sbin/unconfigured.sh
fi
 
#
# Source defaults.
#
. /etc/default/rcS
export VERBOSE
 
#
# Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
#
trap ":" INT QUIT TSTP
 
#
# Call all parts in order.
#
for i in /etc/rc.d/rcS.d/S??*
do
 # Ignore dangling symlinks for now.
 [ ! -f "$i" ] && continue
 
 case "$i" in
  *.sh)
   # Source shell script for speed.
   (
    trap - INT QUIT TSTP
    set start
    . $i
   )
   ;;
  *)
   # No sh extension, so fork subprocess.
   $i start
   ;;
 esac
done
 
#      Run /etc/rc.d/rc.local if it exists
[ -x /etc/rc.d/rc.local ] && /etc/rc.d/rc.local
 
#
# Finish setup if needed. The comment above about
# /sbin/unconfigured.sh applies here as well!
#
if [ -x /sbin/setup.sh ]
then
  /sbin/setup.sh
fi
/opt/dvsdk/dm355/loadmodules.sh
/opt/dvsdk/dm355/encodedecode -p&
#############################################################################################3
Cheers,
Deepak
DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in 
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of 
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have 
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and 
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------
        
_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to