0

When trying to run Rocket.Chat on CentOS with the following command:

systemctl start rocketchat.service 

getting the following error:

Failed to start rocketchat.service: Unit is not loaded properly: Bad message.
See system logs and systemctl status rocketchat.service for details.

and when I run the command systemctl status rocketchat.service I get:

 Loaded: error (Reason: Bad message)
   Active: inactive (dead)

Jan 18 08:56:12 localhost.relinns.com systemd[1]: [/etc/systemd/system/rocketchat.service:3] Failed to add dependency on mongod.target[Service], ignoring: I... argument
Jan 18 08:56:12 localhost.relinns.com systemd[1]: [/etc/systemd/system/rocketchat.service:4] Unknown lvalue 'Type' in section 'Unit'
Jan 18 08:56:12 localhost.relinns.com systemd[1]: [/etc/systemd/system/rocketchat.service:5] Unknown lvalue 'ExecStart' in section 'Unit'
Jan 18 08:56:12 localhost.relinns.com systemd[1]: [/etc/systemd/system/rocketchat.service:6] Unknown lvalue 'Restart' in section 'Unit'
Jan 18 08:56:12 localhost.relinns.com systemd[1]: [/etc/systemd/system/rocketchat.service:7] Unknown lvalue 'StandardOutput' in section 'Unit'
Jan 18 08:56:12 localhost.relinns.com systemd[1]: [/etc/systemd/system/rocketchat.service:8] Unknown lvalue 'StandardError' in section 'Unit'
Jan 18 08:56:12 localhost.relinns.com systemd[1]: [/etc/systemd/system/rocketchat.service:9] Unknown lvalue 'SyslogIdentifier' in section 'Unit'
Jan 18 08:56:12 localhost.relinns.com systemd[1]: [/etc/systemd/system/rocketchat.service:10] Unknown lvalue 'User' in section 'Unit'
Jan 18 08:56:12 localhost.relinns.com systemd[1]: [/etc/systemd/system/rocketchat.service:11] Unknown lvalue 'Environment' in section 'Unit'
Jan 18 08:56:12 localhost.relinns.com systemd[1]: [/etc/systemd/system/rocketchat.service:13] Invalid section header '[Install] WantedBy=multi-user.target'
Hint: Some lines were ellipsized, use -l to show in full.

Where is the problem?

Gholamali Irani
  • 4,391
  • 6
  • 28
  • 59
NIkhil Goel
  • 11
  • 2
  • 3

1 Answers1

1

Failed to add dependency on mongod.target[Service]

I had a similar issue in a different service. The problem is with you systemctl config file. You do not have a line break before [Service] element which shall actually start a new section and not be a part of After element.

So open you rocketchat.service file (which is probably in /usr/lib/systemd/system) and check that [Service] element starts on a new line (check other .service files in that dir for example of correct format). It shall look something like

....
After=mongod.target

[Service]
....