chef 0.9.12 → 0.9.14.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/distro/arch/etc/conf.d/chef-client.conf +5 -0
- data/distro/arch/etc/conf.d/chef-server-webui.conf +10 -0
- data/distro/arch/etc/conf.d/chef-server.conf +10 -0
- data/distro/arch/etc/conf.d/chef-solr-indexer.conf +8 -0
- data/distro/arch/etc/conf.d/chef-solr.conf +8 -0
- data/distro/arch/etc/rc.d/chef-client +76 -0
- data/distro/arch/etc/rc.d/chef-server +82 -0
- data/distro/arch/etc/rc.d/chef-server-webui +82 -0
- data/distro/arch/etc/rc.d/chef-solr +82 -0
- data/distro/arch/etc/rc.d/chef-solr-indexer +82 -0
- data/distro/common/markdown/knife.mkd +34 -1
- data/distro/debian/etc/default/chef-solr +1 -0
- data/distro/debian/etc/init.d/chef-client +1 -1
- data/distro/debian/etc/init.d/chef-solr +39 -40
- data/distro/debian/etc/init.d/chef-solr-indexer +1 -1
- data/distro/redhat/etc/init.d/chef-client +1 -1
- data/lib/chef.rb +1 -0
- data/lib/chef/api_client.rb +1 -1
- data/lib/chef/application/agent.rb +1 -1
- data/lib/chef/application/client.rb +1 -1
- data/lib/chef/application/solo.rb +1 -1
- data/lib/chef/cookbook/metadata.rb +2 -2
- data/lib/chef/cookbook/syntax_check.rb +1 -1
- data/lib/chef/cookbook_version.rb +5 -1
- data/lib/chef/couchdb.rb +1 -1
- data/lib/chef/data_bag.rb +1 -1
- data/lib/chef/data_bag_item.rb +35 -9
- data/lib/chef/exceptions.rb +2 -0
- data/lib/chef/file_cache.rb +1 -1
- data/lib/chef/handler/json_file.rb +1 -1
- data/lib/chef/index_queue/amqp_client.rb +2 -2
- data/lib/chef/index_queue/consumer.rb +2 -2
- data/lib/chef/json.rb +52 -0
- data/lib/chef/knife.rb +6 -6
- data/lib/chef/knife/bluebox_images_list.rb +54 -0
- data/lib/chef/knife/bluebox_server_create.rb +157 -0
- data/lib/chef/knife/bluebox_server_delete.rb +63 -0
- data/lib/chef/knife/bluebox_server_list.rb +59 -0
- data/lib/chef/knife/bootstrap.rb +3 -1
- data/lib/chef/knife/bootstrap/archlinux-gems.erb +2 -2
- data/lib/chef/knife/bootstrap/centos5-gems.erb +2 -2
- data/lib/chef/knife/bootstrap/fedora13-gems.erb +1 -1
- data/lib/chef/knife/client_bulk_delete.rb +1 -1
- data/lib/chef/knife/client_create.rb +1 -1
- data/lib/chef/knife/client_delete.rb +1 -1
- data/lib/chef/knife/client_edit.rb +1 -1
- data/lib/chef/knife/client_list.rb +1 -1
- data/lib/chef/knife/client_reregister.rb +1 -1
- data/lib/chef/knife/client_show.rb +1 -1
- data/lib/chef/knife/cookbook_create.rb +1 -1
- data/lib/chef/knife/cookbook_list.rb +1 -1
- data/lib/chef/knife/cookbook_metadata.rb +1 -1
- data/lib/chef/knife/cookbook_show.rb +10 -18
- data/lib/chef/knife/cookbook_site_share.rb +1 -1
- data/lib/chef/knife/cookbook_site_vendor.rb +17 -11
- data/lib/chef/knife/ec2_instance_data.rb +1 -1
- data/lib/chef/knife/ec2_server_create.rb +8 -6
- data/lib/chef/knife/ec2_server_delete.rb +5 -8
- data/lib/chef/knife/ec2_server_list.rb +5 -4
- data/lib/chef/knife/exec.rb +1 -1
- data/lib/chef/knife/node_bulk_delete.rb +1 -1
- data/lib/chef/knife/node_create.rb +1 -1
- data/lib/chef/knife/node_delete.rb +1 -1
- data/lib/chef/knife/node_edit.rb +1 -1
- data/lib/chef/knife/node_from_file.rb +2 -2
- data/lib/chef/knife/node_list.rb +1 -1
- data/lib/chef/knife/node_run_list_add.rb +1 -1
- data/lib/chef/knife/node_run_list_remove.rb +1 -1
- data/lib/chef/knife/node_show.rb +1 -1
- data/lib/chef/knife/rackspace_server_create.rb +98 -70
- data/lib/chef/knife/rackspace_server_delete.rb +2 -2
- data/lib/chef/knife/rackspace_server_list.rb +2 -2
- data/lib/chef/knife/role_bulk_delete.rb +1 -1
- data/lib/chef/knife/role_create.rb +1 -1
- data/lib/chef/knife/role_delete.rb +1 -1
- data/lib/chef/knife/role_edit.rb +1 -1
- data/lib/chef/knife/role_from_file.rb +2 -2
- data/lib/chef/knife/role_list.rb +1 -1
- data/lib/chef/knife/role_show.rb +1 -1
- data/lib/chef/knife/slicehost_images_list.rb +2 -2
- data/lib/chef/knife/slicehost_server_create.rb +2 -2
- data/lib/chef/knife/slicehost_server_delete.rb +2 -2
- data/lib/chef/knife/slicehost_server_list.rb +2 -2
- data/lib/chef/knife/ssh.rb +36 -12
- data/lib/chef/knife/status.rb +1 -1
- data/lib/chef/knife/terremark_server_create.rb +1 -1
- data/lib/chef/knife/terremark_server_delete.rb +1 -1
- data/lib/chef/knife/terremark_server_list.rb +1 -1
- data/lib/chef/log.rb +31 -4
- data/lib/chef/mixin/command.rb +1 -1
- data/lib/chef/mixin/create_path.rb +1 -1
- data/lib/chef/mixin/recipe_definition_dsl_core.rb +1 -1
- data/lib/chef/monkey_patches/numeric.rb +7 -0
- data/lib/chef/node.rb +6 -8
- data/lib/chef/node/attribute.rb +24 -2
- data/lib/chef/openid_registration.rb +1 -1
- data/lib/chef/platform.rb +11 -0
- data/lib/chef/provider/breakpoint.rb +1 -1
- data/lib/chef/provider/cookbook_file.rb +1 -1
- data/lib/chef/provider/deploy/revision.rb +1 -1
- data/lib/chef/provider/deploy/timestamped.rb +1 -1
- data/lib/chef/provider/erl_call.rb +14 -2
- data/lib/chef/provider/git.rb +79 -55
- data/lib/chef/provider/group/pw.rb +1 -1
- data/lib/chef/provider/package/easy_install.rb +35 -13
- data/lib/chef/provider/service/debian.rb +65 -40
- data/lib/chef/provider/service/insserv.rb +52 -0
- data/lib/chef/provider/service/windows.rb +74 -57
- data/lib/chef/provider/subversion.rb +45 -10
- data/lib/chef/provider/user/pw.rb +1 -1
- data/lib/chef/providers.rb +1 -0
- data/lib/chef/resource/deploy_revision.rb +1 -1
- data/lib/chef/resource/easy_install_package.rb +16 -0
- data/lib/chef/resource/file.rb +8 -1
- data/lib/chef/resource_collection/stepable_iterator.rb +1 -1
- data/lib/chef/rest.rb +7 -7
- data/lib/chef/role.rb +2 -2
- data/lib/chef/run_status.rb +1 -1
- data/lib/chef/shef.rb +2 -2
- data/lib/chef/shef/ext.rb +2 -2
- data/lib/chef/shef/model_wrapper.rb +1 -1
- data/lib/chef/shef/shef_rest.rb +1 -1
- data/lib/chef/shef/shef_session.rb +13 -5
- data/lib/chef/tasks/chef_repo.rake +1 -1
- data/lib/chef/version.rb +1 -1
- data/lib/chef/webui_user.rb +1 -1
- metadata +329 -290
@@ -0,0 +1,10 @@
|
|
1
|
+
LOGFILE=/var/log/chef/server-webui.log
|
2
|
+
CONFIG=/etc/chef/webui.rb
|
3
|
+
ADAPTER=thin
|
4
|
+
PORT=4040
|
5
|
+
USER=chef
|
6
|
+
GROUP=chef
|
7
|
+
# Sleep to give daemon enough time to fully start or stop.
|
8
|
+
STARTTIME=10
|
9
|
+
DIETIME=5
|
10
|
+
CHEF_SERVER_WEBUI_ARGS="-p $PORT -e production -d -a $ADAPTER -L $LOGFILE -C $CONFIG -u $USER -G $GROUP"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
LOGFILE=/var/log/chef/server.log
|
2
|
+
CONFIG=/etc/chef/server.rb
|
3
|
+
ADAPTER=thin
|
4
|
+
PORT=4000
|
5
|
+
USER=chef
|
6
|
+
GROUP=chef
|
7
|
+
# Sleep to give daemon enough time to fully start or stop.
|
8
|
+
STARTTIME=10
|
9
|
+
DIETIME=5
|
10
|
+
CHEF_SERVER_ARGS="-p $PORT -e production -d -a $ADAPTER -L $LOGFILE -C $CONFIG -u $USER -G $GROUP"
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
#
|
3
|
+
# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
daemon_bin="/usr/bin/chef-client"
|
19
|
+
daemon_name=$(basename $daemon_bin)
|
20
|
+
PIDF="/var/run/$daemon_name.pid"
|
21
|
+
|
22
|
+
. /etc/rc.conf
|
23
|
+
. /etc/rc.d/functions
|
24
|
+
. /etc/conf.d/$daemon_name.conf
|
25
|
+
|
26
|
+
get_pid() {
|
27
|
+
pidof -o %PPID $daemon_name
|
28
|
+
}
|
29
|
+
|
30
|
+
case "$1" in
|
31
|
+
start)
|
32
|
+
stat_busy "Starting $daemon_name"
|
33
|
+
PID=$(get_pid)
|
34
|
+
if [ -z "$PID" ]; then
|
35
|
+
[ -f $PIDF ] && rm -f $PIDF
|
36
|
+
$daemon_bin --pid $PIDF $CHEF_CLIENT_ARGS
|
37
|
+
if [ $? -gt 0 ]; then
|
38
|
+
stat_fail
|
39
|
+
exit 1
|
40
|
+
else
|
41
|
+
echo $(get_pid) > $PIDF
|
42
|
+
add_daemon $daemon_name
|
43
|
+
stat_done
|
44
|
+
fi
|
45
|
+
else
|
46
|
+
stat_fail
|
47
|
+
exit 1
|
48
|
+
fi
|
49
|
+
;;
|
50
|
+
|
51
|
+
stop)
|
52
|
+
stat_busy "Stopping $daemon_name daemon"
|
53
|
+
PID=$(get_pid)
|
54
|
+
[ ! -z "$PID" ] && kill $PID &> /dev/null
|
55
|
+
if [ $? -gt 0 ]; then
|
56
|
+
stat_fail
|
57
|
+
exit 1
|
58
|
+
else
|
59
|
+
rm -f $PIDF &>/dev/null
|
60
|
+
rm_daemon $daemon_name
|
61
|
+
stat_done
|
62
|
+
fi
|
63
|
+
;;
|
64
|
+
|
65
|
+
restart)
|
66
|
+
$0 stop
|
67
|
+
sleep 3
|
68
|
+
$0 start
|
69
|
+
;;
|
70
|
+
status)
|
71
|
+
stat_busy "Checking $daemon_name status";
|
72
|
+
ck_status $daemon_name
|
73
|
+
;;
|
74
|
+
*)
|
75
|
+
echo "usage: $) {start|stop|restart|status}"
|
76
|
+
esac
|
@@ -0,0 +1,82 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
#
|
3
|
+
# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
daemon_bin="/usr/bin/chef-server"
|
19
|
+
daemon_name=$(basename $daemon_bin)
|
20
|
+
PIDF="/var/run/$daemon_name.pid"
|
21
|
+
|
22
|
+
. /etc/rc.conf
|
23
|
+
. /etc/rc.d/functions
|
24
|
+
. /etc/conf.d/$daemon_name.conf
|
25
|
+
|
26
|
+
get_pid() {
|
27
|
+
pidof -o %PPID $daemon_name
|
28
|
+
}
|
29
|
+
|
30
|
+
case "$1" in
|
31
|
+
start)
|
32
|
+
stat_busy "Starting $daemon_name"
|
33
|
+
PID=$(get_pid)
|
34
|
+
if [ -z "$PID" ]; then
|
35
|
+
[ -f $PIDF ] && rm -f $PIDF
|
36
|
+
$daemon_bin -P $PIDF $CHEF_SERVER_ARGS
|
37
|
+
[ -n "$STARTTIME" ] && sleep $STARTTIME
|
38
|
+
if [ $? -gt 0 ]; then
|
39
|
+
stat_fail
|
40
|
+
exit 1
|
41
|
+
else
|
42
|
+
echo $(get_pid) > $PIDF
|
43
|
+
add_daemon $daemon_name
|
44
|
+
stat_done
|
45
|
+
fi
|
46
|
+
else
|
47
|
+
stat_fail
|
48
|
+
exit 1
|
49
|
+
fi
|
50
|
+
;;
|
51
|
+
|
52
|
+
stop)
|
53
|
+
stat_busy "Stopping $daemon_name daemon"
|
54
|
+
<<<<<<< HEAD
|
55
|
+
PID=$(get_pid)
|
56
|
+
=======
|
57
|
+
PID=$(gid_pid)
|
58
|
+
>>>>>>> 26fafb3... CHEF-1938, add boot scripts for archlinux
|
59
|
+
[ ! -z "$PID" ] && kill $PID &> /dev/null
|
60
|
+
if [ $? -gt 0 ]; then
|
61
|
+
stat_fail
|
62
|
+
exit 1
|
63
|
+
else
|
64
|
+
rm -f $PIDF &>/dev/null
|
65
|
+
rm_daemon $daemon_name
|
66
|
+
stat_done
|
67
|
+
fi
|
68
|
+
;;
|
69
|
+
|
70
|
+
restart)
|
71
|
+
$0 stop
|
72
|
+
[ -n "$DIETIME" ] && sleep $DIETIME
|
73
|
+
$0 start
|
74
|
+
[ -n "$STARTTIME" ] && sleep $STARTTIME
|
75
|
+
;;
|
76
|
+
status)
|
77
|
+
stat_busy "Checking $daemon_name status";
|
78
|
+
ck_status $daemon_name
|
79
|
+
;;
|
80
|
+
*)
|
81
|
+
echo "usage: $) {start|stop|restart|status}"
|
82
|
+
esac
|
@@ -0,0 +1,82 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
#
|
3
|
+
# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
daemon_bin="/usr/bin/chef-server-webui"
|
19
|
+
daemon_name=$(basename $daemon_bin)
|
20
|
+
PIDF="/var/run/$daemon_name.pid"
|
21
|
+
|
22
|
+
. /etc/rc.conf
|
23
|
+
. /etc/rc.d/functions
|
24
|
+
. /etc/conf.d/$daemon_name.conf
|
25
|
+
|
26
|
+
get_pid() {
|
27
|
+
pidof -o %PPID $daemon_name
|
28
|
+
}
|
29
|
+
|
30
|
+
case "$1" in
|
31
|
+
start)
|
32
|
+
stat_busy "Starting $daemon_name"
|
33
|
+
PID=$(get_pid)
|
34
|
+
if [ -z "$PID" ]; then
|
35
|
+
[ -f $PIDF ] && rm -f $PIDF
|
36
|
+
$daemon_bin -P $PIDF $CHEF_SERVER_WEBUI_ARGS
|
37
|
+
[ -n "$STARTTIME" ] && sleep $STARTTIME
|
38
|
+
if [ $? -gt 0 ]; then
|
39
|
+
stat_fail
|
40
|
+
exit 1
|
41
|
+
else
|
42
|
+
echo $(get_pid) > $PIDF
|
43
|
+
add_daemon $daemon_name
|
44
|
+
stat_done
|
45
|
+
fi
|
46
|
+
else
|
47
|
+
stat_fail
|
48
|
+
exit 1
|
49
|
+
fi
|
50
|
+
;;
|
51
|
+
|
52
|
+
stop)
|
53
|
+
stat_busy "Stopping $daemon_name daemon"
|
54
|
+
<<<<<<< HEAD
|
55
|
+
PID=$(get_pid)
|
56
|
+
=======
|
57
|
+
PID=$(gid_pid)
|
58
|
+
>>>>>>> 26fafb3... CHEF-1938, add boot scripts for archlinux
|
59
|
+
[ ! -z "$PID" ] && kill $PID &> /dev/null
|
60
|
+
if [ $? -gt 0 ]; then
|
61
|
+
stat_fail
|
62
|
+
exit 1
|
63
|
+
else
|
64
|
+
rm -f $PIDF &>/dev/null
|
65
|
+
rm_daemon $daemon_name
|
66
|
+
stat_done
|
67
|
+
fi
|
68
|
+
;;
|
69
|
+
|
70
|
+
restart)
|
71
|
+
$0 stop
|
72
|
+
[ -n "$DIETIME" ] && sleep $DIETIME
|
73
|
+
$0 start
|
74
|
+
[ -n "$STARTTIME" ] && sleep $STARTTIME
|
75
|
+
;;
|
76
|
+
status)
|
77
|
+
stat_busy "Checking $daemon_name status";
|
78
|
+
ck_status $daemon_name
|
79
|
+
;;
|
80
|
+
*)
|
81
|
+
echo "usage: $) {start|stop|restart|status}"
|
82
|
+
esac
|
@@ -0,0 +1,82 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
#
|
3
|
+
# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
daemon_bin="/usr/bin/chef-solr"
|
19
|
+
daemon_name=$(basename $daemon_bin)
|
20
|
+
PIDF="/var/run/$daemon_name.pid"
|
21
|
+
|
22
|
+
. /etc/rc.conf
|
23
|
+
. /etc/rc.d/functions
|
24
|
+
. /etc/conf.d/$daemon_name.conf
|
25
|
+
|
26
|
+
get_pid() {
|
27
|
+
pidof -o %PPID $daemon_name
|
28
|
+
}
|
29
|
+
|
30
|
+
case "$1" in
|
31
|
+
start)
|
32
|
+
stat_busy "Starting $daemon_name"
|
33
|
+
PID=$(get_pid)
|
34
|
+
if [ -z "$PID" ]; then
|
35
|
+
[ -f $PIDF ] && rm -f $PIDF
|
36
|
+
$daemon_bin -P $PIDF $CHEF_SOLR_ARGS
|
37
|
+
[ -n "$STARTTIME" ] && sleep $STARTTIME
|
38
|
+
if [ $? -gt 0 ]; then
|
39
|
+
stat_fail
|
40
|
+
exit 1
|
41
|
+
else
|
42
|
+
echo $(get_pid) > $PIDF
|
43
|
+
add_daemon $daemon_name
|
44
|
+
stat_done
|
45
|
+
fi
|
46
|
+
else
|
47
|
+
stat_fail
|
48
|
+
exit 1
|
49
|
+
fi
|
50
|
+
;;
|
51
|
+
|
52
|
+
stop)
|
53
|
+
stat_busy "Stopping $daemon_name daemon"
|
54
|
+
<<<<<<< HEAD
|
55
|
+
PID=$(get_pid)
|
56
|
+
=======
|
57
|
+
PID=$(gid_pid)
|
58
|
+
>>>>>>> 26fafb3... CHEF-1938, add boot scripts for archlinux
|
59
|
+
[ ! -z "$PID" ] && kill $PID &> /dev/null
|
60
|
+
if [ $? -gt 0 ]; then
|
61
|
+
stat_fail
|
62
|
+
exit 1
|
63
|
+
else
|
64
|
+
rm -f $PIDF &>/dev/null
|
65
|
+
rm_daemon $daemon_name
|
66
|
+
stat_done
|
67
|
+
fi
|
68
|
+
;;
|
69
|
+
|
70
|
+
restart)
|
71
|
+
$0 stop
|
72
|
+
[ -n "$DIETIME" ] && sleep $DIETIME
|
73
|
+
$0 start
|
74
|
+
[ -n "$STARTTIME" ] && sleep $STARTTIME
|
75
|
+
;;
|
76
|
+
status)
|
77
|
+
stat_busy "Checking $daemon_name status";
|
78
|
+
ck_status $daemon_name
|
79
|
+
;;
|
80
|
+
*)
|
81
|
+
echo "usage: $) {start|stop|restart|status}"
|
82
|
+
esac
|
@@ -0,0 +1,82 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
#
|
3
|
+
# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
daemon_bin="/usr/bin/chef-solr-indexer"
|
19
|
+
daemon_name=$(basename $daemon_bin)
|
20
|
+
PIDF="/var/run/$daemon_name.pid"
|
21
|
+
|
22
|
+
. /etc/rc.conf
|
23
|
+
. /etc/rc.d/functions
|
24
|
+
. /etc/conf.d/$daemon_name.conf
|
25
|
+
|
26
|
+
get_pid() {
|
27
|
+
pidof -o %PPID $daemon_name
|
28
|
+
}
|
29
|
+
|
30
|
+
case "$1" in
|
31
|
+
start)
|
32
|
+
stat_busy "Starting $daemon_name"
|
33
|
+
PID=$(get_pid)
|
34
|
+
if [ -z "$PID" ]; then
|
35
|
+
[ -f $PIDF ] && rm -f $PIDF
|
36
|
+
$daemon_bin -P $PIDF $CHEF_SOLR_INDEXER_ARGS
|
37
|
+
[ -n "$STARTTIME" ] && sleep $STARTTIME
|
38
|
+
if [ $? -gt 0 ]; then
|
39
|
+
stat_fail
|
40
|
+
exit 1
|
41
|
+
else
|
42
|
+
echo $(get_pid) > $PIDF
|
43
|
+
add_daemon $daemon_name
|
44
|
+
stat_done
|
45
|
+
fi
|
46
|
+
else
|
47
|
+
stat_fail
|
48
|
+
exit 1
|
49
|
+
fi
|
50
|
+
;;
|
51
|
+
|
52
|
+
stop)
|
53
|
+
stat_busy "Stopping $daemon_name daemon"
|
54
|
+
<<<<<<< HEAD
|
55
|
+
PID=$(get_pid)
|
56
|
+
=======
|
57
|
+
PID=$(gid_pid)
|
58
|
+
>>>>>>> 26fafb3... CHEF-1938, add boot scripts for archlinux
|
59
|
+
[ ! -z "$PID" ] && kill $PID &> /dev/null
|
60
|
+
if [ $? -gt 0 ]; then
|
61
|
+
stat_fail
|
62
|
+
exit 1
|
63
|
+
else
|
64
|
+
rm -f $PIDF &>/dev/null
|
65
|
+
rm_daemon $daemon_name
|
66
|
+
stat_done
|
67
|
+
fi
|
68
|
+
;;
|
69
|
+
|
70
|
+
restart)
|
71
|
+
$0 stop
|
72
|
+
[ -n "$DIETIME" ] && sleep $DIETIME
|
73
|
+
$0 start
|
74
|
+
[ -n "$STARTTIME" ] && sleep $STARTTIME
|
75
|
+
;;
|
76
|
+
status)
|
77
|
+
stat_busy "Checking $daemon_name status";
|
78
|
+
ck_status $daemon_name
|
79
|
+
;;
|
80
|
+
*)
|
81
|
+
echo "usage: $) {start|stop|restart|status}"
|
82
|
+
esac
|