Linux deployment problems

Source: Internet
Author: User

The switch monitoring deployed yesterday had no clue at first, because it was the first time to get these things. Later, the mentor taught me how to do it !!

The first step is to write the script setenv for setting environment variables. sh. This script is required to load all jar packages and startup items. class file, you can directly import the jar package you want to import using export, but note that the specified path should be complete, such:

ExportApphome=/APP/BASD/ibnms/netinf
ExportJarpath= $ Apphome/libs
Export Path =/APP/BASD/ibnms/j2sdk1.4.2 _ 12/bin: $ path

 

ExportOtherclasspath= $ Otherclasspath: $JarpathBackport-util-concurrent.jar

In this way, the jar package is imported!

The following is the import. Class file:

Export classpath = $ apphome/bin: $Apphome/Classes: $Otherclasspath

 

This file ends. The following is the start. Sh file, which is the startup script:

../Setenv. Sh

Pro_key = "netinterface"

Echo *** starting *** $ {pro_key}

Pro_count = 'ps-Ef | grep $ {pro_key} | grep-V grep | WC-l'
If [$ pro_count-LT 1]
Then
Nohup Java-d $ {pro_key} com. sitech. Manage. collinitinport> ../log/call. log &
Nohup Java-d $ {pro_key} com. sitech. Manage. schedulerconfig "0 40 17 **? ">>../Log/call. log &
Nohup Java-d $ {pro_key} com. sitech. Manage. schedulerinterfacestatus "0, 31,46 ***? ">>../Log/call. log &

Echo "***** started ***** $ {pro_key}, logs in ../log dir"
Else
Echo "****** fail *****: there is already $ {pro_count}" process with key/"$ {pro_key}/" exists
Fi

 

Note:

 

The first step is to set the environment variable, using setenv. sh file, and then use the command line to check whether the process exists. If yes, It is not started. If no, It is started. In the startup script, use nohup Java-d $ {pro_key} COM. sitech. manage. start the method in the form of collinitinport and output the startup information to the log file. This is the end, and it is worth noting that it is the path problem;

Similarly, stop. Sh can also be written as follows:

PS-Ef | grep netinterface | grep-V grep | awk '{print $2}' | while read line
Do
Echo $ line kill
Kill-9 $ line
Done

Find the process and delete it with the process number ~

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.