Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling a script from rc.local 2

Status
Not open for further replies.

gt6350a

Programmer
Feb 10, 2003
68
US
I want to start a program called abc when my OS boots up (KDE-Linux). I want to do this by putting a script in rc.local. How should I type in the script inorder to start the program?

I thought it might be:

./directory1/directroy2/abc

but that did not work.

Thanks!
 
is the abc file inside of the same directory as rc.local??
if it isn't, then that's probably why. Your example above is ./directory1/directroy2/abc
remove the . and try again.

JUST FYI....

The following is used usually to startup scripts and/or services at boot...
in the directory /etc/inid.d/rc5.d

creat a link to your program...
cd /etc/init.d/rc5.d
ln -s S19abc /home/myuserID/abc

take note of the link name. The capital S followed by a number is important. The S means "start" and the number can be whatever number you want. Do an ls -l in /etc/init.d/rc5.d and you'll see what I mean. When Linux starts up in runlevel 5 (I'm assuming it is because you wanted to have it start in KDE), all of the files(links) in this directory will be executed in order starting from S1filename then S2filename, S3filename, etc, etc...

So have your program "start" toward the end. Maybe like S19abc or S20abc

HOpe this helps
 
I have a binary file called 'abc'.

Problem #1: When I followed your advice and put the binary file in the same directory that the binary file 'rc.local' exists in and then inserted one line in 'rc.local' which was './abc' and also '/abc', for good measure, it still did not work.

Problem #2: I then tried another method. I followed your FYI advice and typed in 'ln -s S19abc /home/myuserID/abc' however when I checked my 'rc5.d' directory, there is dot exist a file in it named 'S19abc'.

I really appreciate you past help, perhaps I am just overlooking something. If so or if not, please.....

Help! :0)


 
I think PavNell was trying to say
ln -s /home/myuserID/abc S19abc

The syntax for ln is
ln [OPTIONS] [SOURCE] [LINKNAME]

- V.
 
When I did your suggestions it created the S19abc file but now when I reboot it fails to start. The error message says, "unexpected use of the arguments "START" use help to get a list of available command line arguments."

I dont't know how to use 'help', is this the same as the man pages? Any more ideas to help troubleshoot this?

By the way the directory i am saving the abc file in is root/dir1/dir2

so it is: root/dir1/dir2/abc

Thank you!
 
Thank you first of all.

When I did your suggestions it created the S19abc file but now when I reboot it fails to start. The error message says, "unexpected use of the arguments "START" use help to get a list of available command line arguments."

I dont't know how to use 'help', is this the same as the man pages? Any more ideas to help troubleshoot this?

By the way the directory i am saving the abc file in is root/dir1/dir2

so it is: root/dir1/dir2/abc

Thank you!
 
I got it! I had to change the permission settings. You both were great!

Thank you!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top