~ubuntu-branches/ubuntu/karmic/chef/karmic

« back to all changes in this revision

Viewing changes to distro/redhat/etc/init.d/chef-client

  • Committer: Bazaar Package Importer
  • Author(s): Joshua Timberman, Joshua Timberman, Fabrice Coutadeur
  • Date: 2009-09-30 19:19:37 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090930191937-1clge7ckxfjm0wx3
Tags: 0.7.10-0ubuntu1
[ Joshua Timberman ]
* New upstream release
* Upstream patch for couchdb 0.10.0 (CHEF-515, quilt patch removed)
* Fix client logging to file (CHEF-287)
* Fix config log_location settings (CHEF-500)
* Requires libmixlib-config-ruby (>= 1.0.12)

[ Fabrice Coutadeur ]
* debian/watch: updated to avoid getting non numerical versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
# Startup script for chef-client
 
3
#
 
4
# chkconfig: - 98 02
 
5
# description: Client component of the Chef systems integration framework.
 
6
# processname: chef-client
 
7
#
 
8
# config: /etc/sysconfig/chef-client
 
9
# pidfile: /var/run/chef/chef-client.pid
 
10
 
 
11
# Source function library
 
12
. /etc/init.d/functions
 
13
 
 
14
[ -f /etc/sysconfig/chef-client ] && . /etc/sysconfig/chef-client
 
15
 
 
16
prog="chef-client"
 
17
pidfile=${PIDFILE-/var/run/chef/chef-client.pid}
 
18
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
 
19
config=${CONFIG-/etc/chef/client.rb}
 
20
logfile=${LOGFILE-/var/log/chef/chef-client.log}
 
21
OPTIONS=
 
22
 
 
23
start() {
 
24
    echo -n "Starting $prog:"
 
25
    daemon chef-client -d -c "$config" -L "$logfile" "$OPTIONS" ">/dev/null"
 
26
    RETVAL=$?
 
27
    echo
 
28
    [ $RETVAL -eq 0 ] && touch ${lockfile}
 
29
    return $RETVAL
 
30
}
 
31
 
 
32
stop() {
 
33
    echo -n "Stopping $prog: "
 
34
    if [ -f $pidfile ]; then
 
35
        killproc chef-client
 
36
        RETVAL=$?
 
37
        if [ $RETVAL -ne 0 ]; then
 
38
            failure;
 
39
        fi;
 
40
    else
 
41
        RETVAL=1
 
42
        failure;
 
43
    fi
 
44
    rm -f $lockfile
 
45
    echo
 
46
    return $RETVAL
 
47
}
 
48
 
 
49
case "$1" in
 
50
  start)
 
51
        start
 
52
        ;;
 
53
  stop)
 
54
        stop
 
55
        ;;
 
56
  restart)
 
57
        stop
 
58
        start
 
59
        ;;
 
60
  condrestart)
 
61
        if [ -f $lockfile ]; then
 
62
            stop
 
63
            start
 
64
        fi
 
65
        ;;
 
66
  status)
 
67
        status chef-client
 
68
        ;;
 
69
  *)
 
70
    echo "Usage: $0 {start|stop|restart|condrestart|status}"
 
71
    exit 1
 
72
esac
 
73
 
 
74
exit $RETVAL