LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 05-03-2005, 04:38 PM   #1
lloracle_dba
LQ Newbie
 
Registered: May 2005
Distribution: RHEL 3.0
Posts: 9

Rep: Reputation: 0
Shell script using nohup hangs


I'm trying to write a script that calls another script using the nohup command. Here is the script:

#!/bin/bash
nohup /u01/applmgr/product/11i/mwa/11.5.0/bin/mwactl.sh start 10200 &


When I run it, the script displays this:

$ nohup: appending output to `nohup.out'


It waits for you to hit the Enter key. I need a way to by pass this. I'm trying to call this script when my server boots, but it just hangs :-(
 
Old 05-03-2005, 04:52 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Code:
nohup yourscript </dev/null &
 
Old 05-03-2005, 05:01 PM   #3
lloracle_dba
LQ Newbie
 
Registered: May 2005
Distribution: RHEL 3.0
Posts: 9

Original Poster
Rep: Reputation: 0
It still does the same thing when I do that.

#!/bin/bash
nohup /u01/applmgr/product/11i/mwa/11.5.0/bin/mwactl.sh start 10200 </dev/null &


When the script runs it pauses and waits for you to hit the Enter key.
 
Old 05-03-2005, 06:56 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
What about modifying the script for it not to wait for an input ?
 
Old 05-04-2005, 09:27 AM   #5
lloracle_dba
LQ Newbie
 
Registered: May 2005
Distribution: RHEL 3.0
Posts: 9

Original Poster
Rep: Reputation: 0
I looked at the script and I don't know if that is possible. The script is out of the box Oracle stuff. It looks like it calls some java to generate a "startup script" for a process. I think that startup script is what is hanging.

I was hoping there was something I could do with nohup since it pauses on any scripts I call. Or maybe there is another way of running the script?
 
Old 05-04-2005, 09:48 AM   #6
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,154

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
Just a guess, but, if that's an Oracle start-up script, it may be waiting for a password, and looping a few times before failing. Look at the script you're trting to run and see where (or if) it's asking for input, and pipe it in (if that's the problem )
 
Old 05-04-2005, 09:55 AM   #7
lloracle_dba
LQ Newbie
 
Registered: May 2005
Distribution: RHEL 3.0
Posts: 9

Original Poster
Rep: Reputation: 0
It doesn't require a pwd to start the process. The process starts as expected. So the script is completing normally.
 
Old 05-04-2005, 11:52 AM   #8
LogicG8
Member
 
Registered: Jun 2003
Location: Long Island, NY
Distribution: Gentoo Unstable (what a misnomer)
Posts: 380

Rep: Reputation: 30
man expect
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script inside shell script treotan Linux - General 4 02-19-2009 07:34 AM
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 03:14 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 06:32 PM
i need some script exmples using nohup ykirankumar Linux - Software 1 09-02-2004 06:00 PM
[SHELL SCRIPT] Write at the right of the shell window Creak Linux - General 2 04-02-2004 04:00 PM


All times are GMT -5. The time now is 08:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration