Java Service wrapper implement jar startup __linux under Linux

Source: Internet
Author: User
Tags wrapper

I've been investigating this thing for days, but I'm tired but I haven't made it very clear, but I've got a little bit of a harvest (Linux)

There's a lot of windows on the web, not much, but conf/wrapper.conf this file is about the same.


Install JDK, skip here. For example, your PROJECCT is installed in the/USR/LOCAL/MYP directory.

Use the command wget to download the Java Service Wrapper (current version wrapper-linux-x86-32-3.2.3, official website: http://wrapper.tanukisoftware.org), with the command TAR-ZXVC wrapper-linux-x86-32-3.2.3.tar.gz decompression, get directory wrapper-linux-x86-32-3.2.3, use ln-s wrapper-linux-x86-32-3.2.3 Wrapper Create a shortcut to the directory wrapper-linux-x86-32-3.2.3 called Wrapper.

Copy wrapper/src/bin/sh.script.in to/usr/local/myp/bin directory, rename to Tomcat

Copy wrapper/src/conf/wrapper.conf.in to//usr/local/myp/conf directory and rename to wrapper.conf

Copy all 3 files in the Wrapper/src/lib/lib directory to the/usr/local/myp/lib directory

Copy the wrapper file in the Wrapper/bin directory to the/usr/local/myp/bin directory

modifying/usr/local/myp/bin/tomcat files

App_name= "Servername"

App_long_name= "Servername Server"

Wrapper_cmd= "./wrapper"

Wrapper_conf= ". /conf/wrapper.conf "


#********************************************************************

# wrapper Properties

#********************************************************************

# Java Application

Wrapper.java.command=%java_home%/bin/java//system needs to be set Java_home


# Java Main class. This class must implement the Wrapperlistener interface

# or guarantee that's Wrappermanager class is initialized. Helper

# classes are provided to doing this for you. The integration section

# of the documentation for details.

Wrapper.java.mainclass=org.tanukisoftware.wrapper.wrappersimpleapp


# Java Classpath (include Wrapper.jar) Add class path elements as

# needed starting from 1

Wrapper.java.classpath.1=.. /lib/wrapper.jar

Wrapper.java.classpath.2=.. /lib/wrappertest.jar

Wrapper.java.classpath.3=.. /bin/log4j-1.2.8.jar

Wrapper.java.classpath.4=.. /bin/.

Wrapper.java.classpath.5=.. /bin/myp.jar//need to load the package, this package is the jar package you need to run, is required to load the


# Java Library Path (location of Wrapper.DLL or libwrapper.so)

Wrapper.java.library.path.1=.. /lib


# Java Additional Parameters

#wrapper. java.additional.1=


# Initial Java Heap Size (in MB)

#wrapper. java.initmemory=3


# Maximum Java Heap Size (in MB)

#wrapper. java.maxmemory=64


# application parameters. ADD parameters as needed starting from 1

Wrapper.app.parameter.1=com.client.processmain//Is the Mian function that needs to be performed (Myp.jar)


#********************************************************************

# wrapper Logging Properties

#********************************************************************

# Format of output for the console. (Docs for formats)

wrapper.console.format=pm


# Log level for console output. (Docs for log levels)

Wrapper.console.loglevel=info


# Log file to use for wrapper output logging.

Wrapper.logfile=.. /logs/wrapper.log


# Format of output for the log file. (Docs for formats)

Wrapper.logfile.format=lptm


# Log level for log file output. (Docs for log levels)

Wrapper.logfile.loglevel=info


# Maximum size that log file would be allowed to grow to before

# The log is rolled.  The Size is specified in bytes. The default value

# of 0, disables log rolling. May abbreviate with the ' K ' (KB) or

# ' m ' (MB) suffix. For example:10m = ten megabytes.

Wrapper.logfile.maxsize=0


# Maximum number of rolled log files which'll is allowed before old

# files are deleted. The default value of 0 implies no limit.

Wrapper.logfile.maxfiles=0


# Log level for sys/event log output. (Docs for log levels)

Wrapper.syslog.loglevel=none


#********************************************************************

# wrapper Windows Properties

#********************************************************************

# Title to use when running as a console

Wrapper.console.title=webapfwonline Service//See English name


#********************************************************************

# wrapper Windows nt/2000/xp Service Properties

#********************************************************************

# warning-do not modify any of the above properties when a application

# using this configuration file has been installed as a service.

# Please uninstall the service before modifying. The

# service can then be reinstalled.


# Name of the service

Wrapper.ntservice.name=servername//Service Name


# Display Name of the service

Wrapper.ntservice.displayname=servername Service//Display name


# Description of the service

Wrapper.ntservice.description=servername Service//Services Description


# Service Dependencies. ADD dependencies as needed starting from 1

wrapper.ntservice.dependency.1=


# Mode in which the service is installed. Auto_start or Demand_start

Wrapper.ntservice.starttype=auto_start//start automatically


# Allow The service to interact with the desktop.

Wrapper.ntservice.interactive=false


Put Ln-s/USR/ASC/SERVERNAME/ETC/INIT.D
Note (/usr/asc/servername must be full path, otherwise a copy is an invalid file)

/etc/init.d/appserver start so you can test it.

Attention:

If I put Wrapper.java.command=%java_home%/bin/java

Full-path/usr/java/jdk/bin/java written as a system JDK

Then run under the/USR/ASC path./appserver start is okay.

Running Service AppServer start can also run under other paths.

Estimated service This command does not give him the java_home may not read the java_home.

I'm not sure about that either.

(Service AppServer start will appear
Unable to locate any of the following binaries:
/etc/rc.d/init.d/./wrapper-linux-x86-32
/etc/rc.d/init.d/./wrapper-linux-x86-64
/etc/rc.d/init.d/./wrapper error)
Or you cannot start the JVM (Prompt in service AppServer console)



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.