Sha256: 6dfec9616988b6e14d0d7d4cdd6008fb87f75b753984e7d4fd0004c2aa874d3c

Contents?: true

Size: 1.42 KB

Versions: 7

Compression:

Stored size: 1.42 KB

Contents

#!/bin/bash
# Startup script for chef-solr
#
# chkconfig: - 66 34
# description: SOLR search engine for Chef Server.
# processname: chef-solr
#
# config: /etc/sysconfig/chef-solr
# pidfile: /var/run/chef/chef-solr.pid

# Source function library
. /etc/init.d/functions

[ -f /etc/sysconfig/chef-solr ] && . /etc/sysconfig/chef-solr

prog="chef-solr"
pidfile=${PIDFILE-/var/run/chef/solr.pid}
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
config=${CONFIG-/etc/chef/server.rb}
user=${CHEF_USER-chef}
group=${CHEF_GROUP-chef}
logfile=${LOGFILE-/var/log/chef/solr.log}
options=${OPTIONS-}

start() {
    echo -n "Starting $prog:"
    daemon $prog -d -c "$config" -u "$user" -g "$group" -L "$logfile" "$options" "&>/dev/null"
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch ${lockfile}
    return $RETVAL
}

stop() {
    echo -n "Stopping $prog: "
    if [ -f $pidfile ]; then
        killproc $prog
        RETVAL=$?
        if [ $RETVAL -ne 0 ]; then
            failure;
        fi;
    else
        RETVAL=1
        failure;
    fi
    rm -f $lockfile
    echo
    return $RETVAL
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        stop
        start
        ;;
  condrestart)
        if [ -f $lockfile ]; then
            stop
            start
        fi
        ;;
  status)
        status $prog
        ;;
  *)
    echo "Usage: $0 {start|stop|restart|condrestart|status}"
    exit 1
esac

exit $RETVAL

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
chef-0.8.16 distro/redhat/etc/init.d/chef-solr
chef-0.8.14 distro/redhat/etc/init.d/chef-solr
chef-0.8.10 distro/redhat/etc/init.d/chef-solr
chef-0.8.8 distro/redhat/etc/init.d/chef-solr
chef-0.8.6 distro/redhat/etc/init.d/chef-solr
chef-0.8.4 distro/redhat/etc/init.d/chef-solr
chef-0.8.2 distro/redhat/etc/init.d/chef-solr