Setup Consul, Consul-Template run in background with Ubuntu 14.04

Before reading this post, please take a look Install Consul and Consul Template in Ubuntu 14.04 to know how to installing Consul and Consul-Template. And now, this post will help you run them in background.

With Ubuntu 14.04, you should use Upstart to make your services run in background and on startup.

You create consul-server.conf file  at /etc/init/ directory with content:

And create consul-template.conf file at /etc/init/ directory with content:

Now, we run them:

You can troubleshoot your service by command tail -f upstart log files: