chef 0.7.16 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of chef might be problematic. Click here for more details.
- data/README.rdoc +11 -10
- data/bin/chef-client +2 -2
- data/bin/chef-solo +1 -1
- data/bin/knife +27 -0
- data/bin/shef +49 -0
- data/distro/README +2 -0
- data/distro/{debian → common}/man/man1/chef-indexer.1 +0 -0
- data/distro/{debian → common}/man/man1/chef-server.1 +0 -0
- data/distro/{debian → common}/man/man8/chef-client.8 +0 -0
- data/distro/{debian → common}/man/man8/chef-solo.8 +0 -0
- data/distro/common/man/man8/knife.8 +375 -0
- data/distro/redhat/etc/init.d/chef-client +8 -4
- data/distro/redhat/etc/init.d/chef-server +16 -15
- data/distro/redhat/etc/init.d/chef-server-webui +78 -0
- data/distro/redhat/etc/init.d/chef-solr +76 -0
- data/distro/redhat/etc/init.d/chef-solr-indexer +75 -0
- data/distro/redhat/etc/sysconfig/chef-client +10 -0
- data/distro/redhat/etc/sysconfig/chef-server +10 -0
- data/distro/redhat/etc/sysconfig/chef-server-webui +10 -0
- data/distro/redhat/etc/sysconfig/chef-solr +9 -0
- data/distro/redhat/etc/sysconfig/chef-solr-indexer +7 -0
- data/distro/suse/etc/init.d/chef-client +121 -0
- data/lib/chef.rb +1 -1
- data/lib/chef/api_client.rb +263 -0
- data/lib/chef/application.rb +1 -1
- data/lib/chef/application/client.rb +21 -3
- data/lib/chef/application/knife.rb +144 -0
- data/lib/chef/application/server.rb +2 -1
- data/lib/chef/application/solo.rb +9 -2
- data/lib/chef/cache.rb +61 -0
- data/lib/chef/cache/checksum.rb +70 -0
- data/lib/chef/certificate.rb +154 -0
- data/lib/chef/client.rb +123 -220
- data/lib/chef/compile.rb +9 -21
- data/lib/chef/config.rb +67 -10
- data/lib/chef/cookbook.rb +49 -22
- data/lib/chef/cookbook/metadata.rb +85 -5
- data/lib/chef/cookbook_loader.rb +4 -4
- data/lib/chef/couchdb.rb +99 -30
- data/lib/chef/daemon.rb +1 -1
- data/lib/chef/data_bag.rb +215 -0
- data/lib/chef/data_bag_item.rb +219 -0
- data/lib/chef/exceptions.rb +3 -0
- data/lib/chef/index_queue.rb +29 -0
- data/lib/chef/index_queue/amqp_client.rb +106 -0
- data/lib/chef/index_queue/consumer.rb +76 -0
- data/lib/chef/index_queue/indexable.rb +74 -0
- data/lib/chef/knife.rb +309 -0
- data/lib/chef/knife/client_bulk_delete.rb +40 -0
- data/lib/chef/knife/client_create.rb +62 -0
- data/lib/chef/knife/client_delete.rb +37 -0
- data/lib/chef/knife/client_edit.rb +37 -0
- data/lib/chef/knife/client_list.rb +40 -0
- data/lib/chef/knife/client_reregister.rb +48 -0
- data/lib/chef/knife/client_show.rb +42 -0
- data/lib/chef/knife/configure.rb +123 -0
- data/lib/chef/knife/cookbook_bulk_delete.rb +46 -0
- data/lib/chef/knife/cookbook_delete.rb +41 -0
- data/lib/chef/knife/cookbook_download.rb +57 -0
- data/lib/chef/knife/cookbook_list.rb +41 -0
- data/lib/chef/knife/cookbook_metadata.rb +87 -0
- data/lib/chef/knife/cookbook_show.rb +75 -0
- data/lib/chef/knife/cookbook_upload.rb +179 -0
- data/lib/chef/knife/data_bag_create.rb +43 -0
- data/lib/chef/knife/data_bag_delete.rb +43 -0
- data/lib/chef/knife/data_bag_edit.rb +49 -0
- data/lib/chef/knife/data_bag_list.rb +42 -0
- data/lib/chef/knife/data_bag_show.rb +40 -0
- data/lib/chef/knife/ec2_instance_data.rb +46 -0
- data/lib/chef/knife/index_rebuild.rb +51 -0
- data/lib/chef/knife/node_bulk_delete.rb +43 -0
- data/lib/chef/knife/node_create.rb +39 -0
- data/lib/chef/knife/node_delete.rb +36 -0
- data/lib/chef/knife/node_edit.rb +36 -0
- data/lib/chef/knife/node_from_file.rb +42 -0
- data/lib/chef/knife/node_list.rb +41 -0
- data/lib/chef/knife/node_run_list_add.rb +64 -0
- data/lib/chef/knife/node_run_list_remove.rb +45 -0
- data/lib/chef/knife/node_show.rb +46 -0
- data/lib/chef/knife/role_bulk_delete.rb +44 -0
- data/lib/chef/knife/role_create.rb +44 -0
- data/lib/chef/knife/role_delete.rb +36 -0
- data/lib/chef/knife/role_edit.rb +37 -0
- data/lib/chef/knife/role_from_file.rb +46 -0
- data/lib/chef/knife/role_list.rb +40 -0
- data/lib/chef/knife/role_show.rb +43 -0
- data/lib/chef/knife/search.rb +94 -0
- data/lib/chef/knife/ssh.rb +170 -0
- data/lib/chef/log.rb +30 -8
- data/lib/chef/mixin/checksum.rb +2 -7
- data/lib/chef/mixin/command.rb +32 -13
- data/lib/chef/mixin/convert_to_class_name.rb +15 -0
- data/lib/chef/mixin/deep_merge.rb +199 -11
- data/lib/chef/mixin/generate_url.rb +18 -9
- data/lib/chef/mixin/language.rb +29 -1
- data/lib/chef/mixin/language_include_attribute.rb +56 -0
- data/lib/chef/mixin/language_include_recipe.rb +53 -0
- data/lib/chef/mixin/params_validate.rb +25 -12
- data/lib/chef/mixin/recipe_definition_dsl_core.rb +2 -0
- data/lib/chef/mixin/template.rb +11 -1
- data/lib/chef/mixin/xml_escape.rb +87 -0
- data/lib/chef/node.rb +144 -122
- data/lib/chef/openid_registration.rb +12 -5
- data/lib/chef/platform.rb +89 -47
- data/lib/chef/provider/breakpoint.rb +36 -0
- data/lib/chef/provider/cron.rb +5 -6
- data/lib/chef/provider/deploy.rb +43 -10
- data/lib/chef/provider/deploy/revision.rb +2 -3
- data/lib/chef/provider/erl_call.rb +72 -0
- data/lib/chef/provider/file.rb +8 -4
- data/lib/chef/provider/git.rb +10 -5
- data/lib/chef/provider/group/dscl.rb +128 -0
- data/lib/chef/provider/http_request.rb +6 -2
- data/lib/chef/provider/ifconfig.rb +1 -0
- data/lib/chef/provider/link.rb +1 -1
- data/lib/chef/provider/log.rb +53 -0
- data/lib/chef/provider/mdadm.rb +88 -0
- data/lib/chef/provider/mount/mount.rb +1 -1
- data/lib/chef/provider/package.rb +1 -1
- data/lib/chef/provider/package/easy_install.rb +106 -0
- data/lib/chef/provider/package/pacman.rb +101 -0
- data/lib/chef/provider/package/portage.rb +1 -1
- data/lib/chef/provider/package/rpm.rb +10 -8
- data/lib/chef/provider/package/yum-dump.py +22 -3
- data/lib/chef/provider/package/yum.rb +32 -8
- data/lib/chef/provider/package/zypper.rb +132 -0
- data/lib/chef/provider/remote_directory.rb +58 -49
- data/lib/chef/provider/remote_file.rb +1 -1
- data/lib/chef/provider/route.rb +136 -80
- data/lib/chef/provider/ruby_block.rb +18 -1
- data/lib/chef/provider/service/arch.rb +109 -0
- data/lib/chef/provider/service/freebsd.rb +0 -1
- data/lib/chef/provider/service/simple.rb +2 -3
- data/lib/chef/provider/service/upstart.rb +191 -0
- data/lib/chef/provider/subversion.rb +12 -4
- data/lib/chef/provider/template.rb +85 -53
- data/lib/chef/provider/user.rb +1 -1
- data/lib/chef/provider/user/dscl.rb +277 -0
- data/lib/chef/provider/user/useradd.rb +1 -0
- data/lib/chef/recipe.rb +2 -41
- data/lib/chef/resource.rb +9 -3
- data/lib/chef/resource/breakpoint.rb +35 -0
- data/lib/chef/resource/deploy.rb +16 -2
- data/lib/chef/resource/easy_install_package.rb +41 -0
- data/lib/chef/resource/erl_call.rb +83 -0
- data/lib/chef/resource/freebsd_package.rb +35 -0
- data/lib/chef/resource/log.rb +62 -0
- data/lib/chef/resource/mdadm.rb +82 -0
- data/lib/chef/resource/pacman_package.rb +33 -0
- data/lib/chef/resource/ruby_block.rb +21 -2
- data/lib/chef/resource/scm.rb +8 -0
- data/lib/chef/resource/subversion.rb +1 -0
- data/lib/chef/resource/user.rb +5 -2
- data/lib/chef/resource/yum_package.rb +36 -0
- data/lib/chef/resource_collection.rb +17 -9
- data/lib/chef/resource_collection/stepable_iterator.rb +124 -0
- data/lib/chef/rest.rb +166 -81
- data/lib/chef/role.rb +114 -38
- data/lib/chef/run_list.rb +15 -6
- data/lib/chef/runner.rb +13 -11
- data/lib/chef/search/query.rb +60 -0
- data/lib/chef/shef.rb +220 -0
- data/lib/chef/shef/ext.rb +297 -0
- data/lib/chef/shef/shef_session.rb +175 -0
- data/lib/chef/streaming_cookbook_uploader.rb +187 -0
- data/lib/chef/tasks/chef_repo.rake +53 -155
- data/lib/chef/util/file_edit.rb +94 -96
- data/lib/chef/webui_user.rb +233 -0
- metadata +219 -63
- data/distro/debian/etc/init.d/chef-indexer +0 -175
- data/distro/redhat/etc/chef/client.rb +0 -16
- data/distro/redhat/etc/chef/indexer.rb +0 -10
- data/distro/redhat/etc/chef/server.rb +0 -22
- data/distro/redhat/etc/init.d/chef-indexer +0 -76
- data/lib/chef/application/indexer.rb +0 -141
- data/lib/chef/queue.rb +0 -145
- data/lib/chef/search.rb +0 -88
- data/lib/chef/search/result.rb +0 -64
- data/lib/chef/search_index.rb +0 -77
- data/lib/chef/util/fileedit.rb +0 -121
@@ -14,15 +14,19 @@
|
|
14
14
|
[ -f /etc/sysconfig/chef-client ] && . /etc/sysconfig/chef-client
|
15
15
|
|
16
16
|
prog="chef-client"
|
17
|
-
pidfile=${PIDFILE-/var/run/chef/
|
17
|
+
pidfile=${PIDFILE-/var/run/chef/client.pid}
|
18
18
|
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
|
19
19
|
config=${CONFIG-/etc/chef/client.rb}
|
20
|
-
|
21
|
-
|
20
|
+
user=${CHEF_USER-root}
|
21
|
+
group=${CHEF_GROUP-root}
|
22
|
+
interval=${INTERVAL-1800}
|
23
|
+
splay=${SPLAY-20}
|
24
|
+
logfile=${LOGFILE-/var/log/chef/client.log}
|
25
|
+
options=${OPTIONS-}
|
22
26
|
|
23
27
|
start() {
|
24
28
|
echo -n "Starting $prog:"
|
25
|
-
daemon chef-client -d -c "$config" -L "$logfile" "$
|
29
|
+
daemon chef-client -d -c "$config" -i "$interval" -s "$splay" -L "$logfile" "$options" "&>/dev/null"
|
26
30
|
RETVAL=$?
|
27
31
|
echo
|
28
32
|
[ $RETVAL -eq 0 ] && touch ${lockfile}
|
@@ -14,28 +14,29 @@
|
|
14
14
|
[ -f /etc/sysconfig/chef-server ] && . /etc/sysconfig/chef-server
|
15
15
|
|
16
16
|
prog="chef-server"
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
childpidfiles=${CHILDPIDFILES-/var/run/chef/server.%s.pid}
|
18
|
+
pidfile=${PIDFILE-/var/run/chef/server.main.pid}
|
19
|
+
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
|
20
|
+
config=${CONFIG-/etc/chef/server.rb}
|
21
|
+
user=${CHEF_USER-chef}
|
22
|
+
group=${CHEF_GROUP-chef}
|
23
|
+
cluster_nodes=${CLUSTER_NODES-1}
|
24
|
+
logfile=${LOGFILE-/var/log/chef/merb.%s.log}
|
25
|
+
options=${OPTIONS-}
|
25
26
|
|
26
27
|
start() {
|
27
28
|
echo -n "Starting $prog:"
|
28
|
-
daemon
|
29
|
+
daemon $prog -d -c "$cluster_nodes" -C "$config" -u "$user" -G "$group" -L "$logfile" -P "$childpidfiles" "$options" "&>/dev/null"
|
29
30
|
RETVAL=$?
|
30
31
|
echo
|
31
|
-
[ $RETVAL -eq 0 ] && touch ${
|
32
|
+
[ $RETVAL -eq 0 ] && touch ${lockfile}
|
32
33
|
return $RETVAL
|
33
34
|
}
|
34
35
|
|
35
36
|
stop() {
|
36
37
|
echo -n "Stopping $prog: "
|
37
|
-
if [ -f $
|
38
|
-
killproc
|
38
|
+
if [ -f $pidfile ]; then
|
39
|
+
killproc $prog
|
39
40
|
RETVAL=$?
|
40
41
|
if [ $RETVAL -ne 0 ]; then
|
41
42
|
failure;
|
@@ -44,7 +45,7 @@ stop() {
|
|
44
45
|
RETVAL=1
|
45
46
|
failure;
|
46
47
|
fi
|
47
|
-
rm -f $
|
48
|
+
rm -f $lockfile
|
48
49
|
echo
|
49
50
|
return $RETVAL
|
50
51
|
}
|
@@ -61,13 +62,13 @@ case "$1" in
|
|
61
62
|
start
|
62
63
|
;;
|
63
64
|
condrestart)
|
64
|
-
if [ -f $
|
65
|
+
if [ -f $lockfile ]; then
|
65
66
|
stop
|
66
67
|
start
|
67
68
|
fi
|
68
69
|
;;
|
69
70
|
status)
|
70
|
-
status
|
71
|
+
status $prog
|
71
72
|
;;
|
72
73
|
*)
|
73
74
|
echo "Usage: $0 {start|stop|restart|condrestart|status}"
|
@@ -0,0 +1,78 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Startup script for chef-server-webui
|
3
|
+
#
|
4
|
+
# chkconfig: - 66 34
|
5
|
+
# description: Server component of the Chef systems integration framework.
|
6
|
+
# processname: chef-server-webui
|
7
|
+
#
|
8
|
+
# config: /etc/sysconfig/chef-server-webui
|
9
|
+
# pidfile: /var/run/chef/chef-server-webui.pid
|
10
|
+
|
11
|
+
# Source function library
|
12
|
+
. /etc/init.d/functions
|
13
|
+
|
14
|
+
[ -f /etc/sysconfig/chef-server-webui ] && . /etc/sysconfig/chef-server-webui
|
15
|
+
|
16
|
+
prog="chef-server-webui"
|
17
|
+
childpidfiles=${CHILDPIDFILES-/var/run/chef/server-webui.%s.pid}
|
18
|
+
pidfile=${PIDFILE-/var/run/chef/server-webui.main.pid}
|
19
|
+
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
|
20
|
+
config=${CONFIG-/etc/chef/server.rb}
|
21
|
+
user=${CHEF_USER-chef}
|
22
|
+
group=${CHEF_GROUP-chef}
|
23
|
+
cluster_nodes=${CLUSTER_NODES-1}
|
24
|
+
logfile=${LOGFILE-/var/log/chef/merb-webui.%s.log}
|
25
|
+
options=${OPTIONS-}
|
26
|
+
|
27
|
+
start() {
|
28
|
+
echo -n "Starting $prog:"
|
29
|
+
daemon $prog -d -c "$cluster_nodes" -C "$config" -u "$user" -G "$group" -L "$logfile" -P "$childpidfiles" "$options" "&>/dev/null"
|
30
|
+
RETVAL=$?
|
31
|
+
echo
|
32
|
+
[ $RETVAL -eq 0 ] && touch ${lockfile}
|
33
|
+
return $RETVAL
|
34
|
+
}
|
35
|
+
|
36
|
+
stop() {
|
37
|
+
echo -n "Stopping $prog: "
|
38
|
+
if [ -f $pidfile ]; then
|
39
|
+
killproc $prog
|
40
|
+
RETVAL=$?
|
41
|
+
if [ $RETVAL -ne 0 ]; then
|
42
|
+
failure;
|
43
|
+
fi;
|
44
|
+
else
|
45
|
+
RETVAL=1
|
46
|
+
failure;
|
47
|
+
fi
|
48
|
+
rm -f $lockfile
|
49
|
+
echo
|
50
|
+
return $RETVAL
|
51
|
+
}
|
52
|
+
|
53
|
+
case "$1" in
|
54
|
+
start)
|
55
|
+
start
|
56
|
+
;;
|
57
|
+
stop)
|
58
|
+
stop
|
59
|
+
;;
|
60
|
+
restart)
|
61
|
+
stop
|
62
|
+
start
|
63
|
+
;;
|
64
|
+
condrestart)
|
65
|
+
if [ -f $lockfile ]; then
|
66
|
+
stop
|
67
|
+
start
|
68
|
+
fi
|
69
|
+
;;
|
70
|
+
status)
|
71
|
+
status $prog
|
72
|
+
;;
|
73
|
+
*)
|
74
|
+
echo "Usage: $0 {start|stop|restart|condrestart|status}"
|
75
|
+
exit 1
|
76
|
+
esac
|
77
|
+
|
78
|
+
exit $RETVAL
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Startup script for chef-solr
|
3
|
+
#
|
4
|
+
# chkconfig: - 66 34
|
5
|
+
# description: SOLR search engine for Chef Server.
|
6
|
+
# processname: chef-solr
|
7
|
+
#
|
8
|
+
# config: /etc/sysconfig/chef-solr
|
9
|
+
# pidfile: /var/run/chef/chef-solr.pid
|
10
|
+
|
11
|
+
# Source function library
|
12
|
+
. /etc/init.d/functions
|
13
|
+
|
14
|
+
[ -f /etc/sysconfig/chef-solr ] && . /etc/sysconfig/chef-solr
|
15
|
+
|
16
|
+
prog="chef-solr"
|
17
|
+
pidfile=${PIDFILE-/var/run/chef/solr.pid}
|
18
|
+
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
|
19
|
+
config=${CONFIG-/etc/chef/server.rb}
|
20
|
+
user=${CHEF_USER-chef}
|
21
|
+
group=${CHEF_GROUP-chef}
|
22
|
+
logfile=${LOGFILE-/var/log/chef/solr.log}
|
23
|
+
options=${OPTIONS-}
|
24
|
+
|
25
|
+
start() {
|
26
|
+
echo -n "Starting $prog:"
|
27
|
+
daemon $prog -d -c "$config" -u "$user" -g "$group" -L "$logfile" "$options" "&>/dev/null"
|
28
|
+
RETVAL=$?
|
29
|
+
echo
|
30
|
+
[ $RETVAL -eq 0 ] && touch ${lockfile}
|
31
|
+
return $RETVAL
|
32
|
+
}
|
33
|
+
|
34
|
+
stop() {
|
35
|
+
echo -n "Stopping $prog: "
|
36
|
+
if [ -f $pidfile ]; then
|
37
|
+
killproc $prog
|
38
|
+
RETVAL=$?
|
39
|
+
if [ $RETVAL -ne 0 ]; then
|
40
|
+
failure;
|
41
|
+
fi;
|
42
|
+
else
|
43
|
+
RETVAL=1
|
44
|
+
failure;
|
45
|
+
fi
|
46
|
+
rm -f $lockfile
|
47
|
+
echo
|
48
|
+
return $RETVAL
|
49
|
+
}
|
50
|
+
|
51
|
+
case "$1" in
|
52
|
+
start)
|
53
|
+
start
|
54
|
+
;;
|
55
|
+
stop)
|
56
|
+
stop
|
57
|
+
;;
|
58
|
+
restart)
|
59
|
+
stop
|
60
|
+
start
|
61
|
+
;;
|
62
|
+
condrestart)
|
63
|
+
if [ -f $lockfile ]; then
|
64
|
+
stop
|
65
|
+
start
|
66
|
+
fi
|
67
|
+
;;
|
68
|
+
status)
|
69
|
+
status $prog
|
70
|
+
;;
|
71
|
+
*)
|
72
|
+
echo "Usage: $0 {start|stop|restart|condrestart|status}"
|
73
|
+
exit 1
|
74
|
+
esac
|
75
|
+
|
76
|
+
exit $RETVAL
|
@@ -0,0 +1,75 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Startup script for chef-solr-indexer
|
3
|
+
#
|
4
|
+
# chkconfig: - 66 34
|
5
|
+
# description: Search indexer component of Chef Server.
|
6
|
+
# processname: chef-solr-indexer
|
7
|
+
#
|
8
|
+
# config: /etc/sysconfig/chef-solr-indexer
|
9
|
+
# pidfile: /var/run/chef/chef-solr-indexer.pid
|
10
|
+
|
11
|
+
# Source function library
|
12
|
+
. /etc/init.d/functions
|
13
|
+
|
14
|
+
[ -f /etc/sysconfig/chef-solr-indexer ] && . /etc/sysconfig/chef-solr-indexer
|
15
|
+
|
16
|
+
prog="chef-solr-indexer"
|
17
|
+
pidfile=${PIDFILE-/var/run/chef/solr-indexer.pid}
|
18
|
+
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
|
19
|
+
config=${CONFIG-/etc/chef/server.rb}
|
20
|
+
user=${CHEF_USER-chef}
|
21
|
+
group=${CHEF_GROUP-chef}
|
22
|
+
logfile=${LOGFILE-/var/log/chef/solr-indexer.log}
|
23
|
+
|
24
|
+
start() {
|
25
|
+
echo -n "Starting $prog:"
|
26
|
+
daemon $prog -d -c "$config" -u "$user" -g "$group" -L "$logfile" "&>/dev/null"
|
27
|
+
RETVAL=$?
|
28
|
+
echo
|
29
|
+
[ $RETVAL -eq 0 ] && touch ${lockfile}
|
30
|
+
return $RETVAL
|
31
|
+
}
|
32
|
+
|
33
|
+
stop() {
|
34
|
+
echo -n "Stopping $prog: "
|
35
|
+
if [ -f $pidfile ]; then
|
36
|
+
killproc $prog
|
37
|
+
RETVAL=$?
|
38
|
+
if [ $RETVAL -ne 0 ]; then
|
39
|
+
failure;
|
40
|
+
fi;
|
41
|
+
else
|
42
|
+
RETVAL=1
|
43
|
+
failure;
|
44
|
+
fi
|
45
|
+
rm -f $lockfile
|
46
|
+
echo
|
47
|
+
return $RETVAL
|
48
|
+
}
|
49
|
+
|
50
|
+
case "$1" in
|
51
|
+
start)
|
52
|
+
start
|
53
|
+
;;
|
54
|
+
stop)
|
55
|
+
stop
|
56
|
+
;;
|
57
|
+
restart)
|
58
|
+
stop
|
59
|
+
start
|
60
|
+
;;
|
61
|
+
condrestart)
|
62
|
+
if [ -f $lockfile ]; then
|
63
|
+
stop
|
64
|
+
start
|
65
|
+
fi
|
66
|
+
;;
|
67
|
+
status)
|
68
|
+
status $prog
|
69
|
+
;;
|
70
|
+
*)
|
71
|
+
echo "Usage: $0 {start|stop|restart|condrestart|status}"
|
72
|
+
exit 1
|
73
|
+
esac
|
74
|
+
|
75
|
+
exit $RETVAL
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Configuration file for the chef-server service
|
2
|
+
|
3
|
+
#CHILDPIDFILES=/var/run/chef/server.%s.pid
|
4
|
+
#PIDFILE=/var/run/chef/server.pid
|
5
|
+
#CONFIG=/etc/chef/server.rb
|
6
|
+
#CHEF_USER=chef
|
7
|
+
#CHEF_GROUP=chef
|
8
|
+
#CLUSTER_NODES=1
|
9
|
+
#LOGFILE=/var/log/chef/merb.%s.log
|
10
|
+
#OPTIONS=
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Configuration file for the chef-server-webui service
|
2
|
+
|
3
|
+
#CHILDPIDFILES=/var/run/chef/server-webui.%s.pid
|
4
|
+
#PIDFILE=/var/run/chef/server-webui.pid
|
5
|
+
#CONFIG=/etc/chef/server.rb
|
6
|
+
#CHEF_USER=chef
|
7
|
+
#CHEF_GROUP=chef
|
8
|
+
#CLUSTER_NODES=1
|
9
|
+
#LOGFILE=/var/log/chef/merb-webui.%s.log
|
10
|
+
#OPTIONS=
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# Configuration file for the chef-solr service
|
2
|
+
|
3
|
+
#PIDFILE=/var/run/chef/solr.pid
|
4
|
+
#CONFIG=/etc/chef/server.rb
|
5
|
+
#CHEF_USER=chef
|
6
|
+
#CHEF_GROUP=chef
|
7
|
+
#LOGFILE=/var/log/chef/solr.log
|
8
|
+
# options for Java. Need to start with -j followed by options..
|
9
|
+
#OPTIONS="-j "
|
@@ -0,0 +1,121 @@
|
|
1
|
+
#! /bin/sh
|
2
|
+
# Copyright (c) 1995-2003 SuSE Linux AG, Nuernberg, Germany.
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Author: Mario Giammarco
|
6
|
+
#
|
7
|
+
### BEGIN INIT INFO
|
8
|
+
# Provides: chef-client
|
9
|
+
# Required-Start: $remote_fs $syslog $named
|
10
|
+
# Required-Stop: $remote_fs $syslog
|
11
|
+
# Default-Start: 3 5
|
12
|
+
# Default-Stop: 0 1 2 6
|
13
|
+
# Short-Description: Chef client
|
14
|
+
# Description: Starts chef client
|
15
|
+
### END INIT INFO
|
16
|
+
|
17
|
+
# First reset status of this service
|
18
|
+
. /etc/rc.status
|
19
|
+
rc_reset
|
20
|
+
|
21
|
+
# Return values acc. to LSB for all commands but status:
|
22
|
+
# 0 - success
|
23
|
+
# 1 - generic or unspecified error
|
24
|
+
# 2 - invalid or excess argument(s)
|
25
|
+
# 3 - unimplemented feature (e.g. "reload")
|
26
|
+
# 4 - insufficient privilege
|
27
|
+
# 5 - program is not installed
|
28
|
+
# 6 - program is not configured
|
29
|
+
# 7 - program is not running
|
30
|
+
|
31
|
+
# set default options
|
32
|
+
CHEF_CONF="/etc/chef/client.rb"
|
33
|
+
if [ ! -f ${CHEF_CONF} ]; then
|
34
|
+
echo -n "Chef client configuration file, ${CHEF_CONF} does not exist."
|
35
|
+
# Tell the user this has skipped
|
36
|
+
rc_status -s
|
37
|
+
exit 6
|
38
|
+
fi
|
39
|
+
|
40
|
+
CHEF_BIN="/usr/bin/chef-client"
|
41
|
+
if [ ! -x ${CHEF_BIN} ]; then
|
42
|
+
echo -n "Chef client, ${CHEF_BIN} not installed!"
|
43
|
+
rc_status -s
|
44
|
+
exit 5
|
45
|
+
fi
|
46
|
+
|
47
|
+
CHEF_LOGFILE=/var/log/chef/chef-client.log
|
48
|
+
CHEF_OPTIONS=""
|
49
|
+
|
50
|
+
# set default PID variables
|
51
|
+
CHEF_PID="/var/run/chef/chef-client.pid"
|
52
|
+
CHEF_PID_NOPREFIX="/var/run/chef/chef-client.pid"
|
53
|
+
|
54
|
+
function chef_is_running() {
|
55
|
+
$0 status >/dev/null
|
56
|
+
}
|
57
|
+
|
58
|
+
case "$1" in
|
59
|
+
start)
|
60
|
+
|
61
|
+
echo -n "Starting chef-client"
|
62
|
+
|
63
|
+
startproc $CHEF_BIN -d -c "$CHEF_CONF" -L "$CHEF_LOGFILE" "$CHEF_OPTIONS" ">/dev/null"
|
64
|
+
|
65
|
+
rc_status -v
|
66
|
+
;;
|
67
|
+
stop)
|
68
|
+
echo -n "Shutting down chef client"
|
69
|
+
killproc -p ${CHEF_PID} -TERM $CHEF_BIN
|
70
|
+
rc_status -v
|
71
|
+
rm -f ${CHEF_PID} 2>/dev/null
|
72
|
+
;;
|
73
|
+
try-restart)
|
74
|
+
$0 status
|
75
|
+
if test $? = 0; then
|
76
|
+
$0 restart $2
|
77
|
+
else
|
78
|
+
rc_reset # Not running is not a failure.
|
79
|
+
fi
|
80
|
+
# Remember status and be quiet
|
81
|
+
rc_status
|
82
|
+
;;
|
83
|
+
restart)
|
84
|
+
$0 stop
|
85
|
+
$0 start $2
|
86
|
+
rc_status
|
87
|
+
;;
|
88
|
+
try-restart-iburst)
|
89
|
+
$0 status
|
90
|
+
if test $? = 0; then
|
91
|
+
$0 stop
|
92
|
+
$0 start iburst
|
93
|
+
else
|
94
|
+
rc_reset # Not running is not a failure.
|
95
|
+
fi
|
96
|
+
# Remember status and be quiet
|
97
|
+
rc_status
|
98
|
+
;;
|
99
|
+
force-reload)
|
100
|
+
# Does not support signalling to reload
|
101
|
+
$0 try-restart
|
102
|
+
rc_status
|
103
|
+
;;
|
104
|
+
reload)
|
105
|
+
echo -n "Reload chef-client"
|
106
|
+
# Does not support signalling to reload
|
107
|
+
rc_failed 3
|
108
|
+
rc_status -v
|
109
|
+
;;
|
110
|
+
status)
|
111
|
+
checkproc -p ${CHEF_PID} $CHEF_BIN
|
112
|
+
echo -n "Checking for chef-client "
|
113
|
+
checkproc -p ${CHEF_PID} $CHEF_BIN
|
114
|
+
rc_status -v
|
115
|
+
;;
|
116
|
+
*)
|
117
|
+
echo "Usage: $0 {start|stop|status|try-restart|restart|try-restart-iburst|force-reload|reload|addserver|ntptimeset}"
|
118
|
+
exit 1
|
119
|
+
;;
|
120
|
+
esac
|
121
|
+
rc_exit
|