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
7 results tagged init x
  • thumbnail
    GitHub - just-containers/s6-overlay: s6 overlay for containers (includes execline, s6-linux-utils & a custom init)
    December 24, 2018 at 9:12:46 AM GMT+1 - permalink - archive.org - https://github.com/just-containers/s6-overlay
    docker init pid1
  • s6-overlay/README.md at master · just-containers/s6-overlay
    June 4, 2018 at 10:49:32 AM GMT+2 - permalink - archive.org - https://github.com/just-containers/s6-overlay/blob/master/README.md
    docker init s6
  • thumbnail
    Colourful ! systemd vs sysVinit Linux Cheatsheet
    June 4, 2015 at 3:54:15 PM GMT+2 - permalink - archive.org - http://linoxide.com/linux-command/systemd-vs-sysvinit-cheatsheet/
    init systemd
  • thumbnail
    scripts/kibana4_init at master · akabdog/scripts
    March 26, 2015 at 11:07:48 AM GMT+1 - permalink - archive.org - https://github.com/akabdog/scripts/blob/master/kibana4_init
    init kibana
  • debian init script

    apt-get install debian-goodies && checkrestart

    via Doo

    February 11, 2015 at 2:08:57 PM GMT+1 - permalink - archive.org - https://links.infomee.fr/?ZiMfVA
    debian init
  • thumbnail
    Init script for Graphite carbon-cache

    ! /bin/sh

    BEGIN INIT INFO

    Provides: carbon-cache

    Required-Start: $remote_fs $syslog

    Required-Stop: $remote_fs $syslog

    Default-Start: 2 3 4 5

    Default-Stop: 0 1 6

    Short-Description: carbon-cache init script

    Description: An init script for Graphite's carbon-cache daemon.

    END INIT INFO

    Author: Jeremy Chalmer

    #

    This init script was written for Ubuntu 11.10 using start-stop-daemon.

    Note: Make sure you set the USER field in /opt/graphite/conf/carbon.conf to be the same

    user that owns the /opt/graphite/storage/ folder. Carbon-cache will be invoked as that

    username on start.

    #

    Enable with update-rc.d carbon-cache defaults

    Source init-functions:

    #source /lib/lsb/init-functions
    . /lib/lsb/init-functions

    PATH should only include /usr/* if it runs after the mountnfs.sh script

    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

    Path to Graphite

    GRAPHITE_HOME=/opt/graphite

    Name of executable daemon

    NAME=carbon-cache
    DESC=carbon-cache

    #Carbon has its own logging facility, by default in /opt/graphite/storage/log/carbon-cache-*

    Path to Executable

    DAEMON=$GRAPHITE_HOME/bin/carbon-cache.py

    NOTE: This is a hard-coded PID file, based on carbon-cache.py. If you have more the one carbon-cache

    instance running on this machine, you'll need to figure out a better way to calculate the PID file.

    PIDFILE=/opt/graphite/storage/carbon-cache-a.pid

    SCRIPTNAME=/etc/init.d/$NAME

    Exit if the package is not installed

    if [ ! -x "$DAEMON" ]; then {
    echo "Couldn't find $DAEMON or not executable"
    exit 99
    }
    fi

    Load the VERBOSE setting and other rcS variables

    [ -f /etc/default/rcS ] && . /etc/default/rcS

    #

    Function that starts the daemon/service

    #
    do_start()
    {

    Return

    #   0 if daemon has been started
    #   1 if daemon was already running
    #   2 if daemon could not be started
    
        # Test to see if the daemon is already running - return 1 if it is. 
    start-stop-daemon --start --pidfile $PIDFILE \
        --exec $DAEMON --test -- start > /dev/null || return 1
    
        # Start the daemon for real, return 2 if failed
    start-stop-daemon --start --pidfile $PIDFILE \
        --exec $DAEMON -- start > /dev/null || return 2

    }

    #

    Function that stops the daemon/service

    #
    do_stop() {

    Return

    #   0 if daemon has been stopped
    #   1 if daemon was already stopped
    #   2 if daemon could not be stopped
    #   other if a failure occurred
    log_daemon_msg "Stopping $DESC" "$NAME"
    start-stop-daemon --stop --signal 2 --retry 5 --quiet --pidfile $PIDFILE
    RETVAL="$?"
    [ "$RETVAL" = 2 ] && return 2
    
        # Delete the exisitng PID file
    if [ -e "$PIDFILE" ]; then {
        rm $PIDFILE
    }
        fi
    
        return "$RETVAL"

    }

    Display / Parse Init Options

    case "$1" in
    start)
    [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
    do_start
    case "$?" in
    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    esac
    ;;
    stop)
    [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
    do_stop
    case "$?" in
    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    esac
    ;;
    restart)
    log_daemon_msg "Restarting $DESC" "$NAME"
    do_stop
    case "$?" in
    0|1)
    do_start
    case "$?" in
    0) log_end_msg 0 ;;
    1) log_end_msg 1 ;; # Old process is still running
    ) log_end_msg 1 ;; # Failed to start
    esac
    ;;
    )

    Failed to stop

    log_end_msg 1
    ;;
    esac
    ;;
    status)
    if [ -s $PIDFILE ]; then
    pid=cat $PIDFILE
    kill -0 $pid >/dev/null 2>&1
    if [ "$?" = "0" ]; then
    echo "$NAME is running: pid $pid."
    RETVAL=0
    else
    echo "Couldn't find pid $pid for $NAME."
    RETVAL=1
    fi
    else
    echo "$NAME is stopped (no pid file)."
    RETVAL=1
    fi
    ;;
    *)
    echo "Usage: $SCRIPTNAME {start
    stop restart status}" >&2
    exit 3
    ;;
    esac
    September 11, 2014 at 4:00:51 PM GMT+2 - permalink - archive.org - https://gist.github.com/chalmerj/1492384
    carbon graphite init
  • 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
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