Sponsored Content
Top Forums UNIX for Advanced & Expert Users send a new value to a variable in a running background process Post 302309598 by jim mcnamara on Wednesday 22nd of April 2009 10:28:41 AM
Old 04-22-2009
One standard way is to have a "parameter file" in a fixed location.
When you code starts it reads the file, and assigns envrionment variables based on the file contents.

When you want to change a parm, edit the file, then send a signal like SIGHUP SIGUSR1 or whatever is not being blocked for some other purpose. In the code add a trap statement to reread the parm file on receipt of the signal.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

running process in background

I'm trying to install a solaris 9 patch cluster and when I try to use & to run in background it won't allow me to enter in my sudo password so it fails the install and sudo auth. Does Solaris not have screen like linux? If & will work what am I doing wrong? sudo ./install_cluster -q & is... (3 Replies)
Discussion started by: kingdbag
3 Replies

2. Solaris

how to capture oracle export log while running as background process

I ran the Oracle 9i export command from a terminal to export out a big table using "exp andrew/password file=andrew.dmp log=andrew.log" From the terminal I can see that the export is running as there is some output from the oracle export job. The export job is not complete yet. When i go check... (4 Replies)
Discussion started by: hippo2020
4 Replies

3. Shell Programming and Scripting

How to know the status of process running in background

I have run one shell script in background that contains a endless while loop. I am not able to know the status of that job . Please provide any command to know this. I have already used "ps -aef" , "jobs" to know it , but it didn't work. I am sure the process is running as it is generating a file... (8 Replies)
Discussion started by: sumanta
8 Replies

4. UNIX for Advanced & Expert Users

make a foreground running process to run background without hang up

I've tried this a long time ago and was successful but could not remember how i did it. Tried ctrl+Z and then used bg % could not figure what i did after to keep it no hangup - not sure if used nohup -p pid, can u plz help me out if this can be done. Any help will be appreciated. (12 Replies)
Discussion started by: pharos467
12 Replies

5. Shell Programming and Scripting

How to export a variable from a child process running in background to the parent

Hi All, I have a script which calls a child script with a parameter to be run in the background . childscript.ksh $a & Can any one suggest me how do i export a variable from the child script to parent script? Note that the child script is in background If the child script is in... (3 Replies)
Discussion started by: aixjadoo
3 Replies

6. Shell Programming and Scripting

command to see process running at background

Hi , I want to see all the background process that are running in unix box machine...please guide me is there any specific command for that..since I am executing some scripts at background..!!:confused: (1 Reply)
Discussion started by: nks342
1 Replies

7. Shell Programming and Scripting

Running Shell Script in the cron, background process

Hi, i was looking for an answer for some trouble im having runing a script in the cron, thing is, that when i run it manually it works just fine. But when cron runs it, it just doenst work. I saw a reply on a similar subject, suggesting that the . .profile worked for you, but im kind of... (9 Replies)
Discussion started by: blacksteel1988
9 Replies

8. UNIX for Dummies Questions & Answers

How do I send output of a background process to a file other than nohup.out?

I have a question. I will be running a background process using nohup and & command at end. I want to send output to a file say myprocess.out. So will this command work? nohup myprocess.ksh > myprocess.out & Thanks in advance guys !!! :) (3 Replies)
Discussion started by: vx04
3 Replies

9. Shell Programming and Scripting

How to return from background process and check if it is running or not?

Hi Team, i am executing 3 scripts in background from 1 script and i want to send a message once the script gets completed.these scripts usually takes 1 hr to complete. My sample script is below, Vi abc.sh sh /opt/data/Split_1.sh & sh /opt/data/Split_2.sh & sh /opt/data/Split_3.sh & ... (3 Replies)
Discussion started by: raju2016
3 Replies

10. UNIX for Beginners Questions & Answers

Running process in the background

Hi, I have this simple c program that creates duplicate process with fork(): #include <sys/types.h> main() { if (fork() == 0) while(1); else while(1); } I tried running it in the background gcc -o test first.c test & And I got this list of running process: (4 Replies)
Discussion started by: uniran
4 Replies
drv_getparm(9F) 					   Kernel Functions for Drivers 					   drv_getparm(9F)

NAME
drv_getparm - retrieve kernel state information SYNOPSIS
#include <sys/ddi.h> int drv_getparm(unsigned int parm, void *value_p); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). PARAMETERS
parm The kernel parameter to be obtained. Possible values are: "small and bold"ReadLTthe value of lbolt. lbolt is a clock_t that is unconditionally incremented by one at each clock tick. No special treatment is applied when this value overflows the maximum value of the signed integral type clock_t. When this occurs, its value will be negative, and its magnitude will be decreasing until it again passes zero. It can therefore not be relied upon to provide an indication of the amount of time that passes since the last system reboot, nor should it be used to mark an absolute time in the system. Only the difference between two measurements of lbolt is significant. It is used in this way inside the system kernel for timing purposes. PPGRP Read the process group identification number. This number determines which processes should receive a HANGUP or BREAK signal when detected by a driver. UPROCP Read the process table token value. PPID Read process identification number. PSID Read process session identification number. TIME Read time in seconds. UCRED Return a pointer to the caller's credential structure. value_p A pointer to the data space in which the value of the parameter is to be copied. DESCRIPTION
Since the release of the Solaris 2.6 operating environment, the drv_getparm() function has been replaced by ddi_get_lbolt(9F), ddi_get_time(9F), and ddi_get_pid(9F). drv_getparm() function verifies that parm corresponds to a kernel parameter that may be read. If the value of parm does not correspond to a parameter or corresponds to a parameter that may not be read, -1 is returned. Otherwise, the value of the parameter is stored in the data space pointed to by value_p. drv_getparm() does not explicitly check to see whether the device has the appropriate context when the function is called and the function does not check for correct alignment in the data space pointed to by value_p. It is the responsibility of the driver writer to use this function only when it is appropriate to do so and to correctly declare the data space needed by the driver. RETURN VALUES
drv_getparm() returns 0 to indicate success, -1 to indicate failure. The value stored in the space pointed to by value_p is the value of the parameter if 0 is returned, or undefined if -1 is returned. -1 is returned if you specify a value other than LBOLT, PPGRP, PPID, PSID, TIME, UCRED, or UPROCP. Always check the return code when using this function. CONTEXT
drv_getparm() can be called from user context only when using PPGRP, PPID, PSID, UCRED, or UPROCP. It can be called from user or interrupt context when using the LBOLT or TIME argument. SEE ALSO
ddi_get_lbolt(9F), ddi_get_pid(9F), ddi_get_time(9F), buf(9S) Writing Device Drivers SunOS 5.10 24 Jun 1997 drv_getparm(9F)
All times are GMT -4. The time now is 07:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy