Merge pull request #3339 from jkohen/patch-1
[collectd.git] / contrib / upstart.collectd.conf
1 description "start/stop/control collectd"
2 # http://collectd.org/
3 # Upstart is the replacement init system used in Debian, Ubuntu,
4 # and in Fedora. Refer to http://upstart.ubuntu.com/cookbook/
5 #
6 # Normally this file will live as `/etc/init/collectd.conf`
7
8 usage "initctl <start|stop> collectd"
9 author "Dave Cottlehuber <dch@jsonified.com>"
10 version "1.1"
11
12 # There are a number of alternative start sequences however
13 # most of those do not work on all Ubuntu flavours and releases.
14 start on started networking and filesystem
15 stop on runlevel [!2345]
16
17 # collectd itself will run with reduced privileges, but not
18 # all plugins will. Test and edit as required.
19 # An alternative configuration is as a user script in ~/.init/ however
20 # these cannot be started at boot time by the system without
21 # arcane trickery. Also a root user will not see these tasks/jobs
22 # by default. set*id is a reasonable and secure compromise.
23 # These options are not supported on early upstart versions.
24 #setuid nobody
25 #setgid nobody
26
27 # Other parameters such as the path to the configuration file
28 # will have been compiled into the binary. These are trivially
29 # added as environment variables below, and then into both
30 # `pre-start` command check before collectd runs, and subsequent
31 # `exec` command parameters below. Remember that upstart runs all
32 # shell commands via `sh -e`.
33 env DAEMON=/usr/sbin/collectd
34
35 # Tell upstart to wait for collectd to SIGSTOP itself, signaling it is ready
36 # to run. Warning: this only works with collectd 5.5 and newer. You'll have to
37 # use "expect fork" instead, if using collectd 5.4 and older.
38 expect stop
39
40 # prevent thrashing - 10 restarts in 5 seconds
41 respawn
42 respawn limit 10 5
43
44 # Uncomment to make a log available in /var/log/upstart/collectd.log
45 # (not supported on early upstart versions).
46 #console log
47
48 # The daemon will not start if the configuration is invalid.
49 pre-start exec $DAEMON -t
50 # Let's start!
51 exec $DAEMON