![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| script to monitor process running on server and posting a mail if any process is dead | pradeepmacha | Shell Programming and Scripting | 12 | 10-17-2008 12:08 AM |
| Can a child process return a specific value to a parent process ? | Ametis1970 | High Level Programming | 8 | 04-09-2008 08:22 PM |
| Killing of a process and send a mail if the process doesnot come up within 2 minutes | Prince89 | Shell Programming and Scripting | 1 | 02-15-2008 04:10 PM |
| how to start a process and make it sleep for 5 mins and then kill that process | shrao | Shell Programming and Scripting | 6 | 03-27-2007 09:54 AM |
| my process is going to sleep mode after 12 hours but i need my process in in firsy pr | mukesh_rakesh1 | UNIX for Advanced & Expert Users | 0 | 09-04-2006 11:43 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
daemonize a process using ksh
I'm trying to create daemon processes with ksh as follows:
Code:
function start
{
# start script as co-process and pass an argument
./1.ksh $1 |&
# print pid
print $!
# move the file descriptors of the co-process to 4 and 5
exec 4>&p
exec 5<&p
# then close them
exec 4>&-
exec 5<&-
}
for server in $servers
do
start "arg1"
done
Code:
while read -ru5 do print -r $line done than it works. I want the 1.ksh processes to become daemon processes and finish and I want the calling script to exit. I run it on a SunOS 5.8 server with ksh 88. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
That won't daemonize anything. Put a command "ps -f > /tmp/ps.out" in the script you think is a daemon. Look at the output. See ? in the TTY field? If not, the script is not a daemon. That is the definition of a daemon.. no controling terminal.
To daemonize ksh.1 do: echo /path/to/ksh.1 | at now |
||||
| Google The UNIX and Linux Forums |