08-19-2008
Hi,I am also having problems in background processes for my shell...
how do i set the control terminal of my bg process?do i need to use the signals SIGTTIN and SIGTTOU?
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
How do you capture the return code from a background process?
I am dumping data to a fifo and then processing it in a c program.
I need to know that the sql finished successfully to ensure no missing data. Thanks.
ex.
sqlplus user/password < get_data.sql > data_fifo.txt &
bin/process_data... (2 Replies)
Discussion started by: korndog
2 Replies
2. Shell Programming and Scripting
hi there,
here's what i need in my korn-shell:
... begin korn-shell script
... nohup process_A.ksh ; nohup process_B.ksh &
... "other stuff"
... end lorn-shell script
in plain english i want process A and process B to run in the background so that the script can continue doing... (6 Replies)
Discussion started by: jacob_gs
6 Replies
3. Programming
Hey guys,
I am writing a very simple dummy shell in C++ and I am having trouble getting a process to run in the background. First of all, the shell has to recognize when I input a "&" at the end of the command, then it has to stick it in the background of the shell.
I understand that if I want... (6 Replies)
Discussion started by: icer
6 Replies
4. SuSE
I have installed oracle 10g on suse sles9. I do not see oracle background processes.
ps -ef|grep ora_ gives me environment variables junk.
ps -ef|grep smon does not show anything however database is up and running.
Any idea how to tweak that? (1 Reply)
Discussion started by: vijayasawant
1 Replies
5. Shell Programming and Scripting
I've got a bit of code I'm trying to work on...
What i want to happen is ... at all times have four parallel mysql dump and imports running.
I found the follow code snippet on the forum and modified it to work
by starting four concurrent processes but it waits until all four are done before... (7 Replies)
Discussion started by: dgob123
7 Replies
6. UNIX for Dummies Questions & Answers
Hi,
Inorder to improve the performance, I am trying to execute my command as a background process..
For eg: To zip large numbers of files present in a directory instead of using a single process, i do follow the below method:
gunzip -c > / &... (3 Replies)
Discussion started by: unni.raj
3 Replies
7. Solaris
Hi,
I need to establish a procedure that will start an application in background each time my remote Solaris server is (re)started. This would be a kind of daemon. I am no sysadmin expert, so I am looking for pointers.
How should I proceed? What are the main steps?
Thanks,
JVerstry (9 Replies)
Discussion started by: JVerstry
9 Replies
8. Shell Programming and Scripting
Ok guys so I have my first dummy shell almost done except for one tiny part: I do not know how to run a process in the background, from the code!
I already know how to do that in a normal shell:
$ program &
However, no clue when it comes to how to program that thing. :eek:
A very... (2 Replies)
Discussion started by: Across
2 Replies
9. Shell Programming and Scripting
Hi,
I have a schell script parent.ksh from which I am calling three background processes a.ksh,b.ksh and c.ksh. Once these three processes completes the next step in parent.ksh should execute. How to achieve this?
Please help me....
Thanks... (1 Reply)
Discussion started by: ravinunna
1 Replies
10. UNIX for Advanced & Expert Users
How do I list the process in a Unix based system which are running in background?
The following are options that I'm aware of, but they may not be appropiate.
a. using ps -ef , and getting records of processes for which STATUS='S'(uninterruptible sleep)
b. using jobs -l, and filtering... (5 Replies)
Discussion started by: kumarjt
5 Replies
LEARN ABOUT OSX
readpassphrase
READPASSPHRASE(3) BSD Library Functions Manual READPASSPHRASE(3)
NAME
readpassphrase -- get a passphrase from the user
SYNOPSIS
#include <readpassphrase.h>
char *
readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags);
DESCRIPTION
The readpassphrase() function displays a prompt to, and reads in a passphrase from, /dev/tty. If this file is inaccessible and the
RPP_REQUIRE_TTY flag is not set, readpassphrase() displays the prompt on the standard error output and reads from the standard input. In
this case it is generally not possible to turn off echo.
Up to bufsiz - 1 characters (one is for the NUL) are read into the provided buffer buf. Any additional characters and the terminating new-
line (or return) character are discarded.
The readpassphrase() function takes the following optional flags:
RPP_ECHO_OFF turn off echo (default behavior)
RPP_ECHO_ON leave echo on
RPP_REQUIRE_TTY fail if there is no tty
RPP_FORCELOWER force input to lower case
RPP_FORCEUPPER force input to upper case
RPP_SEVENBIT strip the high bit from input
The calling process should zero the passphrase as soon as possible to avoid leaving the cleartext passphrase visible in the process's address
space.
RETURN VALUES
Upon successful completion, readpassphrase() returns a pointer to the null-terminated passphrase. If an error is encountered, the terminal
state is restored and a NULL pointer is returned.
FILES
/dev/tty
EXAMPLES
The following code fragment will read a passphrase from /dev/tty into the buffer passbuf.
char passbuf[1024];
...
if (readpassphrase("Response: ", passbuf, sizeof(passbuf),
RPP_REQUIRE_TTY) == NULL)
errx(1, "unable to read passphrase");
if (compare(transform(passbuf), epass) != 0)
errx(1, "bad passphrase");
...
memset(passbuf, 0, sizeof(passbuf));
SIGNALS
The readpassphrase() function will catch the following signals:
SIGINT
SIGHUP
SIGQUIT
SIGTERM
SIGTSTP
SIGTTIN
SIGTTOU
When one of the above signals is intercepted, terminal echo will be restored if it had previously been turned off. If a signal handler was
installed for the signal when readpassphrase() was called that handler is then executed. If no handler was previously installed for the sig-
nal then the default action is taken as per sigaction(2).
The SIGTSTP, SIGTTIN, and SIGTTOU signals (stop signal generated from keyboard or due to terminal I/O from a background process) are treated
specially. When the process is resumed after it has been stopped, readpassphrase() will reprint the prompt and the user may then enter a
passphrase.
ERRORS
[EINTR] The readpassphrase() function was interrupted by a signal.
[EINVAL] The bufsiz argument was zero.
[EIO] The process is a member of a background process attempting to read from its controlling terminal, the process is ignoring
or blocking the SIGTTIN signal or the process group is orphaned.
[EMFILE] The process has already reached its limit for open file descriptors.
[ENFILE] The system file table is full.
[ENOTTY] There is no controlling terminal and the RPP_REQUIRE_TTY flag was specified.
SEE ALSO
sigaction(2), getpass(3)
STANDARDS
The readpassphrase() function is an extension and should not be used if portability is desired.
HISTORY
The readpassphrase() function first appeared in OpenBSD 2.9.
BSD
December 7, 2001 BSD