![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| call shell script from perl cgi script problem | raksha.s | Shell Programming and Scripting | 2 | 03-25-2009 04:50 AM |
| ssh script problem problem | pcjandyala | Shell Programming and Scripting | 2 | 07-31-2008 03:27 PM |
| Problem with csh script | rahulrathod | Shell Programming and Scripting | 4 | 02-21-2008 12:38 PM |
| Help. Script problem | Terrible | Shell Programming and Scripting | 3 | 07-02-2006 03:17 PM |
| Problem starting a script from a 'main'-script | Rakker | UNIX for Dummies Questions & Answers | 3 | 06-28-2005 08:12 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Problem with script
Hello All. I have a script that is suppossed to start up a daemon but when executed, simply hangs. Could you please take a look and let me know where the problem might be? TIA
Code:
###################################################################
#
# SCRIPT: dstart3000.sh
# Bring up the Domain
# AUTHOR:
#
# Description:
# Start the Domain Daemon Server Process on Port 3000
# Execution Syntax:
# ./dstart3000.ksh
# Revision History:
# 2007_09_21 Script created
###################################################################
# Setting up variables
FATAL=255
SUCCESS=0
MAIL_SUBJECT="Domain Daemon Server Process failed to Start"
MAIL_TO="someone@somewhere.com"
program_name=`basename $0 .ksh`
start_time=`date +%y-%m-%d`
#Intializing log file and putting job start time
LOG_FILE="${GM_LOG}/${program_name}.${start_time}.log"
echo "Program ${program_name} started at ${start_time}" > ${LOG_FILE}
echo "Start DomainDaemon process at `date +%Y%m%d_%H%M%S`" >> ${LOG_FILE}
DomainDaemon -port 3000 -start > daemon3000.log 2> daemon3000.err
if [ $? -ne 0 ]; then
# The Domain Daemon Start failed ??
echo ERROR - the Domain Daemon Start Server Failed >> ${LOG_FILE}
mail -s "${MAIL_SUBJECT}" "${MAIL_TO}" < ${LOG_FILE}
exit 1
else
echo Domain Daemon Started succesfully
fi
echo finish Domain Daemon Server Started Succesfully `date +%Y%m%d_%H%M%S` >> ${LOG_FILE}
# Save logfile
# Cleanup and close
Last edited by vgersh99; 06-22-2009 at 06:16 PM.. Reason: code tags, PLEASE! |
|
||||
|
Is this the line?:
Code:
DomainDaemon -port 3000 -start > daemon3000.log 2> daemon3000.err Code:
DomainDaemon -port 3000 -start > daemon3000.log 2> daemon3000.err & Code:
nohup DomainDaemon -port 3000 -start > daemon3000.log 2> daemon3000.err & |
|
||||
|
hi, I have tried you script to run and from my point of view the script working fine.
I have changed only the header to #!/bin/bash then I've created a test.log with permission settings 755 and at last I've installed it on my debian OS mailutilities -- that's all! see my mail "/var/mail/####": 3 messages 2 unread R 3 #### Di Jun 23 00:22 19/667 Domain Daemon Server Process failed to Start §3 Subject: Domain Daemon Server Process failed to Start To: <####@localhost> From: #### <####@%%%%.@@@@@@@@@@@@@> Date: Tue, 23 Jun 2009 00:22:28 +0200 Program test.sh started at 09-06-23 Start DomainDaemon process at 20090623_002228 ERROR - the Domain Daemon Start Server Failed |
|
||||
|
Thanks! for the replies! I need to use Korn on this one so switching to bash is not an option. I am unfamiliar with '-x'. How do I implement this? As for 'hangs', I mean that the job runs but does not finish, i.e. return any messages or get a command prompt back. Also, no .err or .log files ever get created.
Last edited by grin1dan; 06-23-2009 at 01:34 PM.. Reason: Left out some info |
|
||||
|
From the output of:
Code:
# help set ... -x Print commands and their arguments as they are executed. ... so just put "set -x" at the top of the script before any other commands. A much more ghetto and tedious way to do it is to add an "echo" command after every command. Code:
command1 echo 1 command2 echo 2 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|