Debugging Replicated with Upstart

The Replicated install script will configure the Replicated daemon, UI, and operator containers to be managed by the Upstart init system on certain operating systems.

To determine if Upstart is managing Replicated, check for the file /etc/init/replicated.conf.

In cases where there are issues with Replicated itself, you can configure the Upstart script to preserve the logs from the Replicated containers. Add the line exec >>/opt/replicated/replicated.log 2>&1 to /etc/init/replicated.conf:

script
    . /etc/default/replicated
    exec >>/opt/replicated/replicated.log 2>&1
    exec su -s /bin/sh -c 'exec "$0" "$@"' replicated -- /usr/bin/docker run --name=replicated-ui \

Be sure to mkdir -p /opt/replicated then run initctl reload replicated, initctl stop replicated, and initctl start replicated to begin preserving the logs. You can add similar lines to /etc/init/replicated-operator.conf and /etc/init/replicated-ui.conf to preserve the logs from those containers.

You may also be interested in viewing the events handled by Upstart. Use this command to filter logs from the Upstart daemon and send them to another file for review:

sudo tail -f /var/log/messages | grep "init:" > /opt/replicated/upstart.log

If the Replicated service is not running, the upstart log may show an error like replicated respawning too fast, stopped. After fixing the issue that is causing Replicated to crash, you could run initctl start replicated to tell Upstart to begin running the service again.