Operating System - HP-UX
1755641 Members
3157 Online
108837 Solutions
New Discussion юеВ

Re: omniback post-exec script creates many defunct processes

 

omniback post-exec script creates many defunct processes

Hi pals,
When I run a script to start my application on a term(hpterm, xterm, dtterm..) or if I put this script in crontab and schedule to run, my application runs normal.
But if I put the same script as part of omniback backup's post-exec script, my scripts starts my application but with many defunct processes. This causes many problems later.
How can I avoid this? And I still need to use omniback backup's post-exec feature, to automate starting of my application soon after backup is completed.

thx in advance,
Ravi
5 REPLIES 5
Leif Halvarsson_2
Honored Contributor

Re: omniback post-exec script creates many defunct processes

Hi,

There may be problems with the enviroment when running from OmniBack. Is it possible to attach an example of the script and the post_exec command.

Re: omniback post-exec script creates many defunct processes

Here are the scripts attached. Post-exec script is "/opt/omni/lbin/start_omc". Hope now
there will be more clues....

Re: omniback post-exec script creates many defunct processes

Ravi,

That attachment didn't work... can you post it again as plain text.

Thanks

Duncan

I am an HPE Employee
Accept or Kudo

Re: omniback post-exec script creates many defunct processes

I don't know why that attachment is not working. Here are the scripts text:
============= post-exec(/opt/omni/lbin/start_omc)====
#!/bin/ksh
# Stop OMC Applications and Oracle

su - root -c '/etc/opt/OMC/share/conf/omc_start_after_offline_backup.sh'
============ /etc/.....omc_start_after...p.sh =====
#!/bin/ksh
# Script backup off_line : OMC Application
# Autor : Ravi B. Hiremath;
# Created Date: 25th Feb 2003

. /opt/OMC/util/omcenv.ksh

# Message function to be displayed before OMC application shutdown
MESSAGE1 ()
{
echo "OMC Application Offline backup is complete. OMC is now available." > /tmp/mensagem
echo "You can start using \"omcui\" sessions." >> /tmp/mensagem

# Display the message to all the terms
/usr/sbin/wall < /tmp/mensagem
}

#
post_backup_startup ()
{
/etc/opt/OMC/share/conf/oracle_start
sleep 30
omcstart
}

# Start of script

post_backup_startup
MESSAGE1
============= /etc/..../oracle_start =============
# This script is to shutdown the oracle application
# Author : Ravi B. Hiremath
# Created on : 25th Feb 2003
ORACLE_HOME=${ORACLE_HOME:=/opt/app/oracle/product/8.1.7}
echo "start"
su - oracle -c '
svrmgrl << ENDL
connect internal;
startup;
exit;
ENDL
lsnrctl start; '
===============================================
A. Clay Stephenson
Acclaimed Contributor

Re: omniback post-exec script creates many defunct processes

Your fundamental problems are the "su - user" commands vs. simply "su user". I know you think that you want to emulate the users environment by using his .profile but you really don't want to do this. The problem is that the .profiles contain commands like tset, tabs, stty , ... that expect an interactive environment - which you ain't. You could surround all the commands in .profile with
if [ - t 0 ]
then

fi

but a better way is to create a file, e.g. /usr/local/bin/oracleenv.sh and let oracle's .profile AND your OB2 script source it like this:
. /usr/local/bin/oracleenv.sh and then NOT use the "-" in your su command.

Make sure that your sourced enviroment script does not contain an exit or return or the foreground process (shell) will exit.

I don't think that you will need to use it, but a few processes may also need to use the OB2 detach command to close file descriptors.

If it ain't broke, I can fix that.