Operating System - HP-UX
1846734 Members
3831 Online
110256 Solutions
New Discussion

Package is in starting stage

 
SOLVED
Go to solution

Package is in starting stage

Hi All,

I have started a package after modifying the scripts. I found that the package status is in "starting" for a long time. By pressing Ctrl+C button, the cmrunpkg command is terminated. Now, I can not stop the package or stop the cluster. Could you help me to stop and restart the package/cluster.

The following is the command is included in the scripts. Any problem on this command?

function start_cronjobs
{
if [[ -f /pids_tz/cron/pids.cron ]]
then
su - pids_tz -c "cd /pids_tz/cron; /usr/bin/crontab pids.cron"
su - pids_tz -c "/pids_tz/scripts/pids/pids_start"
echo "Tarzan processes are started Sucessfully"
fi
}



Thanks
Senthil
7 REPLIES 7
T G Manikandan
Honored Contributor

Re: Package is in starting stage

Hello,
I am not sure what your question is but,
I am not sure why you are trying to start the cronjobs.
make sure your scripts which you require to run periodically are there in the cronjob file.
make sure your crond is running.
you can edit your crontab file using
crontab -e .

Re: Package is in starting stage

What is the last entry in your package control log? Are there any entries in syslog?

One thing I did notice is that you are doing an 'su -'...
By using the 'su -' option, you are also going to be running the contents of /etc/profile and ~pids_tz/.profile (assuming the pids_tz shell is posix or korn) - have you checked the contents of those files to make sure there isn't something which would cause the process to change?

I try to avoid using 'su -' within scripts, as when people change .profiles, they don't tend to think about the consequences of this on scripts. If you need to have a bunch of environment variables set for your app, pop then in a seperate file. These can then be sourced in the .profile, and can also be sourced by other scripts.

HTH

Duncan

I am an HPE Employee
Accept or Kudo

Re: Package is in starting stage

Hi,

The package control file is logged in as pids_tz but it does not execute the scripts.

This is my systemlog file

Nov 29 17:28:48 ijmsia01 CM-CMD[29371]: cmrunpkg -n ijmsia01 tarzan
Nov 29 17:28:48 ijmsia01 cmcld: Request from node ijmsia01 to start package tarz
an on node ijmsia01.
Nov 29 17:28:48 ijmsia01 cmcld: Executing '/etc/cmcluster/tarzan/tarzan.sh star
t' for package tarzan, as service PKG*52481.
Nov 29 17:28:49 ijmsia01 LVM[29382]: vgchange -a e vg_tz02
Nov 29 17:28:49 ijmsia01 LVM[29385]: vgchange -a e vg_tz01
Nov 29 17:28:50 ijmsia01 CM-tarzan[29421]: cmmodnet -a -i 15.85.27.128 15.85.24.
0
Nov 29 17:28:51 ijmsia01 : su : + tty?? root-infx_tz
Nov 29 17:29:17 ijmsia01 : su : + tty?? root-pids_tz



My scripts

function halt_cronjobs
{
if [[ -f /pids_tz/cron/pids.cron ]]
then
su - pids_tz -c "/usr/bin/crontab -r"
su - pids_tz -c "/pids_tz/scripts/pids/pids_stop"
echo "Tarzan pids processes are KILLED sucessfully"
fi
}


function start_cronjobs
{
if [[ -f /pids_tz/cron/pids.cron ]]
then
su - pids_tz -c "cd /pids_tz/cron; /usr/bin/crontab pids.cron"
su - pids_tz -c "/pids_tz/scripts/pids/pids_start"
echo "Tarzan processes are started Sucessfully"
fi
}

case $1 in

stop)
halt_cronjobs
;;

start)
start_cronjobs
;;

*)
DATE=`date +'%b %e %X'`
print "Usage: ${0} [ start | stop ]"
;;
esac

exit


What are the modification needs to be done?

Senthil

Re: Package is in starting stage

What is in your

/etc/cmcluster/tarzan/tarzan.sh.log

File?

I am an HPE Employee
Accept or Kudo

Re: Package is in starting stage

Hi,

Attached is the tarzan.sh.log file

Thanks
Senthil

Re: Package is in starting stage

 
Solution

Re: Package is in starting stage

Now we're getting somewhere...

Note near the bottom of your log file the lines:

warning: commands will be executed using /usr/bin/sh
logout


This is the output from the crontab command, followed by exiting from the interactive shell generated by the 'su -' command. So we know that the line in your script

su - pids_tz -c "cd /pids_tz/cron; /usr/bin/crontab pids.cron"

Works OK, however if you now look dow to the bottom of your log file, you'll see that there is no 'logout' line... SO we can deduce that the second 'su -' , i.e. :

su - pids_tz -c "/pids_tz/scripts/pids/pids_start"

Is *not* exiting - also note that there is no
'Tarzan processes are started Sucessfully' line in the log file, so it looks like the problem is somewhere in the script or binary /pids_tz/scripts/pids/pids_start

I am assuming that all this stuff is originally called from the 'customer_defined_run_cmds' function in the cluster control script... This function must return for the cluster to be considered as started.

HTH

Duncan

I am an HPE Employee
Accept or Kudo