errbot icon indicating copy to clipboard operation
errbot copied to clipboard

errbot not starting automatically after a reboot on CentOS 7

Open mattpoel opened this issue 8 years ago • 2 comments

I am...

  • [x] Reporting a bug
  • [ ] Suggesting a new feature
  • [ ] Requesting help with running my bot
  • [ ] Requesting help writing plugins
  • [ ] Here about something else

I am running...

  • Errbot version: 5.2.0
  • OS version: CentOS Linux release 7.5.1804 (Core)
  • Python version: 3.5.2
  • Using a virtual environment: yes

Issue description

I created the errbot.service for systemd as described in the documentation and activated the service with:

systemctl enable errbot

But errbot didn't start automatically after a reboot. I had to start errbot manually with systemctl start errbot.

After modifying the errbot.service file based on another service, reboots are working fine for me now:

[Unit]
Description=Start Errbot chatbot
After=syslog.target network.target
Before=shutdown.target reboot.target halt.target

[Service]
Environment="LC_ALL=en_US.UTF-8"
ExecStart=/path/to/errbot/virtualenv/bin/errbot --config /path/to/errbot/config.py
WorkingDirectory=/path/to/errbot/
User=errbot
Restart=always
KillSignal=SIGINT

[Install]
WantedBy=multi-user.target

Just want to provide my systemd errbot configuration as a reference.

Steps to reproduce

  • configure errbot as a systemd-service on CentOS 7
  • enable the service with systemctl enable errbot
  • perform a reboot
  • check the status of errbot systemctl status errbot => not running

mattpoel avatar Jun 02 '18 11:06 mattpoel

Matt, does it work properly with a manual systemctl start after? Could you share journatlctl -u errbot logs, and any errors logged by errbot during attempt to start during boot?

nulfox avatar Jun 28 '18 12:06 nulfox

A quick diff between the suggestion here and our docs show

--- <unnamed>
+++ <unnamed>
@@ -1,6 +1,7 @@
 [Unit]
 Description=Start Errbot chatbot
-After=network.service
+After=syslog.target network.target
+Before=shutdown.target reboot.target halt.target
 
 [Service]
 Environment="LC_ALL=en_US.UTF-8"
@@ -9,3 +10,6 @@
 User=errbot
 Restart=always
 KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target

My guess is that the [Install] is really the only necessary change.

sijis avatar Nov 09 '18 15:11 sijis