java a system wide daemon
robim v jave IPS IDS system, samozrejme konzolovy a chcel by som ho spustat pri starte ako system wide daemona.
je toto vobec mozne s javou? ak ano, poradte ako, pls, takymto necim sa zaoberam prvy krat.
diky
Pre pridávanie komentárov sa musíte prihlásiť.
http://www.source-code.biz/snippets/java/7.htm
pre riesenie tohto problemu som si vybral Java Service Wrapper api
zvolil som si 1. integracnu metodu (lebo je odporucana)
nakopiroval som:
{WRAPPER_HOME}/bin/wrapper
{WRAPPER_HOME}/src/bin/sh.script.in
do
{Moj_netbeans_projekt}/dist/
a premenoval skript
dalej>
{WRAPPER_HOME}/lib/libwrapper.so
{WRAPPER_HOME}/lib/wrapper.jar
do
{Moj_netbeans_projekt}/src/snifer/
a este>
{WRAPPER_HOME}/src/conf/wrapper.conf.in
do
{Moj_netbeans_projekt}/conf/
a este log dir. [to je najmenej] ..tak ako vravi tento manual.
tuto je vypis z konzoly oc to robi ked to pustim:
# ./snifferBC console
Running @IPS & IDS system sniffer...
wrapper | --> Wrapper Started as Console
wrapper | Java Service Wrapper Community Edition 32-bit 3.5.6
wrapper | Copyright (C) 1999-2010 Tanuki Software, Ltd. All Rights Reserved.
wrapper | http://wrapper.tanukisoftware.com
wrapper |
wrapper | Launching a JVM...
jvm 1 | Exception in thread "main" java.lang.NoClassDefFoundError: org/tanukisoftware/wrapper/WrapperSimpleApp
jvm 1 | Caused by: java.lang.ClassNotFoundException: org.tanukisoftware.wrapper.WrapperSimpleApp
jvm 1 | at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
jvm 1 | at java.security.AccessController.doPrivileged(Native Method)
jvm 1 | at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
jvm 1 | at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
jvm 1 | at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
jvm 1 | at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
wrapper | JVM exited while loading the application.
jvm 1 | Could not find the main class: org.tanukisoftware.wrapper.WrapperSimpleApp. Program will exit.
^Cwrapper | INT trapped. Shutting down.
wrapper | <-- Wrapper Stopped
[root@timeline32 dist]#
podla mna bude problem v nastaveni wrapper.conf ,konkretne s:
ja ale fakt neviem ake path-y to tam odomna chce,nech to znie akokolvek sialene, guglim to uz par dni a nic.
toto je klasicky NetBeansovy projekt, ale ak treba postnut adresarovu strukturu, dam ju sem.
Pomozte mi s tym, prosim, je to dost surne!
DIk!