BenW
BenW

Reputation: 959

Systemd, Assignment outside of section. Ignoring

I'm seeing many of the following errors from systemd for Apache ActiveMQ Artemis.

Sep 25 04:41:17 server systemd[1]: /etc/systemd/system/artemis.service:1: Assignment outside of section. Ignoring.
Sep 25 04:41:17 server systemd[1]: /etc/systemd/system/artemis.service:2: Assignment outside of section. Ignoring.

I took some helpful advice from here, but as far as I can tell the file is OK.

> file artemis.service
artemis.service: ASCII text

So I think the file format is correct, and I don't see any extra characters:

> cat -A artemis.service
Description=Apache ActiveMQ Artemis$
After=network.target$
[Service]$
Type=simple$
User=activemq$
Group=activemq$
ExecStart=/var/lib/broker-HA/bin/artemis run$
#ExecStop=/var/lib/broker-HA/bin/artemis stop$
UMask=0007$
RestartSec=10$
Restart=always$
[Install]$
WantedBy=multi-user.target$

What might be causing this?

Upvotes: 6

Views: 25746

Answers (1)

kiu
kiu

Reputation: 311

I got this issue too and solved by adding [Unit] in the .service file.

These 2 lines mean your .service file, 1 and 2 line have errors:

/etc/systemd/system/artemis.service:1
/etc/systemd/system/artemis.service:2

Solution:

[Unit]
Description=Apache ActiveMQ Artemis$ 
After=network.target$ 
[Service]$ 
Type=simple$ 
User=activemq$ 
Group=activemq$ 
ExecStart=/var/lib/broker-HA/bin/artemis run$ 
#ExecStop=/var/lib/broker-HA/bin/artemis stop$ 
UMask=0007$ RestartSec=10$ Restart=always$ 
[Install]$ 
WantedBy=multi-user.target$

You may have a try :)

Upvotes: 18

Related Questions