Sending spplication to background

C

ctippur

All,

The application (Running on Unix or Linux) that we are trying to
develop has the following requirements:
1. We need to prompt for password at the start of the java application.
The application is started via a shell script. The password should be
masked.
- We did figure out a way to do this using Java.
2. After entering the password, the application should be sent to
background.
- This is where we are having problems. How do we send the process
to background so that the user gets back the shell prompt after he
enters the password.

I would really appreciate any help.

Thanks,
Shekar Tippur
 
G

Gordon Beaton

2. After entering the password, the application should be sent to
background.
- This is where we are having problems. How do we send the process
to background so that the user gets back the shell prompt after he
enters the password.

First, stop multiposting. Choose one relevant group for your question.
Followup set to c.l.j.help.

There are essentially two ways to do put a process in the background:

- use the job control features of your shell.

- invoke fork() from within the process, have the parent process
exit and the child process detach from the terminal.

Unfortunately for you, neither of these mechanisms are particularly
useful from a Java program.

Perhaps you need to structure your application differently. Here's an
idea: start the main application in the background from your shell
script. Also from the script, start a second program to get the
password, and pass the password (for example, through a socket) to the
background process.

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top