Systemd, Assignment outside of section. Ignoring
Asked Answered
M

1

5

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?

Miserable answered 17/1, 2022 at 14:1 Comment(3)
If you read the error message, lines 1 and 2 have an assignment but are not in a section. So maybe there should be something in square brackets before those? Looking into another unit file, my guess would be [Unit]. Not putting as answer, this seems a tad off-topic for SO.Elane
This is odd. I checked all of my Artemis installations. Different versions, the latest being 2.17. They all have those first two lines before a section.Miserable
did you solve it ?Mauchi
T
15

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 :)

Tweeddale answered 1/11, 2022 at 4:7 Comment(1)
Solved a problem I was having with plexmediaserver on ubuntu 22.04. Thanks!Succulent

© 2022 - 2024 — McMap. All rights reserved.