BlogJava 联系 聚合 管理  

Blog Stats

随笔档案(17)

文章档案(1)


GaoWei

#!/bin/bash
#
# /etc/rc.d/init.d/oracle10g
#
# Starts the oracle10g daemon
#
# chkconfig: 345 84 84
# description: Runs commands scheduled by the at command at the time
# specified when at was run, and runs batch commands when the load
# average is low enough.
# processname: oracle10g
#
# copyright: Written by Wwashington AT smth bbs, free to distribute.
# You must keep everything in this file, including the copyright
# announcement. Study demo: atd & postgresql in /etc/rc.d/init.d

# Source function library.
INITD=/etc/rc.d/init.d
. $INITD/functions

# Source system profile.
if [ -r /etc/profile ] ; then . /etc/profile ; fi

ORA_SID=mmwy
ORA_USER=oracle
ORA_BASE=/u01/app/oracle
ORA_HOME=${ORA_BASE}/product/10g
BASH_ENV=/home/oracle/.bashrc


case "$1" in
    'start')
        echo -n "Starting oracle10g: "
        su - $ORA_USER -c "$ORA_HOME/bin/dbstart"
        su - $ORA_USER -c "$ORA_HOME/bin/lsnrctl start"
        touch /var/lock/subsys/oracle10g
        echo -n "--------------"
        ;;
    'stop')
        echo -n "Shutting down oracle10g: "
        su - $ORA_USER -c "$ORA_HOME/bin/dbshut"
        su - $ORA_USER -c "$ORA_HOME/bin/lsnrctl stop"
        rm -f /var/lock/subsys/oracle10g
        echo -n "--------------"
        ;;
    *)
        echo "Usage: oracle10g { start | stop }"
        exit 1 ;;
esac
exit 0
















#!/bin/bash
#
# /etc/rc.d/init.d/tomcat
#
# Starts the tomcat daemon
#
# chkconfig: 345 99 99
# description: Runs commands scheduled by the at command at the time
# specified when at was run, and runs batch commands when the load
# average is low enough.
# processname: tomcat
#
# copyright: Written by Wwashington AT smth bbs, free to distribute.
# You must keep everything in this file, including the copyright
# announcement. Study demo: atd & postgresql in /etc/rc.d/init.d

# Source function library.
INITD=/etc/rc.d/init.d
. $INITD/functions

# Source system profile.
if [ -r /etc/profile ] ; then . /etc/profile ; fi

export JAVA_HOME=/www/server/jdk1.5.0_09/
export CATALINA_BASE=/www/server/apache-tomcat-5.5.20
export CATALINA_HOME=/www/server/apache-tomcat-5.5.20
export CATALINA_TMPDIR=/www/server/apache-tomcat-5.5.20/temp

case "$1" in
    'start')
        echo -n "Starting tomcat: "
        ${CATALINA_HOME}/bin/startup.sh
        touch /var/lock/subsys/tomcat
        echo  "--------------"
        ;;
    'stop')
        echo -n "Shutting down tomcat: "
        ${CATALINA_HOME}/bin/shutdown.sh
        rm -f /var/lock/subsys/tomcat
        echo "--------------"
        ;;
    *)
        echo "Usage: tomcat { start | stop | restart }"
        exit 1 ;;
esac
exit 0














#!/bin/bash
#
# /etc/rc.d/init.d/weblogic
#
# Starts the weblogic900 daemon
#
# chkconfig: 345 99 99
# description: Runs commands scheduled by the at command at the time
# specified when at was run, and runs batch commands when the load
# average is low enough.
# processname: weblogic
#
# copyright: Written by Wwashington AT smth bbs, free to distribute.
# You must keep everything in this file, including the copyright
# announcement. Study demo: atd & postgresql in /etc/rc.d/init.d

# Source function library.
INITD=/etc/rc.d/init.d
. $INITD/functions

# Source system profile.
if [ -r /etc/profile ] ; then . /etc/profile ; fi


case "$1" in
    'start')
        echo -n "Starting weblogic: "
 #cd /www/server/bea/user_projects/domains/base_domain/bin/
        #/usr/bin/nohup ./startWebLogic.sh &
        #./startWebLogic.sh
 /www/server/bea/user_projects/domains/base_domain/bin/startWebLogic.sh  &
 touch /var/lock/subsys/weblogic
        echo  "--------------"
        ;;
    'stop')
        echo -n "Shutting down weblogic: "
        cd /www/server/bea/user_projects/domains/base_domain/bin/
        ./stopWebLogic.sh
        rm -f /var/lock/subsys/weblogic
        echo "--------------"
        ;;
    *)
        echo "Usage: weblogic { start | stop}"
        exit 1 ;;
esac
exit 0














#!/bin/sh
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind

# MySQL daemon start/stop script.

# Usually this is put in /etc/init.d (at least on machines SYSV R4 based
# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
# When this is done the mysql server will be started when the machine is
# started and shut down when the systems goes down.

# Comments to support chkconfig on RedHat Linux
# chkconfig: 345 85 85
# description: A very fast and reliable SQL database engine.

# Comments to support LSB init script conventions
### BEGIN INIT INFO
# Provides: mysql
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Start:  3 5
# Default-Stop: 3 5
# Short-Description: start and stop MySQL
# Description: MySQL is a very fast and reliable SQL database engine.
### END INIT INFO
 
# If you install MySQL on some other places than /www/server/mysql-3.23.58, then you
# have to do one of the following things for this script to work:
#
# - Run this script from within the MySQL installation directory
# - Create a /etc/my.cnf file with the following information:
#   [mysqld]
#   basedir=<path-to-mysql-installation-directory>
# - Add the above to any other configuration file (for example ~/.my.ini)
#   and copy my_print_defaults to /usr/bin
# - Add the path to the mysql-installation-directory to the basedir variable
#   below.
#
# If you want to affect other MySQL variables, you should make your changes
# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.

basedir=

# The following variables are only set for letting mysql.server find things.

# Set some defaults
datadir=/www/var
pid_file=
if test -z "$basedir"
then
  basedir=/www/server/mysql-3.23.58
  bindir=/www/server/mysql-3.23.58/bin
else
  bindir="$basedir/bin"
fi

PATH=/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin
export PATH

if test -z "$pid_file"
then
  pid_file=$datadir/`/bin/hostname`.pid
else
  case "$pid_file" in
    /* ) ;;
    * )  pid_file="$datadir/$pid_file" ;;
  esac
fi

mode=$1    # start or stop

parse_arguments() {
  for arg do
    case "$arg" in
      --basedir=*)  basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      --datadir=*)  datadir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      --pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
    esac
  done
}

# Get arguments from the my.cnf file,
# groups [mysqld] [mysql_server] and [mysql.server]
if test -x ./bin/my_print_defaults
then
  print_defaults="./bin/my_print_defaults"
elif test -x $bindir/my_print_defaults
then
  print_defaults="$bindir/my_print_defaults"
elif test -x $bindir/mysql_print_defaults
then
  print_defaults="$bindir/mysql_print_defaults"
else
  # Try to find basedir in /etc/my.cnf
  conf=/etc/my.cnf
  print_defaults=
  if test -r $conf
  then
    subpat='^[^=]*basedir[^=]*=\(.*\)$'
    dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
    for d in $dirs
    do
      d=`echo $d | sed -e 's/[  ]//g'`
      if test -x "$d/bin/my_print_defaults"
      then
        print_defaults="$d/bin/my_print_defaults"
        break
      fi
      if test -x "$d/bin/mysql_print_defaults"
      then
        print_defaults="$d/bin/mysql_print_defaults"
        break
      fi
    done
  fi

  # Hope it's in the PATH ... but I doubt it
  test -z "$print_defaults" && print_defaults="my_print_defaults"
fi

parse_arguments `$print_defaults mysqld mysql_server mysql.server`

# Safeguard (relative paths, core dumps..)
cd $basedir

case "$mode" in
  'start')
    # Start daemon

    if test -x $bindir/safe_mysqld
    then
      # Give extra arguments to mysqld with the my.cnf file. This script may
      # be overwritten at next upgrade.
      $bindir/safe_mysqld --datadir=$datadir --pid-file=$pid_file &
      # Make lock for RedHat / SuSE
      if test -w /var/lock/subsys
      then
        touch /var/lock/subsys/mysql
      fi
    else
      echo "Can't execute $bindir/safe_mysqld from dir $basedir"
    fi
    ;;

  'stop')
    # Stop daemon. We use a signal here to avoid having to know the
    # root password.
    if test -s "$pid_file"
    then
      mysqld_pid=`cat $pid_file`
      echo "Killing mysqld with pid $mysqld_pid"
      kill $mysqld_pid
      # mysqld should remove the pid_file when it exits, so wait for it.

      sleep 1
      while [ -s $pid_file -a "$flags" != aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ]
      do
        [ -z "$flags" ] && echo "Wait for mysqld to exit\c" || echo ".\c"
        flags=a$flags
        sleep 1
      done
      if [ -s $pid_file ]
         then echo " gave up waiting!"
      elif [ -n "$flags" ]
         then echo " done"
      fi
      # delete lock for RedHat / SuSE
      if test -f /var/lock/subsys/mysql
      then
        rm /var/lock/subsys/mysql
      fi
    else
      echo "No mysqld pid file found. Looked for $pid_file."
    fi
    ;;

  *)
    # usage
    echo "usage: $0 start|stop"
    exit 1
    ;;
esac





posted on 2006-12-18 17:51 gggg874 阅读(433) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: