How to enable weblogic in linux

Source: Internet
Author: User
For details about how to enable weblogic in linux-Linux general technology-Linux programming and kernel, refer to the following. Weblogic Automatic Start and Stop
Suppose weblogic is installed in/home/weblogic/bea.
1. Write the service script as follows:
#! /Bin/bash
#
################# FUNCTION #############
#
# AutoStart Weblogic
# AutoStop Weblogic
#
#####################################
#
# Created by ZhouYS 2003-11-26
# Wellhope Information Technology Co., Ltd
# PUJIANG Science Park)
#
Shutdownweblogic ()
{
Cd/
# Make temp work dir, you can create it in/tmp
Mkdir-p/home/weblogic/zhouys
#
Cd/home/weblogic/zhouys
# Find weblogic main process
Ps-aux | grep/home/weblogic>; tmp01
#
Awk '{print $2}' tmp01 | sort>; tmp02
# Produce kill-main-process script
Echo "kill-9" 'sed-n' 1p' tmp02 '>; tmp03
#
Chmod 755 tmp03
# Kill weblogic
./Tmp03
Cd/home/weblogic/
Sleep 3
Rm-rfv zhouys
}

Case "$1" in
Start)
Echo "Starting Weblogic ..."
Echo "-----------------------------------------------" >;>;/var/log/weblogic
Date + "% T % a % D: Starting Weblogic as part of system up." >;>;/var/log/weblogic
Echo "-----------------------------------------------" >;>;/var/log/weblogic
Cd/home/weblogic/bea/user_projects/mydomain/>;>;/dev/null
. StartWebLogic. sh & >;>;/var/log/weblogic
Echo "Done ."
Echo ""
Echo "-----------------------------------------------" >;>;/var/log/weblogic
Date + "% T % a % D: Finished." >;>;/var/log/weblogic
Echo "-----------------------------------------------" >;>;/var/log/weblogic
Touch/var/lock/subsys/weblogic

;;
Stop)
Echo "Stopping Weblogic ..."
Echo "-----------------------------------------------" >;>;/var/log/weblogic
Date + "% T % a % D: Stopping Weblogic as part of system down." >;>;/var/log/weblogic
Echo "-----------------------------------------------" >;>;/var/log/weblogic
Shutdownweblogic
Echo "Done ."
Echo ""
Echo "-----------------------------------------------" >;>;/var/log/weblogic
Date + "% T % a % D: Finished." >;>;/var/log/weblogic
Echo "-----------------------------------------------" >;>;/var/log/weblogic

;;
Restart)
$0 stop
# Sleep 2 sec to stop all weblogic-process
Sleep 2
$0 start
;;
*)
Echo "Usage: $0 {start | stop | restart }"
Exit 1
Esac

Name the script weblogic and save it under/etc/rc. d/init. d.
Change file attributes: chmod 755 weblogic

Note: In windows, the file cannot run normally due to DOS format characters when editing the file. We recommend that you use gedit or vi to edit the file. No error control is added to the shutdownweblogic function, you can complete it yourself.
2. Establish a service connection:
To stop weblogic at restart, we need the following link:
[Root @ js-oracle init. d] # ln-s ../init. d/weblogic/etc/rc. d/rc0.d/K01weblogic
[Root @ js-oracle init. d] # ln-s ../init. d/weblogic/etc/rc. d/rc6.d/K01weblogic

When the system starts weblogic, we need the following link:
[Root @ js-oracle init. d] # ln-s ../init. d/weblogic/etc/rc. d/rc2.d/S99weblogic
[Root @ js-oracle init. d] # ln-s ../init. d/weblogic/etc/rc. d/rc3.d/S99weblogic
[Root @ js-oracle init. d] # ln-s ../init. d/weblogic/etc/rc. d/rc5.d/S99weblogic


The above configuration level 4 retains unused on RedHat Advance Server2.1

Iii. Explanation:
When linux is started:
Graphical interface: automatically calls/etc/rc. the symbolic connection name under d/rc5.d starts with S (meaning: start/start) refers to the Service in the script file, and the command line parameter start is automatically passed.
When Linux is disabled:
Graphical interface: automatically calls/etc/rc. the symbolic connection name in d/rc5.d starts with K (meaning: kill/Close) and automatically transmits the command line parameter stop.

Other running levels are similar (For details, refer to the/etc/rc. d/rc Script)



How to enable weblogic in linux

# Cd/etc/init. d
# Vi weblogic

#! /Bin/sh
OPT _ = $1

Case "$ OPT _" in
Start)
/Bin/echo "$0: (start )"
Cd/data/bea/user_projects/domains/mydomain/
./StartWebLogic. sh &
;;
Stop)
/Bin/echo "$0: (stop )"
Java-cp/data/bea/weblogic81/server/lib/weblogic. jar weblogic. Admin-url 127.0.0.1: 7001-username weblogic-password weblogic forceshudown
;;
*)
/Bin/echo''
/Bin/echo "Usage: $0 [start | stop]"
/Bin/echo "Invalid argument ==>;\" $ {OPT _}\""
/Bin/echo''
;;
Esac
Exit 0

# Ln-s/etc/init. d/weblogic/etc/rc. d/rc2.d/S99weblogic
# Ln-s/etc/init. d/weblogic/etc/rc. d/rc3.d/S99weblogic
# Ln-s/etc/init. d/weblogic/etc/rc. d/rc5.d/S99weblogic
# Ln-s/etc/init. d/weblogic/etc/rc. d/rc0.d/K01weblogic
# Ln-s/etc/init. d/weblogic/etc/rc. d/rc6.d/K01weblogic
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.