1 description "start/stop/control collectd"
3 # Upstart is the replacement init system used in Debian, Ubuntu,
4 # and in Fedora. Refer to http://upstart.ubuntu.com/cookbook/
6 # Normally this file will live as `/etc/init/collectd.conf`
8 usage "initctl <start|stop> collectd"
9 author "Dave Cottlehuber <dch@jsonified.com>"
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]
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.
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
34 # Tell upstart to watch for forking when tracking the pid for us.
37 # prevent thrashing - 10 restarts in 5 seconds
41 # Make a log available in /var/log/upstart/collectd.log
44 # The daemon will not start if the configuration is invalid.
45 pre-start exec $DAEMON -t