Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29245

Systemd service not starting under custom user, only with root

$
0
0

I'm trying to run a Sonatype Nexus under the custom nexus user, because they recommend not running it not under the root user. I'm on an Amazon Linux 2 EC2 machine and it ran previously successfully under the root user.

I've added the nexus user and changed directory rights:

useradd --home-dir /opt/sonatype-work --no-create-home --uid 1001 nexuschown -R nexus:nexus /opt/sonatype-workchown -R nexus:nexus /opt/nexus

I changed the service file (/etc/systemd/system/nexus.service) to use the nexus user:

[Unit]Description=nexus serviceAfter=network.target[Service]Type=forkingLimitNOFILE=65536ExecStart=/opt/nexus/bin/nexus startExecStop=/opt/nexus/bin/nexus stopUser=nexusRestart=on-abort[Install]WantedBy=multi-user.target

Then I reloaded systemd and started it

$ systemctl daemon-reload$ systemctl enable nexus$ systemctl start nexus$ systemctl status nexus...nexus[5838]: Starting nexussystemd[1]: Started nexus service.systemd[1]: nexus.service: main process exited, code=exited, status=255/n/anexus[6030]: Shutting down nexusnexus[6030]: nexus is not running.systemd[1]: Unit nexus.service entered failed state.systemd[1]: nexus.service failed.

Nothing is happening. Same thing If switch to the nexus user and try to start it in that account. In the logs of the nexus service (tail -f /opt/sonatype-work/nexus3/log/nexus.log)nothing is happening. The systemd logs do not give a clue.

Where can I look what is actually happening and preventing my Sonartype Nexus to start?


Viewing all articles
Browse latest Browse all 29245

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>