nohup within a pipe


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting nohup within a pipe
# 1  
Old 06-05-2008
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.
# 2  
Old 06-05-2008
any idea are welcome.
# 3  
Old 06-06-2008
fongthai,

Do not bump your thread to the top without reason - Everybody wants to get their thread seen and the forums do move quickly but please don't bump your thread to the top of the forum for no reason as it pushes other peoples threads off the board unfairly.

You can bump your thread if you are adding new information (more than a single line) or if you are adding another mod to the collection. Bumps solely for the purpose of moving the thread to the top of the page are not allowed.

Regards
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with nohup

I have a script test1.ksh (Korn shell) and within that I am calling another script test2.ksh test2.ksh runs for a pretty long time and hence wanted to execute as nohup from within test1.ksh nohup ./test2.ksh Question 1) dont think the above is working , although executing the nohup... (1 Reply)
Discussion started by: alldbest
1 Replies

2. Shell Programming and Scripting

Saving nohup output to a file other than nohup.out

Shell : bash OS : Oracle Linux 6.4 I want to save the ouput of a nohup command to file other than nohup.out . Below are my 3 attempts. For both Attempt1 and Attempt2 , the redirection logs the output correctly to the output file. But I get the error "ignoring input and redirecting stderr to... (7 Replies)
Discussion started by: kraljic
7 Replies

3. Shell Programming and Scripting

How to ignore Pipe in Pipe delimited file?

Hi guys, I need to know how i can ignore Pipe '|' if Pipe is coming as a column in Pipe delimited file for eg: file 1: xx|yy|"xyz|zzz"|zzz|12... using below awk command awk 'BEGIN {FS=OFS="|" } print $3 i would get xyz But i want as : xyz|zzz to consider as whole column... (13 Replies)
Discussion started by: rohit_shinez
13 Replies

4. UNIX for Dummies Questions & Answers

Nohup

Hi Every one , i wrote a script for nohpu ,which checks the service by using the port number and starts if it doesnt hear the port. It works good untill i colse the session. how to make it work even after closing the session .And aslo how to deamoize this script #!/bin/bash netstat -ptlen |... (2 Replies)
Discussion started by: vikatakavi
2 Replies

5. UNIX for Dummies Questions & Answers

nohup

Hi, We are trying to run a shell script using nohup command. But this scripts asks for user input (username and password). Once we enter credentials it should continue run in background. Can someone please suggest how can we implement this? we can't modify .sh file since they are provided by... (5 Replies)
Discussion started by: blak
5 Replies

6. Shell Programming and Scripting

Replace pipe with Broken Pipe

Hi All , Is there any way to replace the pipe ( | ) with the broken pipe (0xA6) in unix (1 Reply)
Discussion started by: saj
1 Replies

7. UNIX for Dummies Questions & Answers

When we need nohup

Hi, I've read the man page on nohup. But I still can't see what's the differences if we just send a process to background versus sending a nohup process to background. eg: myprocess & vs nohup myprocess & Without nohup, myprocess would still run uninterruptible at background... (2 Replies)
Discussion started by: ehchn1
2 Replies

8. UNIX for Dummies Questions & Answers

nohup - help!

I find that if I use nohup (in bourne shell script) then all the interactive parts in my code are gone hidden... e.g., the places asking input from the user (such as ckyorn) will not be displayed. This is no good. Is there a way to use nohup (or similar utility) and meanwhile, to keep the... (9 Replies)
Discussion started by: bluemoon1
9 Replies

9. UNIX for Advanced & Expert Users

Help on nohup

Hi I submitted a long running executable without using nohup. Now, is there any way I can assure to keep that process ON even if my session gets killed? Thanks Bobby (3 Replies)
Discussion started by: bobbyjohnz
3 Replies

10. UNIX for Dummies Questions & Answers

Nohup

Hi, Using nohup it sends output automatically to $HOME/nohup.out - how do I direct this output to another named file instead, so I can run several scripts in the background at once, directing their outputs into individual log files? Cheers (3 Replies)
Discussion started by: miwinter
3 Replies
Login or Register to Ask a Question