The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-04-2008
fongthai fongthai is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 54
nohup within a pipe

Dear,

I have a script to start tomcat. I post here the main part of that script - called mytomcat.bash

Code:
function start() 
{
    shift
    trap "" HUP
    /usr/local/java/bin/java  [some_options] \ org.apache.catalina.startup.Bootstrap "$@" start 2>&1 | /usr/local/httpd/bin/rotatelogs /usr/local/catalina/logs/catalina.log 86400 &
}
It run well:
Code:
./mytomcat.bash start
But the terminal will hang when i exit.

I tried with nohup like this:
Code:
nohup ./mytomcat.bash start &
It's can release the terminal.

But I want to use nohup inside my script, I tested with this:

Code:
 nohup /usr/local/java/bin/java  [some_options] \   org.apache.catalina.startup.Bootstrap "$@" start 2>&1 | /usr/local/httpd/bin/rotatelogs /usr/local/catalina/logs/catalina.log 86400 &
I doesn't release the terminal.

Anyone can help?

Thank you.