LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-15-2011, 08:14 PM   #1
xiangzhang
LQ Newbie
 
Registered: Aug 2011
Posts: 4

Rep: Reputation: Disabled
rc.local question


Hi experts,

I have a question about using rc.local.

I have a Java program that needs to be started at boot time. The Java program will create a new process and wait for that new process to complete. If I run this Java program use java command directly from command line, then it's fine. However, when I put the java command script to the rc.local file, the program does start up when the system is booted up. But when the program tries to create a new process, it fails. So I'm suspecting that if rc.local has some restrictions on the programs that will create other processes.

If not, any idea about this? Or is there other ways to do this?

Thanks!
 
Old 08-15-2011, 08:27 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,017

Rep: Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454
with out knowing any information ????
it might be a SElinux issue
or
a App-armor issue

or a simple uid issue ????
 
Old 08-15-2011, 08:37 PM   #3
xiangzhang
LQ Newbie
 
Registered: Aug 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi John. Thanks for the reply.

I'm using Amazon AMI, with kernel version 2.6.

Not sure what kind of other info do u need.

Thanks!

Quote:
Originally Posted by John VV View Post
with out knowing any information ????
it might be a SElinux issue
or
a App-armor issue

or a simple uid issue ????
 
Old 08-15-2011, 08:42 PM   #4
xiangzhang
LQ Newbie
 
Registered: Aug 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Here is the code in the Java program that starts a new process:

Process p = new ProcessBuilder("/home/ec2-user/init/sshfs-connect",
"pass", "ip", "username").start();
synchronized (p){
p.wait(SSHFS_MAXIMUM_WAIT_TIME);
}
if(p.exitValue() != 0){
//throw new Exception("Faild to SSHFS to main server");
out.write("failed to map server\n");
out.flush();
}
else{
out.write("server mapped\n");
out.flush();
}

where sshfs-connect is another script that i wrote to connect to main server using sshfs.

Thanks!

Quote:
Originally Posted by John VV View Post
with out knowing any information ????
it might be a SElinux issue
or
a App-armor issue

or a simple uid issue ????
 
Old 08-15-2011, 09:06 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,017

Rep: Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454Reputation: 2454
what are the file permissions ?
dose the owner of this script have the authority to run a script that requires root access
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
rc.local file question alirezan1 Linux - Newbie 11 01-26-2009 02:19 PM
rc.local question harkonen Slackware 10 07-12-2007 11:55 AM
Small question about /etc/rc.local - Symbolic link question Arodef Linux - General 4 05-13-2006 02:29 AM
Question about my Local Network, HELP PLEASE TiMo Linux - Networking 8 08-11-2003 07:42 AM
rc.local question BoldKiller Linux - General 1 12-11-2002 08:53 PM


All times are GMT -5. The time now is 08:16 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration