Script For Logic 1
Script For Logic 1
/bin/sh
#
### BEGIN INIT INFO
# Provides: clvm
# Required-Start: lvm2
# Required-Stop: lvm2
# Should-Start: cman corosync openais
# Should-Stop: cman corosync openais
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: start and stop the lvm cluster locking daemon
### END INIT INFO
#
# Author: Frederik Sch�ler <fs@debian.org>
# based on the old clvm init script from etch
# and the clvmd init script from RHEL5
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Cluster LVM Daemon"
NAME=clvm
DAEMON=/usr/sbin/clvmd
SCRIPTNAME=/etc/init.d/clvm
[ -x $DAEMON ] || exit 0
. /lib/init/vars.sh
. /lib/lsb/init-functions
if [ ! -f /etc/cluster/cluster.conf ]; then
log_failure_msg "clvmd: cluster not configured. Aborting."
exit 0
fi
CLVMDTIMEOUT=20
DAEMON_OPTS="-T$CLVMDTIMEOUT"
do_start()
{
start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS ||
status="$?"
# flush cache
vgscan > /dev/null 2>&1
return $status
}
do_activate()
{
if [ -n "$LVM_VGS" ] ; then
log_action_msg "Activating VGs $LVM_VGS"
vgchange -ayl $LVM_VGS || return $?
else
log_action_msg "Activating all VGs"
vgchange -ayl || return $?
fi
}
do_deactivate()
{
if [ -n "$LVM_VGS" ] ; then
vgs="$LVM_VGS"
else
# Hack to only deactivate clustered volumes
vgs=$(vgdisplay -C -o vg_name,vg_attr --noheadings 2> /dev/null | awk
'($2 ~ /.....c/) {print $1}')
fi
[ "$vgs" ] || return 0
do_stop()
{
start-stop-daemon --stop --quiet --name clvmd
status=$?
return $status
}
case "$1" in
start)
# start the daemon...
log_daemon_msg "Starting $DESC" "$NAME"
do_start
status=$?
case "$status" in
0) log_end_msg 0 ;;
1) log_action_msg " already running" ; log_end_msg 0 ;;
*) log_end_msg 1 ;;
esac
# and activate clustered volume groups
do_activate
status=$?
exit $status
;;
stop)
# deactivate volumes...
log_daemon_msg "Deactivating VG $vg:"
do_deactivate
status=$?
case "$status" in
0) log_end_msg 0 ;;
1) log_end_msg 0 ;;
*) log_end_msg 1 ;;
esac
# and stop the daemon
log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
status=$?
case "$status" in
0) log_end_msg 0 ; exit 0 ;;
1) log_end_msg 0 ; exit 0 ;;
*) log_end_msg 1 ; exit $status ;;
esac
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
status)
pid=$( pidof $DAEMON )
if [ -n "$pid" ] ; then
log_action_msg "$DESC is running"
else
log_action_msg "$DESC is not running"
fi
exit 0
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0
--------------------------------------------------------------
[ -f /bin/raw ] || exit 0
[ -f /etc/sysconfig/rawdevices ] || exit 0
# Exit if the file just has the default comments.
LC_ALL=C /bin/egrep -q -v "^ *#" /etc/sysconfig/rawdevices 2>/dev/null || exit 0
. /etc/init.d/functions
function assign_raw()
{
LC_ALL=C egrep -v '^ *#' /etc/sysconfig/rawdevices |
while read RAW BLOCK; do
if [ -n "$RAW" -a -n "$BLOCK" ]; then
rawdirname=${RAW%/*}
if [ "$rawdirname" = "/dev" -a -d /dev/raw ]; then
echo $" Please correct your /etc/sysconfig/rawdevices:"
echo $" rawdevices are now located in the directory /dev/raw/ "
echo $" If the command 'raw' still refers to /dev/raw as a file."
echo $" you'll have to upgrade your util-linux package"
exit 0
fi
if [ "$rawdirname" = "/dev/raw" -a -f /dev/raw ]; then
echo $" Please correct your /etc/sysconfig/rawdevices:"
echo $" rawdevices are now located in the directory /dev/raw/ "
echo $" If the command 'raw' still refers to /dev/raw as a file."
echo $" you'll have to upgrade your util-linux package"
exit 0
fi
status)
ID=`id -u`
if [ $ID -eq 0 ]; then
raw -qa
else
echo $"You need to be root to use this command ! "
fi
;;
restart|reload)
$0 start
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit 0
[root@lxedmmdrdb1 ~]#
-----------------------------------------------------------------------------------
#!/bin/sh
# chkconfig: 345 99 10
# description: Documentum auto start/stop script
# This script assumes that the dmadmin
# profile (i.e. .profile, .bash_profile) sets the Documentum environment
correctly
#
# Install command: chkconfig --add dctm
#
# Written by: Tony Rosete
#
#
DOCUMENTUM=/home/dmadmin/server
JMS_DIR=$DOCUMENTUM/shared/jboss4.3.0/server
DOCBASE_NAME=mydocbase
INSTALL_OWNER=dmadmin
HOME_DIR=/home/dmadmin
if [ ! -f $DOCUMENTUM/dba/dm_launch_Docbroker ]
then
echo "$DOCUMENTUM/dba/dm_lauch_Docbroker not found"
exit
fi
if [ ! -f $DOCUMENTUM/dba/dm_start_$DOCBASE_NAME ]
then
echo "$DOCUMENTUM/dba/dm_start_$DOCBASE_NAME not found"
exit
fi
if [ ! -f $JMS_DIR/startMethodServer.sh ]
then
echo "$JMS_DIR/startMethodServer.sh not found"
exit
fi
case "$1" in
'start')
# Start the docbroker
su - $INSTALL_OWNER -c $DOCUMENTUM/dba/dm_launch_Docbroker
echo
echo "Documentum startup complete"
;;
'stop')
# Stop the docbase
su - $INSTALL_OWNER -c $DOCUMENTUM/dba/dm_shutdown_$DOCBASE_NAME
esac
-----------------------------------------------------------------------------------
-----------------------