Merge branch 'collectd-4.10' into collectd-5.3
[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 #setuid nobody
24 #setgid nobody
25
26 # Other parameters such as the path to the configuration file
27 # will have been compiled into the binary. These are trivially
28 # added as environment variables below, and then into both
29 # `pre-start` command check before collectd runs, and subsequent
30 # `exec` command parameters below. Remember that upstart runs all
31 # shell commands via `sh -e`.
32 env DAEMON=/usr/sbin/collectd
33
34 # Tell upstart to watch for forking when tracking the pid for us.
35 expect fork
36
37 # prevent thrashing - 10 restarts in 5 seconds
38 respawn
39 respawn limit 10 5
40
41 # Make a log available in /var/log/upstart/collectd.log
42 console log
43
44 # The daemon will not start if the configuration is invalid.
45 pre-start exec $DAEMON -t
46 # Let's Fork!
47 exec $DAEMON