Jsvc allows the application (e.g. Tomcat) to perform some privileged operations as root (e.g. bind to a port < 1024), and then switch identity to a non-privileged user.
SVC是一组让java在UNIX上更容易运行的库和应用程序
JSVC允许应用程序(如Tomcat)以root权限执行一些特权操作(如绑定到一个端口<1024),然后切换到一个非特权用户的身份。
There two ways to use jsvc: via a Class that implements the Daemon interface orvia calling a Class that has the required methods.For example Tomcat-4.1.x uses the Daemon interfacewhereas Tomcat-5.0.x provides a Class whose methods are called by jsvc directly.
有两种方式使用JSVC的:通过一个类实现守护接口或通过调用类所需的方法。例如Tomcat的4.1.x版守护接口,而使用的Tomcat5.0.x中提供了一个类的方法被称为由JSVC直接。
Do the following:
./jsvc -cp commons-daemon.jar:my.jar MyClass
如下操作:
./jsvc -cp commons-daemon.jar:my.jar MyClass
Write a Class (MyClass) that implements the following methods:
./jsvc -cp my.jar MyClass
编写一个实现如下方法的类:
生成一个jar包
./jsvc -cp my.jar MyClass