chef 0.7.10 → 0.7.12
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/distro/debian/etc/init.d/chef-client +175 -0
- data/distro/debian/etc/init.d/chef-indexer +175 -0
- data/distro/debian/etc/init.d/chef-server +120 -0
- data/distro/debian/man/man1/chef-indexer.1 +42 -0
- data/distro/debian/man/man1/chef-server.1 +108 -0
- data/distro/debian/man/man8/chef-client.8 +61 -0
- data/distro/debian/man/man8/chef-solo.8 +58 -0
- data/distro/redhat/etc/chef/client.rb +16 -0
- data/distro/redhat/etc/chef/indexer.rb +10 -0
- data/distro/redhat/etc/chef/server.rb +22 -0
- data/distro/redhat/etc/init.d/chef-client +74 -0
- data/distro/redhat/etc/init.d/chef-indexer +76 -0
- data/distro/redhat/etc/init.d/chef-server +77 -0
- data/lib/chef.rb +1 -1
- data/lib/chef/client.rb +33 -8
- data/lib/chef/compile.rb +34 -2
- data/lib/chef/cookbook.rb +29 -2
- data/lib/chef/cookbook_loader.rb +61 -49
- data/lib/chef/couchdb.rb +7 -3
- data/lib/chef/mixin/command.rb +67 -32
- data/lib/chef/mixin/convert_to_class_name.rb +48 -0
- data/lib/chef/mixin/find_preferred_file.rb +5 -14
- data/lib/chef/mixin/from_file.rb +14 -0
- data/lib/chef/mixin/generate_url.rb +2 -1
- data/lib/chef/mixin/recipe_definition_dsl_core.rb +77 -0
- data/lib/chef/platform.rb +1 -1
- data/lib/chef/provider.rb +63 -2
- data/lib/chef/provider/cron.rb +75 -25
- data/lib/chef/provider/deploy.rb +281 -0
- data/lib/chef/provider/deploy/revision.rb +70 -0
- data/lib/chef/provider/deploy/timestamped.rb +33 -0
- data/lib/chef/provider/git.rb +194 -0
- data/lib/chef/provider/group.rb +2 -2
- data/lib/chef/provider/group/gpasswd.rb +50 -0
- data/lib/chef/provider/group/groupadd.rb +2 -16
- data/lib/chef/provider/group/usermod.rb +57 -0
- data/lib/chef/provider/ifconfig.rb +3 -3
- data/lib/chef/provider/mount.rb +0 -4
- data/lib/chef/provider/mount/mount.rb +2 -2
- data/lib/chef/provider/package.rb +2 -2
- data/lib/chef/provider/package/apt.rb +4 -4
- data/lib/chef/provider/package/dpkg.rb +9 -13
- data/lib/chef/provider/package/freebsd.rb +6 -6
- data/lib/chef/provider/package/macports.rb +4 -4
- data/lib/chef/provider/package/portage.rb +3 -3
- data/lib/chef/provider/package/rpm.rb +4 -4
- data/lib/chef/provider/package/rubygems.rb +10 -4
- data/lib/chef/provider/package/yum.rb +6 -6
- data/lib/chef/provider/remote_file.rb +14 -7
- data/lib/chef/provider/service.rb +8 -2
- data/lib/chef/provider/service/freebsd.rb +1 -1
- data/lib/chef/provider/service/init.rb +8 -63
- data/lib/chef/provider/service/redhat.rb +2 -2
- data/lib/chef/provider/service/simple.rb +115 -0
- data/lib/chef/provider/subversion.rb +145 -0
- data/lib/chef/provider/template.rb +2 -0
- data/lib/chef/provider/user.rb +2 -2
- data/lib/chef/recipe.rb +9 -75
- data/lib/chef/resource.rb +131 -7
- data/lib/chef/resource/cron.rb +36 -0
- data/lib/chef/resource/deploy.rb +360 -0
- data/lib/chef/resource/deploy_revision.rb +35 -0
- data/lib/chef/resource/git.rb +36 -0
- data/lib/chef/resource/group.rb +2 -0
- data/lib/chef/resource/scm.rb +129 -0
- data/lib/chef/resource/subversion.rb +33 -0
- data/lib/chef/resource/timestamped_deploy.rb +31 -0
- data/lib/chef/resource_collection.rb +32 -4
- data/lib/chef/runner.rb +35 -28
- metadata +40 -11
@@ -0,0 +1,42 @@
|
|
1
|
+
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
|
2
|
+
.TH CHEF-INDEXER: "1" "August 2009" "chef-indexer 0.7.8" "User Commands"
|
3
|
+
.SH NAME
|
4
|
+
chef-indexer: \- Runs the search index process.
|
5
|
+
.SH SYNOPSIS
|
6
|
+
.B chef-indexer
|
7
|
+
\fI(options)\fR
|
8
|
+
.SH DESCRIPTION
|
9
|
+
.TP
|
10
|
+
chef-indexer requires that the stompserver be started but at this time the stompserver package does not install a startup script, let alone start the daemon. I am working with the package maintainer for stompserver to include a startup script.
|
11
|
+
\fB\-c\fR, \fB\-\-config\fR CONFIG
|
12
|
+
The configuration file to use
|
13
|
+
.TP
|
14
|
+
\fB\-d\fR, \fB\-\-daemonize\fR
|
15
|
+
Daemonize the process
|
16
|
+
.TP
|
17
|
+
\fB\-g\fR, \fB\-\-group\fR GROUP
|
18
|
+
Group to change gid to before daemonizing
|
19
|
+
.TP
|
20
|
+
\fB\-l\fR, \fB\-\-log_level\fR LEVEL
|
21
|
+
Set the log level (debug, info, warn, error, fatal)
|
22
|
+
.TP
|
23
|
+
\fB\-L\fR, \fB\-\-logfile\fR LOGLOCATION
|
24
|
+
Set the log file location, defaults to STDOUT \- recommended for daemonizing
|
25
|
+
.TP
|
26
|
+
\fB\-u\fR, \fB\-\-user\fR USER
|
27
|
+
User to change uid to before daemonizing
|
28
|
+
.TP
|
29
|
+
\fB\-v\fR, \fB\-\-version\fR
|
30
|
+
Show chef version
|
31
|
+
.TP
|
32
|
+
\fB\-h\fR, \fB\-\-help\fR
|
33
|
+
Show this message
|
34
|
+
.SH "SEE ALSO"
|
35
|
+
Full documentation for Chef and chef-indexer is located on the Chef wiki, http://wiki.opscode.com/display/chef/Home.
|
36
|
+
.SH AUTHOR
|
37
|
+
Chef was written by Adam Jacob <adam@ospcode.com> of Opscode (http://www.opscode.com), with contributions from the community.
|
38
|
+
This manual page was written by Joshua Timberman <joshua@opscode.com> with help2man. Permission is granted
|
39
|
+
to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
|
40
|
+
|
41
|
+
On Debian systems, the complete text of the Apache 2.0 License can be found in
|
42
|
+
/usr/share/common-licenses/Apache-2.0.
|
@@ -0,0 +1,108 @@
|
|
1
|
+
.\" DO NOT MODIFY THIS FILE! It was generated by help2man.
|
2
|
+
.TH CHEF-SERVER "1" "August 2009" "chef-server" "User Commands"
|
3
|
+
.SH NAME
|
4
|
+
chef-server \- Start the Chef Server merb application slice.
|
5
|
+
.SH SYNOPSIS
|
6
|
+
.B chef-server
|
7
|
+
[\fIuGdcIpPhmailLerkKX\fR] [\fIargument\fR]
|
8
|
+
.SH DESCRIPTION
|
9
|
+
The Chef Server is a Merb application slice. Both chef-server and chef-server-slice packages should be installed. This man page was generated for merb and generated for chef-server.
|
10
|
+
The default listen port is 4000. At a minimum, chef-server should be started with \-c2 so one process starts for the webui (4000) and one process starts for openid (4001).
|
11
|
+
.TP
|
12
|
+
\fB\-u\fR, \fB\-\-user\fR USER
|
13
|
+
This flag is for having chef-server run as a user other than the one currently logged in. Note: if you set this you must also provide a \fB\-\-group\fR option for it to take effect.
|
14
|
+
.TP
|
15
|
+
\fB\-G\fR, \fB\-\-group\fR GROUP
|
16
|
+
This flag is for having chef-server run as a group other than the one currently logged in. Note: if you set this you must also provide a \fB\-\-user\fR option for it to take effect.
|
17
|
+
.TP
|
18
|
+
\fB\-d\fR, \fB\-\-daemonize\fR
|
19
|
+
This will run a single chef-server in the background.
|
20
|
+
.TP
|
21
|
+
\fB\-N\fR, \fB\-\-no\-daemonize\fR
|
22
|
+
This will allow you to run a cluster in console mode
|
23
|
+
.TP
|
24
|
+
\fB\-c\fR, \fB\-\-cluster\-nodes\fR NUM_MERBS
|
25
|
+
Number of merb daemons to run for chef-server. At least 2 are required to run, the second is for openid (runs on port 4001).
|
26
|
+
.TP
|
27
|
+
\fB\-I\fR, \fB\-\-init\-file\fR FILE
|
28
|
+
File to use for initialization on load, defaults to config/init.rb
|
29
|
+
.TP
|
30
|
+
\fB\-p\fR, \fB\-\-port\fR PORTNUM
|
31
|
+
Port to run chef-server on, defaults to 4000. Additional nodes (\-c) listen on incrementing port numbers.
|
32
|
+
.TP
|
33
|
+
\fB\-o\fR, \fB\-\-socket\-file\fR FILE
|
34
|
+
Socket file to run chef-server on, defaults to [Merb.root]/log/merb.sock. This is for web servers, like thin, that use sockets.Specify this *only* if you *must*.
|
35
|
+
.TP
|
36
|
+
\fB\-s\fR, \fB\-\-socket\fR SOCKNUM
|
37
|
+
Socket number to run chef-server on, defaults to 0.
|
38
|
+
.TP
|
39
|
+
\fB\-n\fR, \fB\-\-name\fR NAME
|
40
|
+
Set the name of the application. This is used in the process title and log file names.
|
41
|
+
.TP
|
42
|
+
\fB\-P\fR, \fB\-\-pid\fR PIDFILE
|
43
|
+
PID file, defaults to [Merb.root]/log/merb.main.pid for the master process and[Merb.root]/log/merb.[port number].pid for worker processes. For clusters, use %s to specify where in the file chef-server should place the port number. For instance: \fB\-P\fR myapp.%s.pid
|
44
|
+
.TP
|
45
|
+
\fB\-h\fR, \fB\-\-host\fR HOSTNAME
|
46
|
+
Host to bind to (default is 0.0.0.0).
|
47
|
+
.HP
|
48
|
+
\fB\-m\fR, \fB\-\-merb\-root\fR /path/to/approot The path to the Merb.root for the app you want to run (default is current working directory).
|
49
|
+
.TP
|
50
|
+
\fB\-a\fR, \fB\-\-adapter\fR ADAPTER
|
51
|
+
The rack adapter to use to run chef-server (default is mongrel)[mongrel, emongrel, thin, ebb, fastcgi, webrick]
|
52
|
+
.TP
|
53
|
+
\fB\-R\fR, \fB\-\-rackup\fR FILE
|
54
|
+
Load an alternate Rack config file (default is config/rack.rb)
|
55
|
+
.TP
|
56
|
+
\fB\-i\fR, \fB\-\-irb\-console\fR
|
57
|
+
This flag will start chef-server in irb console mode. All your models and other classes will be available for you in an irb session.
|
58
|
+
.TP
|
59
|
+
\fB\-S\fR, \fB\-\-sandbox\fR
|
60
|
+
This flag will enable a sandboxed irb console. If your ORM supports transactions, all edits will be rolled back on exit.
|
61
|
+
.TP
|
62
|
+
\fB\-l\fR, \fB\-\-log\-level\fR LEVEL
|
63
|
+
Log levels can be set to any of these options: debug < info < warn < error < fatal (default is info)
|
64
|
+
.TP
|
65
|
+
\fB\-L\fR, \fB\-\-log\fR LOGFILE
|
66
|
+
A string representing the logfile to use. Defaults to [Merb.root]/log/merb.[main].log for the master process and [Merb.root]/log/merb[port number].logfor worker processes
|
67
|
+
.TP
|
68
|
+
\fB\-e\fR, \fB\-\-environment\fR STRING
|
69
|
+
Environment to run Merb under [development, production, testing] (default is development)
|
70
|
+
.HP
|
71
|
+
\fB\-r\fR ['RUBY CODE'| FULL_SCRIPT_PATH]
|
72
|
+
.TP
|
73
|
+
\fB\-\-script\-runner\fR
|
74
|
+
Command\-line option to run scripts and/or code in the chef-server app.
|
75
|
+
.TP
|
76
|
+
\fB\-K\fR, \fB\-\-graceful\fR PORT or all
|
77
|
+
Gracefully kill chef-server proceses by port number. Use chef-server \fB\-K\fR all to gracefully kill all merbs.
|
78
|
+
.TP
|
79
|
+
\fB\-k\fR, \fB\-\-kill\fR PORT
|
80
|
+
Force kill one merb worker by port number. This will cause the worker tobe respawned.
|
81
|
+
.TP
|
82
|
+
\fB\-\-fast\-deploy\fR
|
83
|
+
Reload the code, but not yourinit.rb or gems
|
84
|
+
.TP
|
85
|
+
\fB\-X\fR, \fB\-\-mutex\fR on/off
|
86
|
+
This flag is for turning the mutex lock on and off.
|
87
|
+
.TP
|
88
|
+
\fB\-D\fR, \fB\-\-debugger\fR
|
89
|
+
Run chef-server using rDebug.
|
90
|
+
.TP
|
91
|
+
\fB\-V\fR, \fB\-\-verbose\fR
|
92
|
+
Print extra information
|
93
|
+
.TP
|
94
|
+
\fB\-C\fR, \fB\-\-console\-trap\fR
|
95
|
+
Enter an irb console on ^C
|
96
|
+
.TP
|
97
|
+
\-?, \fB\-H\fR, \fB\-\-help\fR
|
98
|
+
Show this help message
|
99
|
+
.SH "SEE ALSO"
|
100
|
+
Full documentation for Chef and chef-server is located on the Chef wiki, http://wiki.opscode.com/display/chef/Home.
|
101
|
+
.SH AUTHOR
|
102
|
+
Chef was written by Adam Jacob <adam@ospcode.com> of Opscode (http://www.opscode.com), with contributions from the community.
|
103
|
+
This manual page was written by Joshua Timberman <joshua@opscode.com> with help2man
|
104
|
+
for the Debian project (but may be used by others).. Permission is granted
|
105
|
+
to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
|
106
|
+
|
107
|
+
On Debian systems, the complete text of the Apache 2.0 License can be found in
|
108
|
+
/usr/share/common-licenses/Apache-2.0.
|
@@ -0,0 +1,61 @@
|
|
1
|
+
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
|
2
|
+
.TH CHEF-CLIENT: "8" "August 2009" "chef-client 0.7.8" "System Administration Utilities"
|
3
|
+
.SH NAME
|
4
|
+
chef-client: \- Runs a client node connecting to a chef-server.
|
5
|
+
.SH SYNOPSIS
|
6
|
+
.B chef-client
|
7
|
+
\fI(options)\fR
|
8
|
+
.SH DESCRIPTION
|
9
|
+
.TP
|
10
|
+
\fB\-S\fR, \fB\-\-server\fR CHEFSERVERURL
|
11
|
+
The chef server URL
|
12
|
+
.TP
|
13
|
+
\fB\-c\fR, \fB\-\-config\fR CONFIG
|
14
|
+
The configuration file to use
|
15
|
+
.TP
|
16
|
+
\fB\-d\fR, \fB\-\-daemonize\fR
|
17
|
+
Daemonize the process
|
18
|
+
.TP
|
19
|
+
\fB\-g\fR, \fB\-\-group\fR GROUP
|
20
|
+
Group to set privilege to
|
21
|
+
.TP
|
22
|
+
\fB\-i\fR, \fB\-\-interval\fR SECONDS
|
23
|
+
Run chef\-client periodically, in seconds
|
24
|
+
.TP
|
25
|
+
\fB\-j\fR JSON_ATTRIBS
|
26
|
+
Load attributes from a JSON file or URL
|
27
|
+
.HP
|
28
|
+
\fB\-\-json\-attributes\fR
|
29
|
+
.TP
|
30
|
+
\fB\-l\fR, \fB\-\-log_level\fR LEVEL
|
31
|
+
Set the log level (debug, info, warn, error, fatal)
|
32
|
+
.TP
|
33
|
+
\fB\-L\fR, \fB\-\-logfile\fR LOGLOCATION
|
34
|
+
Set the log file location, defaults to STDOUT \- recommended for daemonizing
|
35
|
+
.TP
|
36
|
+
\fB\-N\fR, \fB\-\-node\-name\fR NODE_NAME
|
37
|
+
The node name for this client
|
38
|
+
.TP
|
39
|
+
\fB\-s\fR, \fB\-\-splay\fR SECONDS
|
40
|
+
The splay time for running at intervals, in seconds
|
41
|
+
.TP
|
42
|
+
\fB\-u\fR, \fB\-\-user\fR USER
|
43
|
+
User to set privilege to
|
44
|
+
.TP
|
45
|
+
\fB\-t\fR, \fB\-\-token\fR TOKEN
|
46
|
+
Set the openid validation token
|
47
|
+
.TP
|
48
|
+
\fB\-v\fR, \fB\-\-version\fR
|
49
|
+
Show chef version
|
50
|
+
.TP
|
51
|
+
\fB\-h\fR, \fB\-\-help\fR
|
52
|
+
Show this message
|
53
|
+
.SH "SEE ALSO"
|
54
|
+
Full documentation for Chef and chef-client is located on the Chef wiki, http://wiki.opscode.com/display/chef/Home.
|
55
|
+
.SH AUTHOR
|
56
|
+
Chef was written by Adam Jacob <adam@ospcode.com> of Opscode (http://www.opscode.com), with contributions from the community.
|
57
|
+
This manual page was written by Joshua Timberman <joshua@opscode.com> with help2man. Permission is granted
|
58
|
+
to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
|
59
|
+
|
60
|
+
On Debian systems, the complete text of the Apache 2.0 License can be found in
|
61
|
+
/usr/share/common-licenses/Apache-2.0.
|
@@ -0,0 +1,58 @@
|
|
1
|
+
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
|
2
|
+
.TH CHEF-SOLO: "8" "August 2009" "chef-solo 0.7.8" "System Administration Utilities"
|
3
|
+
.SH NAME
|
4
|
+
chef-solo: \- Runs chef in solo mode against a specified cookbook location.
|
5
|
+
.SH SYNOPSIS
|
6
|
+
.B chef-solo
|
7
|
+
\fI(options)\fR
|
8
|
+
.SH DESCRIPTION
|
9
|
+
.TP
|
10
|
+
\fB\-c\fR, \fB\-\-config\fR CONFIG
|
11
|
+
The configuration file to use
|
12
|
+
.TP
|
13
|
+
\fB\-d\fR, \fB\-\-daemonize\fR
|
14
|
+
Daemonize the process
|
15
|
+
.TP
|
16
|
+
\fB\-g\fR, \fB\-\-group\fR GROUP
|
17
|
+
Group to set privilege to
|
18
|
+
.TP
|
19
|
+
\fB\-i\fR, \fB\-\-interval\fR SECONDS
|
20
|
+
Run chef\-client periodically, in seconds
|
21
|
+
.TP
|
22
|
+
\fB\-j\fR JSON_ATTRIBS
|
23
|
+
Load attributes from a JSON file or URL
|
24
|
+
.HP
|
25
|
+
\fB\-\-json\-attributes\fR
|
26
|
+
.TP
|
27
|
+
\fB\-l\fR, \fB\-\-log_level\fR LEVEL
|
28
|
+
Set the log level (debug, info, warn, error, fatal)
|
29
|
+
.TP
|
30
|
+
\fB\-L\fR, \fB\-\-logfile\fR LOGLOCATION
|
31
|
+
Set the log file location, defaults to STDOUT
|
32
|
+
.TP
|
33
|
+
\fB\-N\fR, \fB\-\-node\-name\fR NODE_NAME
|
34
|
+
The node name for this client
|
35
|
+
.TP
|
36
|
+
\fB\-r\fR, \fB\-\-recipe\-url\fR RECIPE_URL
|
37
|
+
Pull down a remote gzipped tarball of recipes and untar it to the cookbook cache.
|
38
|
+
.TP
|
39
|
+
\fB\-s\fR, \fB\-\-splay\fR SECONDS
|
40
|
+
The splay time for running at intervals, in seconds
|
41
|
+
.TP
|
42
|
+
\fB\-u\fR, \fB\-\-user\fR USER
|
43
|
+
User to set privilege to
|
44
|
+
.TP
|
45
|
+
\fB\-v\fR, \fB\-\-version\fR
|
46
|
+
Show chef version
|
47
|
+
.TP
|
48
|
+
\fB\-h\fR, \fB\-\-help\fR
|
49
|
+
Show this message
|
50
|
+
.SH "SEE ALSO"
|
51
|
+
Full documentation for Chef and chef-solo is located on the Chef wiki, http://wiki.opscode.com/display/chef/Home.
|
52
|
+
.SH AUTHOR
|
53
|
+
Chef was written by Adam Jacob <adam@ospcode.com> of Opscode (http://www.opscode.com), with contributions from the community.
|
54
|
+
This manual page was written by Joshua Timberman <joshua@opscode.com> with help2man. Permission is granted
|
55
|
+
to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
|
56
|
+
|
57
|
+
On Debian systems, the complete text of the Apache 2.0 License can be found in
|
58
|
+
/usr/share/common-licenses/Apache-2.0.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#
|
2
|
+
# Chef Client Config File
|
3
|
+
#
|
4
|
+
|
5
|
+
log_level :info
|
6
|
+
ssl_verify_mode :verify_none
|
7
|
+
registration_url "http://127.0.0.1:4000"
|
8
|
+
openid_url "http://127.0.0.1:4001"
|
9
|
+
template_url "http://127.0.0.1:4000"
|
10
|
+
remotefile_url "http://127.0.0.1:4000"
|
11
|
+
search_url "http://127.0.0.1:4000"
|
12
|
+
|
13
|
+
pid_file "/var/run/chef/chef-client.pid"
|
14
|
+
|
15
|
+
#interval 1800
|
16
|
+
#splay 0
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#
|
2
|
+
# Chef Server Config File
|
3
|
+
#
|
4
|
+
|
5
|
+
log_level :info
|
6
|
+
ssl_verify_mode :verify_none
|
7
|
+
registration_url "http://cserver:4000"
|
8
|
+
openid_url "http://cserver:4001"
|
9
|
+
template_url "http://cserver:4000"
|
10
|
+
remotefile_url "http://cserver:4000"
|
11
|
+
search_url "http://cserver:4000"
|
12
|
+
cookbook_path [ "/var/lib/chef/site-cookbooks", "/var/lib/chef/cookbooks" ]
|
13
|
+
|
14
|
+
merb_root "/var/lib/chef/merb"
|
15
|
+
node_path "/etc/chef/node"
|
16
|
+
file_store_path "/var/lib/chef/store"
|
17
|
+
search_index_path "/var/lib/chef/search_index"
|
18
|
+
openid_store_path "/var/lib/chef/openid/db"
|
19
|
+
openid_cstore_path "/var/lib/chef/openid/cstore"
|
20
|
+
file_cache_path "/var/lib/chef/cache"
|
21
|
+
|
22
|
+
Chef::Log::Formatter.show_time = false
|
@@ -0,0 +1,74 @@
|
|
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
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Startup script for chef-indexer
|
3
|
+
#
|
4
|
+
# chkconfig: - 75 25
|
5
|
+
# description: Server component of the Chef systems integration framework.
|
6
|
+
# processname: chef-indexer
|
7
|
+
#
|
8
|
+
# config: /etc/sysconfig/chef-indexer
|
9
|
+
# pidfile: /var/run/chef/chef-indexer.pid
|
10
|
+
|
11
|
+
# Source function library
|
12
|
+
. /etc/init.d/functions
|
13
|
+
|
14
|
+
[ -f /etc/sysconfig/chef-indexer ] && . /etc/sysconfig/chef-indexer
|
15
|
+
|
16
|
+
prog="chef-indexer"
|
17
|
+
PIDFILE=/var/run/chef/chef-indexer.pid
|
18
|
+
LOCKFILE=/var/lock/subsys/$prog
|
19
|
+
CONFIG=/etc/chef/indexer.rb
|
20
|
+
USER="chef"
|
21
|
+
GROUP="chef"
|
22
|
+
LOGFILE=/var/log/chef/chef-indexer.log
|
23
|
+
OPTIONS=
|
24
|
+
|
25
|
+
start() {
|
26
|
+
echo -n "Starting $prog:"
|
27
|
+
daemon chef-indexer -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 chef-indexer
|
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 chef-indexer
|
70
|
+
;;
|
71
|
+
*)
|
72
|
+
echo "Usage: $0 {start|stop|restart|condrestart|status}"
|
73
|
+
exit 1
|
74
|
+
esac
|
75
|
+
|
76
|
+
exit $RETVAL
|