LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 05-28-2012, 12:14 AM   #1
peacemission
LQ Newbie
 
Registered: May 2012
Location: india
Distribution: Ubuntu 11.10
Posts: 11

Rep: Reputation: Disabled
How to make my app automatically run on startup (Leopard Board Ti DM 368 )


Problem is regarding leopard board (tms320 dm368 processor).
(Please ignore if i sound weird at some places as i am a complete newbieee in Leopard Board/LINUX )

I have a leopard board (tms320 dm368 processor)and
i want to run an app, automatically after boot up instead of manually typing the command in terminal.
So, I created the script file (named vcc_app) as follows
Code:
#!bin/sh
echo "My app is here"
/helloworld # The application
1 .after creating the script file i copied it in init.d
2. I gave the command
Code:
chmod +x /etc/init.d/vcc_app
(vcc_app is the name of script which I have created)
3. Then I gave the command
Code:
ln -s /etc/init.d/vcc_app /etc/rc.d/vcc_app
(rc.d is the run level directory i guess...b/c there is no rc1.d or rc2.d etc...not even rc.local)

Now, when i reboot the board nothing happens (Some times it says vcc_app not found..). Is there anything wrong .
Please help me out !

Many Thanks !

Last edited by peacemission; 05-28-2012 at 12:16 AM.
 
Old 05-28-2012, 12:32 AM   #2
Slackyman
Member
 
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347

Rep: Reputation: 44
Which distro is running on your leopardboard?
 
Old 05-28-2012, 12:38 AM   #3
otoomet
Member
 
Registered: Oct 2004
Location: Tartu, Århus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619

Rep: Reputation: 45
Does your program work correctly if started from the command line (/etc/init.d/vc_app)? Does it start the board?

In general, it is not recommended to put your own code in /etc/init.d. Rather, make a startup script into a standard executable directory (like /usr/local/bin or $HOME/bin) and add the corresponding line into /etc/rc.local (although it may depend on the distro).
 
Old 05-28-2012, 12:55 AM   #4
Slackyman
Member
 
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347

Rep: Reputation: 44
If you want to start your program by the init system in the way you're planning you have to make sure:
- it can run from /bin/sh
- it does NOT require any lib or program not yet started (e.g. programs running on other runlevels)
- it refers to full paths (not relative)
 
Old 05-28-2012, 01:25 AM   #5
peacemission
LQ Newbie
 
Registered: May 2012
Location: india
Distribution: Ubuntu 11.10
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Slackyman View Post
Which distro is running on your leopardboard?
Its not a distro, i just have a bootloader(uboot,kernel and rootfs.(i am successfully booting it from SD card)
Just for more info:
There are no runlevel dirs like rc1.d or rc2.d etc. rc.local is also not present.All i have is rc.d
 
Old 05-28-2012, 01:27 AM   #6
peacemission
LQ Newbie
 
Registered: May 2012
Location: india
Distribution: Ubuntu 11.10
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Slackyman View Post
If you want to start your program by the init system in the way you're planning you have to make sure:
- it can run from /bin/sh
- it does NOT require any lib or program not yet started (e.g. programs running on other runlevels)
- it refers to full paths (not relative)
Yeah thats correct, but my app just prints "hello world"
When em running it manually from terminal it works fine.
 
Old 05-28-2012, 01:32 AM   #7
peacemission
LQ Newbie
 
Registered: May 2012
Location: india
Distribution: Ubuntu 11.10
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by otoomet View Post
Does your program work correctly if started from the command line (/etc/init.d/vc_app)? Does it start the board?

In general, it is not recommended to put your own code in /etc/init.d. Rather, make a startup script into a standard executable directory (like /usr/local/bin or $HOME/bin) and add the corresponding line into /etc/rc.local (although it may depend on the distro).
1. Yes, when i run the app manually from the terminal, it works fine (my app just prints "hello world" )
2. There are neither runlevel dirs like rc1.d, rc2.d etc nor rc.local. i only have rc.d

Just for more info:
Its not a distro, i just have a bootloader(uboot,kernel and rootfs.(i am successfully booting it from SD card)
 
Old 05-28-2012, 01:54 AM   #8
Slackyman
Member
 
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347

Rep: Reputation: 44
Not all the scripts in rc.d and init.d are started just because they have tha run flag set!
What's inside your /etc/rc.d and /etc/init.d folders?

Last edited by Slackyman; 05-28-2012 at 01:56 AM.
 
Old 05-28-2012, 04:49 AM   #9
peacemission
LQ Newbie
 
Registered: May 2012
Location: india
Distribution: Ubuntu 11.10
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Slackyman View Post
Not all the scripts in rc.d and init.d are started just because they have tha run flag set!
What's inside your /etc/rc.d and /etc/init.d folders?
Here is the details of my init.d and rc.d
init.d
Code:
-rwxr-xr-x 1 xyz xyz 3248 2012-05-22 15:18 coprocessors 
-rwxrwxr-x 1 xyz xyz  100 2011-07-15 21:04 hostname 
-rwxrwxr-x 1 xyz xyz  230 2011-07-15 21:04 mdev 
-rwxrwxr-x 1 xyz xyz   85 2011-07-15 21:04 motd 
-rwxrwxr-x 1 xyz xyz  476 2011-07-15 21:04 mountall 
-rwxrwxr-x 1 xyz xyz  155 2011-07-15 21:04 mountdevpts 
-rwxrwxr-x 1 xyz xyz  834 2011-07-15 21:04 network 
-rwxrwxr-x 1 xyz xyz  129 2011-07-15 21:04 psplash 
-rwxrwxr-x 1 xyz xyz   34 2011-07-15 21:04 startlabel 
-rwxrwxr-x 1 xyz xyz  130 2011-07-15 21:04 sysctl 
-rwxrwxr-x 1 xyz xyz   43 2011-07-15 21:04 syslogd
rc.d
Code:
lrwxrwxrwx 1 xyz xyz 18 2012-05-22 12:31 S00mountall -> ../init.d/mountall 
lrwxrwxrwx 1 xyz xyz 17 2012-05-22 12:31 S00psplash -> ../init.d/psplash 
lrwxrwxrwx 1 xyz xyz 20 2012-05-22 12:31 S01startlabel -> ../init.d/startlabel 
lrwxrwxrwx 1 xyz xyz 14 2012-05-22 12:31 S02mdev -> ../init.d/mdev 
lrwxrwxrwx 1 xyz xyz 18 2012-05-22 12:31 S03hostname -> ../init.d/hostname 
lrwxrwxrwx 1 xyz xyz 21 2012-05-22 12:31 S10mountdevpts -> ../init.d/mountdevpts 
lrwxrwxrwx 1 xyz xyz 17 2012-05-22 12:31 S10syslogd -> ../init.d/syslogd 
lrwxrwxrwx 1 xyz xyz 16 2012-05-22 12:31 S15sysctl -> ../init.d/sysctl 
lrwxrwxrwx 1 xyz xyz 14 2012-05-22 12:31 S20motd -> ../init.d/motd 
lrwxrwxrwx 1 xyz xyz 17 2012-05-22 12:31 S30network -> ../init.d/network 
lrwxrwxrwx 1 xyz xyz 22 2012-05-22 12:31 S90coprocessors -> ../init.d/coprocessors
 
Old 05-28-2012, 09:14 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
In a nutshell, if you look at the rc.d directory the S means start. Processes are started in order i.e S00xxx - S99xxx. Creating the link /etc/rc.d/S99your_app should run your hello world program automatically.
 
Old 05-29-2012, 01:44 AM   #11
peacemission
LQ Newbie
 
Registered: May 2012
Location: india
Distribution: Ubuntu 11.10
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
In a nutshell, if you look at the rc.d directory the S means start. Processes are started in order i.e S00xxx - S99xxx. Creating the link /etc/rc.d/S99your_app should run your hello world program automatically.
Its working..
Thanks!
 
  


Reply

Tags
booting, embedded, linux, shell script, startup



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to auto run app on startup? babag Mandriva 2 05-08-2008 11:40 PM
Run program a startup automatically shambler SUSE / openSUSE 2 09-13-2006 10:50 AM
Automatically run scripts on startup? Phaethar Fedora 10 09-24-2004 02:35 AM
How can I run a command automatically at startup? luwigie Linux - General 8 08-26-2004 09:05 PM
RH 8.0, run app on startup? rivethead Linux - Software 1 02-04-2003 01:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 10:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration