Start Sensu services at boot

Hi everyone,

I’m kind of newbie to Sensu so forgive me if I forgot a few things.

I’ve been trying to start sensu services at boot (sensu-client, api,etc) but they don’t start. According to the documentation, I have to use this command : update-rc.d sensu-client enable but it returns that error : **update-rc.d: error: cannot find a LSB script for sensu-client.
**So it appears Sensu uses systemd, so I ran this command : systemctl enable sensu-client.service and then ran : systemctl is-enabled sensu-client.service and it returned enabled. But when I reboot it doesn’t start Sensu services, I went to /etc/systemd/system/ and there was no systemd script to start Sensu. I used Google and find the sensu-build github which had systemd scripts but it appears that they are deprecated so what should I do to start Sensu services at boot ?

Here’s some info to help you :

OS: Debian 8 (fresh install)

Sensu version : 1.2.0

root@supervision:~# systemctl | grep sensu
sensu-api.service loaded active running sensu api
sensu-client.service loaded active running sensu client
sensu-server.service loaded active running sensu server

Thank you in advance !

systemctl status sensu-client

This will show you if the service is enabled. But I think you already checked that with a different command.

If it is enabled already, maybe you forgot to configure sensu. Check /var/log/sensu/sensu-client.log and see what is it complaining about.

If you want to look at systemd unit files, they have been moved in latest versions to /usr/lib/systemd/system/sensu*

···

On Monday, January 22, 2018 at 4:17:03 PM UTC+1, Bronsky Proco wrote:

Hi everyone,

I’m kind of newbie to Sensu so forgive me if I forgot a few things.

I’ve been trying to start sensu services at boot (sensu-client, api,etc) but they don’t start. According to the documentation, I have to use this command : update-rc.d sensu-client enable but it returns that error : **update-rc.d: error: cannot find a LSB script for sensu-client.
**So it appears Sensu uses systemd, so I ran this command : systemctl enable sensu-client.service and then ran : systemctl is-enabled sensu-client.service and it returned enabled. But when I reboot it doesn’t start Sensu services, I went to /etc/systemd/system/ and there was no systemd script to start Sensu. I used Google and find the sensu-build github which had systemd scripts but it appears that they are deprecated so what should I do to start Sensu services at boot ?

Here’s some info to help you :

OS: Debian 8 (fresh install)

Sensu version : 1.2.0

root@supervision:~# systemctl | grep sensu
sensu-api.service loaded active running sensu api
sensu-client.service loaded active running sensu client
sensu-server.service loaded active running sensu server

Thank you in advance !

Thanks for your answer Goyko !

Actually Sensu is working pretty great, no complaining in logs whatsoever but I just cant get Sensu services to start at boot.

I did search in /usr/lib/systemd/system but the system folder is missing :

root@superivison:/usr/lib/systemd# ls

catalog network ntp-units.d user user-generators

But I found the system scripts in /lib/systemd/system instead, but it appears that they need to be in /etc/systemd/system to ensure that Sensu services start at boot, so is this a normal behaviour or is there’s something wrong ?

Thanks in advance !

···

Le mardi 23 janvier 2018 14:59:39 UTC+1, Goyko a écrit :

systemctl status sensu-client

This will show you if the service is enabled. But I think you already checked that with a different command.

If it is enabled already, maybe you forgot to configure sensu. Check /var/log/sensu/sensu-client.log and see what is it complaining about.

If you want to look at systemd unit files, they have been moved in latest versions to /usr/lib/systemd/system/sensu*

On Monday, January 22, 2018 at 4:17:03 PM UTC+1, Bronsky Proco wrote:

Hi everyone,

I’m kind of newbie to Sensu so forgive me if I forgot a few things.

I’ve been trying to start sensu services at boot (sensu-client, api,etc) but they don’t start. According to the documentation, I have to use this command : update-rc.d sensu-client enable but it returns that error : **update-rc.d: error: cannot find a LSB script for sensu-client.
**So it appears Sensu uses systemd, so I ran this command : systemctl enable sensu-client.service and then ran : systemctl is-enabled sensu-client.service and it returned enabled. But when I reboot it doesn’t start Sensu services, I went to /etc/systemd/system/ and there was no systemd script to start Sensu. I used Google and find the sensu-build github which had systemd scripts but it appears that they are deprecated so what should I do to start Sensu services at boot ?

Here’s some info to help you :

OS: Debian 8 (fresh install)

Sensu version : 1.2.0

root@supervision:~# systemctl | grep sensu
sensu-api.service loaded active running sensu api
sensu-client.service loaded active running sensu client
sensu-server.service loaded active running sensu server

Thank you in advance !

What version of sensu are you running? I believe it was added in 0.27 if I recall correctly.

Not all distros agree on where to put files, for example you can find them on Ubuntu here: /etc/systemd/system/ to be honest I am not 100% sure what you need to do without doing some research as I have abstracted all that away with chef. You can always symlink it from one location to the other.

···

On Wednesday, January 24, 2018 at 6:09:49 AM UTC-8, Bronsky Proco wrote:

Thanks for your answer Goyko !

Actually Sensu is working pretty great, no complaining in logs whatsoever but I just cant get Sensu services to start at boot.

I did search in /usr/lib/systemd/system but the system folder is missing :

root@superivison:/usr/lib/systemd# ls

catalog network ntp-units.d user user-generators

But I found the system scripts in /lib/systemd/system instead, but it appears that they need to be in /etc/systemd/system to ensure that Sensu services start at boot, so is this a normal behaviour or is there’s something wrong ?

Thanks in advance !

Le mardi 23 janvier 2018 14:59:39 UTC+1, Goyko a écrit :

systemctl status sensu-client

This will show you if the service is enabled. But I think you already checked that with a different command.

If it is enabled already, maybe you forgot to configure sensu. Check /var/log/sensu/sensu-client.log and see what is it complaining about.

If you want to look at systemd unit files, they have been moved in latest versions to /usr/lib/systemd/system/sensu*

On Monday, January 22, 2018 at 4:17:03 PM UTC+1, Bronsky Proco wrote:

Hi everyone,

I’m kind of newbie to Sensu so forgive me if I forgot a few things.

I’ve been trying to start sensu services at boot (sensu-client, api,etc) but they don’t start. According to the documentation, I have to use this command : update-rc.d sensu-client enable but it returns that error : **update-rc.d: error: cannot find a LSB script for sensu-client.
**So it appears Sensu uses systemd, so I ran this command : systemctl enable sensu-client.service and then ran : systemctl is-enabled sensu-client.service and it returned enabled. But when I reboot it doesn’t start Sensu services, I went to /etc/systemd/system/ and there was no systemd script to start Sensu. I used Google and find the sensu-build github which had systemd scripts but it appears that they are deprecated so what should I do to start Sensu services at boot ?

Here’s some info to help you :

OS: Debian 8 (fresh install)

Sensu version : 1.2.0

root@supervision:~# systemctl | grep sensu
sensu-api.service loaded active running sensu api
sensu-client.service loaded active running sensu client
sensu-server.service loaded active running sensu server

Thank you in advance !