azavea / ansible-statsite

An Ansible role to install Statsite.
Apache License 2.0
2 stars 2 forks source link

Does not work on systemd (ubuntu 15.10, next LTS) #5

Open gjcarneiro opened 8 years ago

gjcarneiro commented 8 years ago

I get this on Ubuntu 15.10:

RUNNING HANDLER [azavea.statsite : Restart Statsite] ***************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "systemd could not find the requested service \"'statsite'\": "}

That is because Ubuntu now uses systemd instead of upstart. The next LTS release. 16.04, is due shortly and it also uses systemd.

To make it work, we need install a file /lib/systemd/system/statsite.service containing:

[Unit]
Description=statsite is a metrics aggregation daemon
After=network.target

[Service]
Type=simple
WorkingDirectory = /var/lib/statsite
User=statsite
ExecStart=/usr/sbin/statsite -f /etc/statsite/statsite.cfg

[Install]
WantedBy=multi-user.target

I suggest you install both files in parallel, one for upstart, one for systemd. Then the system itself decides which to use, the other one ignored.

hectcastro commented 8 years ago

Thanks for taking the time to write this up. As of right now, this role only claims support for Ubuntu 14.04, but we are looking at adding support for 16.04 in the near future.

Before adding support for Xenial, I'd like to have better support for verifying that the role works on the operating systems we say it does. That'll probably mean adopting a testing mechanism better than a Vagrantfile within the examples subdirectory. Right now I'm taking a look at Molecule.