instant000
21st June 2010, 21:55
Remove baan started for all users as part of HP-UX startup?
Is this something that you do?
I was considering this issue today, with regards to doing this, when I considered that the
baan_started appears to be a file in the home directory, and, it appears that users may not be logged out, at the time the system reboots.
In this case, their baan_started does not get removed during the normal closing process.
So, I was thinking that I could make a startup task to remove these.
Thanks for your assistance.
bdittmar
22nd June 2010, 10:33
Remove baan started for all users as part of HP-UX startup?
Is this something that you do?
I was considering this issue today, with regards to doing this, when I considered that the
baan_started appears to be a file in the home directory, and, it appears that users may not be logged out, at the time the system reboots.
In this case, their baan_started does not get removed during the normal closing process.
So, I was thinking that I could make a startup task to remove these.
Thanks for your assistance.
Hello,
on HP-UX BAAN will be startet automaticly if.
the script "baan" located at :/etc/rc.config.d
#!/sbin/sh
# baan configuration
#
# BAAN: to 1 to start BAAN
#
#BAAN=1
BAAN=0
Another script "baan" located in : /sbin/init.d
Script :
#! /sbin/sh
#
# File: /sbin/init.d/baan
# AUTOR: Bernd Dittmar
# DATE : 09.12.2004
#
#
# Modification for LUST B. Dittmar (2004-12-09)
#
# By this script Baan starts by HP-UX 11i booting
#
# Activate the start by Variable in /etc/rc.config.d BAAN
# (file /etc/rc.config.d/baan)
# Is the variable = 0 then Baan will be ignored by boot and shutdown
#
# @(#) $Revision: 72.11 $
#
# NOTE: This script is not configurable! Any changes made to this
# script will be overwritten when you upgrade to the next
# release of HP-UX.
#
# WARNING: Changing this script in any way may lead to a system that
# is unbootable. Do not modify this script.
#
# <Insert comment about your script here>
#
# Allowed exit values:
# 0 = success; causes "OK" to show up in checklist.
# 1 = failure; causes "FAIL" to show up in checklist.
# 2 = skip; causes "N/A" to show up in the checklist.
# Use this value if execution of this script is overridden
# by the use of a control variable, or if this script is not
# appropriate to execute for some other reason.
# 3 = reboot; causes the system to be rebooted after execution.
# Input and output:
# stdin is redirected from /dev/null
#
# stdout and stderr are redirected to the /etc/rc.log file
# during checklist mode, or to the console in raw mode.
PATH=/usr/sbin:/usr/bin:/sbin
export PATH
#B. Dittmar (2004-12-09) Path and BaaN Env for LUST
#Std. disconnected
#BSE=/baan/bse
#BSE_TMP=$BSE/tmp
BSE=/daten/bse
BSE_TMP=/daten/tmp
BSE_SORT=/daten/tmp
PATH=$BSE/bin:$PATH
export BSE BSE_TMP BSE_SORT PATH
rval=0
# Check the exit value of a command run by this script. If non-zero, the
# exit code is echoed to the log file and the return value of this script
# is set to indicate failure.
# Kill the named process(es).
# $1=<search pattern for your process>
killproc() {
pid=`ps -e | awk '$NF~/'"$1"'/ {print $1}'`
if [ "X$pid" != "X" ]; then
if kill "$pid"; then
echo "$1 stopped"
else
rval=1
echo "Unable to stop $1"
fi
fi
}
case $1 in
'start_msg')
# Emit a _short_ message relating to running this script with
# the "start" argument; this message appears as part of the checklist.
echo "Startup BAAN"
;;
'stop_msg')
# Emit a _short_ message relating to running this script with
# the "stop" argument; this message appears as part of the checklist.
echo "Shutdown BAAN"
;;
'start')
# source the system configuration variables
if [ -f /etc/rc.config ] ; then
. /etc/rc.config
else
echo "ERROR: /etc/rc.config defaults file MISSING"
fi
# Check to see if this script is allowed to run...
if [ "$BAAN" != 1 ]; then
rval=2
else
if [ -f ${BSE_TMP}/rc.start_done ]
then
rm -f ${BSE_TMP}/rc.start_done
fi
if [ -f ${BSE}/tmp/pd_lock ]
then
rm -f ${BSE}/tmp/pd_lock
fi
sh ${BSE}/etc/rc.start
rval=0
fi
;;
'stop')
# source the system configuration variables
if [ -f /etc/rc.config ] ; then
. /etc/rc.config
else
echo "ERROR: /etc/rc.config defaults file MISSING"
fi
# Check to see if this script is allowed to run...
if [ "$BAAN" != 1 ]; then
rval=2
else
if [ -f ${BSE_TMP}/rc.stop_done ]
then
rm -f ${BSE_TMP}/rc.stop_done
fi
sh ${BSE}/etc/rc.stop
rval=0
fi
;;
*)
echo "usage: $0 {start|stop|start_msg|stop_msg}"
rval=1
;;
esac
exit $rval
Set symbolic links on runlevel (for example runlevel = 3) :
Runlevel 3 is located in ā/sbin/rc3.dā
For start : ln ās /sbin/init.d/baan S995baan
BaaN will start at last on this runlevel !
ln ās /sbin/init.d/baan K005baan
BaaN will stop first at that runlevel !
Be sure that S+K = 1000 (S995 + K005 = 1000)
Baan will stop and start by using the rc.start and rc.stop scripts in $BSE/etc
(At STOP, all user processes will be killed)
Regards