java a system wide daemon

Sekcia: Programovanie 26.10.2010 | 22:19
Avatar greengold Archlinux  Používateľ
Dobry den!
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
    • Re: java a system wide daemon 26.10.2010 | 22:48
      Avatar borg Arch, Debian jessie  Administrátor
      napriklad by som skusil sa najprv pozriet na tuto stranku
      • Re: java a system wide daemon 28.10.2010 | 22:48
        Avatar greengold Archlinux  Používateľ
        moc mi ta stranka nehovori zato sa pytam tu
        • Re: java a system wide daemon 29.10.2010 | 01:33
          Avatar Dare_devil Debian, OpenSuse  Používateľ
          Toto ti už musí niečo povedať...

          http://www.source-code.biz/snippets/java/7.htm
          There is no flag large enough to cover the shame of killing innocent people
          • Re: java a system wide daemon 04.11.2010 | 22:07
            Avatar greengold Archlinux  Používateľ
            dobre, potrebujem vanze rozumnu pomoc
            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:
            wrapper.java.classpath.1=../build/classes/snifferbc
            wrapper.java.classpath.2=../build/classes/jpcap
            wrapper.java.classpath.3=%JAVA_HOME%/lib/tools.jar
            
            wrapper.java.library.path.1=../src/snifferbc
            wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

            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!