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.
Files changed (127) hide show
  1. data/distro/arch/etc/conf.d/chef-client.conf +5 -0
  2. data/distro/arch/etc/conf.d/chef-server-webui.conf +10 -0
  3. data/distro/arch/etc/conf.d/chef-server.conf +10 -0
  4. data/distro/arch/etc/conf.d/chef-solr-indexer.conf +8 -0
  5. data/distro/arch/etc/conf.d/chef-solr.conf +8 -0
  6. data/distro/arch/etc/rc.d/chef-client +76 -0
  7. data/distro/arch/etc/rc.d/chef-server +82 -0
  8. data/distro/arch/etc/rc.d/chef-server-webui +82 -0
  9. data/distro/arch/etc/rc.d/chef-solr +82 -0
  10. data/distro/arch/etc/rc.d/chef-solr-indexer +82 -0
  11. data/distro/common/markdown/knife.mkd +34 -1
  12. data/distro/debian/etc/default/chef-solr +1 -0
  13. data/distro/debian/etc/init.d/chef-client +1 -1
  14. data/distro/debian/etc/init.d/chef-solr +39 -40
  15. data/distro/debian/etc/init.d/chef-solr-indexer +1 -1
  16. data/distro/redhat/etc/init.d/chef-client +1 -1
  17. data/lib/chef.rb +1 -0
  18. data/lib/chef/api_client.rb +1 -1
  19. data/lib/chef/application/agent.rb +1 -1
  20. data/lib/chef/application/client.rb +1 -1
  21. data/lib/chef/application/solo.rb +1 -1
  22. data/lib/chef/cookbook/metadata.rb +2 -2
  23. data/lib/chef/cookbook/syntax_check.rb +1 -1
  24. data/lib/chef/cookbook_version.rb +5 -1
  25. data/lib/chef/couchdb.rb +1 -1
  26. data/lib/chef/data_bag.rb +1 -1
  27. data/lib/chef/data_bag_item.rb +35 -9
  28. data/lib/chef/exceptions.rb +2 -0
  29. data/lib/chef/file_cache.rb +1 -1
  30. data/lib/chef/handler/json_file.rb +1 -1
  31. data/lib/chef/index_queue/amqp_client.rb +2 -2
  32. data/lib/chef/index_queue/consumer.rb +2 -2
  33. data/lib/chef/json.rb +52 -0
  34. data/lib/chef/knife.rb +6 -6
  35. data/lib/chef/knife/bluebox_images_list.rb +54 -0
  36. data/lib/chef/knife/bluebox_server_create.rb +157 -0
  37. data/lib/chef/knife/bluebox_server_delete.rb +63 -0
  38. data/lib/chef/knife/bluebox_server_list.rb +59 -0
  39. data/lib/chef/knife/bootstrap.rb +3 -1
  40. data/lib/chef/knife/bootstrap/archlinux-gems.erb +2 -2
  41. data/lib/chef/knife/bootstrap/centos5-gems.erb +2 -2
  42. data/lib/chef/knife/bootstrap/fedora13-gems.erb +1 -1
  43. data/lib/chef/knife/client_bulk_delete.rb +1 -1
  44. data/lib/chef/knife/client_create.rb +1 -1
  45. data/lib/chef/knife/client_delete.rb +1 -1
  46. data/lib/chef/knife/client_edit.rb +1 -1
  47. data/lib/chef/knife/client_list.rb +1 -1
  48. data/lib/chef/knife/client_reregister.rb +1 -1
  49. data/lib/chef/knife/client_show.rb +1 -1
  50. data/lib/chef/knife/cookbook_create.rb +1 -1
  51. data/lib/chef/knife/cookbook_list.rb +1 -1
  52. data/lib/chef/knife/cookbook_metadata.rb +1 -1
  53. data/lib/chef/knife/cookbook_show.rb +10 -18
  54. data/lib/chef/knife/cookbook_site_share.rb +1 -1
  55. data/lib/chef/knife/cookbook_site_vendor.rb +17 -11
  56. data/lib/chef/knife/ec2_instance_data.rb +1 -1
  57. data/lib/chef/knife/ec2_server_create.rb +8 -6
  58. data/lib/chef/knife/ec2_server_delete.rb +5 -8
  59. data/lib/chef/knife/ec2_server_list.rb +5 -4
  60. data/lib/chef/knife/exec.rb +1 -1
  61. data/lib/chef/knife/node_bulk_delete.rb +1 -1
  62. data/lib/chef/knife/node_create.rb +1 -1
  63. data/lib/chef/knife/node_delete.rb +1 -1
  64. data/lib/chef/knife/node_edit.rb +1 -1
  65. data/lib/chef/knife/node_from_file.rb +2 -2
  66. data/lib/chef/knife/node_list.rb +1 -1
  67. data/lib/chef/knife/node_run_list_add.rb +1 -1
  68. data/lib/chef/knife/node_run_list_remove.rb +1 -1
  69. data/lib/chef/knife/node_show.rb +1 -1
  70. data/lib/chef/knife/rackspace_server_create.rb +98 -70
  71. data/lib/chef/knife/rackspace_server_delete.rb +2 -2
  72. data/lib/chef/knife/rackspace_server_list.rb +2 -2
  73. data/lib/chef/knife/role_bulk_delete.rb +1 -1
  74. data/lib/chef/knife/role_create.rb +1 -1
  75. data/lib/chef/knife/role_delete.rb +1 -1
  76. data/lib/chef/knife/role_edit.rb +1 -1
  77. data/lib/chef/knife/role_from_file.rb +2 -2
  78. data/lib/chef/knife/role_list.rb +1 -1
  79. data/lib/chef/knife/role_show.rb +1 -1
  80. data/lib/chef/knife/slicehost_images_list.rb +2 -2
  81. data/lib/chef/knife/slicehost_server_create.rb +2 -2
  82. data/lib/chef/knife/slicehost_server_delete.rb +2 -2
  83. data/lib/chef/knife/slicehost_server_list.rb +2 -2
  84. data/lib/chef/knife/ssh.rb +36 -12
  85. data/lib/chef/knife/status.rb +1 -1
  86. data/lib/chef/knife/terremark_server_create.rb +1 -1
  87. data/lib/chef/knife/terremark_server_delete.rb +1 -1
  88. data/lib/chef/knife/terremark_server_list.rb +1 -1
  89. data/lib/chef/log.rb +31 -4
  90. data/lib/chef/mixin/command.rb +1 -1
  91. data/lib/chef/mixin/create_path.rb +1 -1
  92. data/lib/chef/mixin/recipe_definition_dsl_core.rb +1 -1
  93. data/lib/chef/monkey_patches/numeric.rb +7 -0
  94. data/lib/chef/node.rb +6 -8
  95. data/lib/chef/node/attribute.rb +24 -2
  96. data/lib/chef/openid_registration.rb +1 -1
  97. data/lib/chef/platform.rb +11 -0
  98. data/lib/chef/provider/breakpoint.rb +1 -1
  99. data/lib/chef/provider/cookbook_file.rb +1 -1
  100. data/lib/chef/provider/deploy/revision.rb +1 -1
  101. data/lib/chef/provider/deploy/timestamped.rb +1 -1
  102. data/lib/chef/provider/erl_call.rb +14 -2
  103. data/lib/chef/provider/git.rb +79 -55
  104. data/lib/chef/provider/group/pw.rb +1 -1
  105. data/lib/chef/provider/package/easy_install.rb +35 -13
  106. data/lib/chef/provider/service/debian.rb +65 -40
  107. data/lib/chef/provider/service/insserv.rb +52 -0
  108. data/lib/chef/provider/service/windows.rb +74 -57
  109. data/lib/chef/provider/subversion.rb +45 -10
  110. data/lib/chef/provider/user/pw.rb +1 -1
  111. data/lib/chef/providers.rb +1 -0
  112. data/lib/chef/resource/deploy_revision.rb +1 -1
  113. data/lib/chef/resource/easy_install_package.rb +16 -0
  114. data/lib/chef/resource/file.rb +8 -1
  115. data/lib/chef/resource_collection/stepable_iterator.rb +1 -1
  116. data/lib/chef/rest.rb +7 -7
  117. data/lib/chef/role.rb +2 -2
  118. data/lib/chef/run_status.rb +1 -1
  119. data/lib/chef/shef.rb +2 -2
  120. data/lib/chef/shef/ext.rb +2 -2
  121. data/lib/chef/shef/model_wrapper.rb +1 -1
  122. data/lib/chef/shef/shef_rest.rb +1 -1
  123. data/lib/chef/shef/shef_session.rb +13 -5
  124. data/lib/chef/tasks/chef_repo.rake +1 -1
  125. data/lib/chef/version.rb +1 -1
  126. data/lib/chef/webui_user.rb +1 -1
  127. metadata +329 -290
@@ -0,0 +1,5 @@
1
+ LOGFILE=/var/log/chef/client.log
2
+ CONFIG=/etc/chef/client.rb
3
+ INTERVAL=1800
4
+ SPLAY=20
5
+ CHEF_CLIENT_ARGS="-L $LOGFILE -d -c $CONFIG -i $INTERVAL -s $SPLAY"
@@ -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,8 @@
1
+ LOGFILE=/var/log/chef/solr-indexer.log
2
+ CONFIG=/etc/chef/solr.rb
3
+ USER=chef
4
+ GROUP=chef
5
+ # Sleep to give daemon enough time to fully start or stop.
6
+ DIETIME=5
7
+ STARTTIME=5
8
+ CHEF_SOLR_INDEXER_ARGS="-d -c $CONFIG -L $LOGFILE -u $USER -g $GROUP"
@@ -0,0 +1,8 @@
1
+ LOGFILE=/var/log/chef/solr.log
2
+ CONFIG=/etc/chef/solr.rb
3
+ USER=chef
4
+ GROUP=chef
5
+ # Sleep to give daemon enough time to fully start or stop.
6
+ DIETIME=5
7
+ STARTTIME=5
8
+ CHEF_SOLR_ARGS="-d -c $CONFIG -L $LOGFILE -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