4337 links
  • Arnaud's links
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
page 1 / 1
6 results tagged jar x
  • Writing an init script for a Java application | Gustavo Straube

    Comment créer un script d'init pour une application java.

    EDIT : ce truc n'a pas marché pour moi :
    s=ps -C 'java -jar /path/to/application.jar' -o pid h
    Du coup, j'ai remplacé par :
    s=$(pgrep --full 'une string unique qui identifie la command line pour lancer mon jar')

    !/bin/sh

    #

    init script for a Java application

    #

    Check the application status

    #

    This function checks if the application is running

    check_status() {

    Running ps with some arguments to check if the PID exists

    -C : specifies the command name

    -o : determines how columns must be displayed

    h : hides the data header

    s=ps -C 'java -jar /path/to/application.jar' -o pid h

    If somethig was returned by the ps command, this function returns the PID

    if [ $s ] ; then
    return $s
    fi

    In any another case, return 0

    return 0

    }

    Starts the application

    start() {

    At first checks if the application is already started calling the check_status

    function

    check_status

    $? is a special variable that hold the "exit status of the most recently executed

    foreground pipeline"

    pid=$?

    if [ $pid -ne 0 ] ; then
    echo "The application is already started"
    exit 1
    fi

    If the application isn't running, starts it

    echo -n "Starting application: "

    Redirects default and error output to a log file

    java -jar /path/to/application.jar >> /path/to/logfile 2>&1 &
    echo "OK"
    }

    Stops the application

    stop() {

    Like as the start function, checks the application status

    check_status

    pid=$?

    if [ $pid -eq 0 ] ; then
    echo "Application is already stopped"
    exit 1
    fi

    Kills the application process

    echo -n "Stopping application: "
    kill -9 $pid &
    echo "OK"
    }

    Show the application status

    status() {

    The check_status function, again...

    check_status

    If the PID was returned means the application is running

    if [ $? -ne 0 ] ; then
    echo "Application is started"
    else
    echo "Application is stopped"
    fi

    }

    Main logic, a simple case to call functions

    case "$1" in
    start)
    start
    ;;
    stop)
    stop
    ;;
    status)
    status
    ;;
    restart|reload)
    stop
    start
    ;;
    *)
    echo "Usage: $0 {start|stop|restart|reload|status}"
    exit 1
    esac

    exit 0

    January 2, 2014 at 2:43:49 PM GMT+1 - permalink - archive.org - http://gustavostraube.wordpress.com/2009/11/05/writing-an-init-script-for-a-java-application/
    init initd jar java script
  • Using JAR Files: The Basics (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files)

    Exemple de commandes basiques jar

    September 18, 2013 at 2:55:23 PM GMT+2 - permalink - archive.org - http://docs.oracle.com/javase/tutorial/deployment/jar/basicsindex.html
    jar
  • » Running a Java program as a daemon in Ubuntu Linux ZeroCool development blog

    How to run a jar the daemon way under linux

    March 7, 2013 at 4:15:14 PM GMT+1 - permalink - archive.org - http://zerocool.is-a-geek.net/?p=139
    daemon jar java
  • Créer une archive JAR avec Ant - Chicoree
    November 21, 2012 at 2:49:36 PM GMT+1 - permalink - archive.org - http://www.chicoree.fr/w/Cr%C3%A9er_une_archive_JAR_avec_Ant
    ant jar
  • Créer une archive JAR exécutable

    plus de détails sur comment créer un JAR

    December 14, 2011 at 2:06:17 PM GMT+1 - permalink - archive.org - http://www.siteduzero.com/tutoriel-3-30916-creer-une-archive-jar-executable.html
    jar java
  • TP : une calculatrice

    Comment créer un JAR à partir d'eclipse

    December 14, 2011 at 2:05:29 PM GMT+1 - permalink - archive.org - http://www.siteduzero.com/tutoriel-3-10500-tp-une-calculatrice.html#ss_part_4
    jar java
Links per page: 20 50 100
page 1 / 1
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation