simplexmq icon indicating copy to clipboard operation
simplexmq copied to clipboard

systemd service smp-server.service cannot start

Open TrustExecutor opened this issue 1 year ago • 1 comments

My smp-server does not start at boot.

systemctl status smp-server.service gives this output:

Nov 06 22:59:09 simplex smp-server[1367]: Fingerprint: ***********************************
Nov 06 22:59:09 simplex smp-server[1367]: Server address: smp://******************************************
Nov 06 22:59:09 simplex smp-server[1367]: Store log: /var/opt/simplex/smp-server-store.log
Nov 06 22:59:09 simplex smp-server[1367]: Listening on port 5223 (TLS)...
Nov 06 22:59:09 simplex smp-server[1367]: expiring messages after 21 days
Nov 06 22:59:09 simplex smp-server[1367]: not expiring inactive clients
Nov 06 22:59:09 simplex smp-server[1367]: creating new queues requires password
Nov 06 22:59:09 simplex smp-server[1367]: smp-server: /var/opt/simplex/smp-server-store.log: openFile: permission denied (Permission denied)
Nov 06 22:59:09 simplex systemd[1]: smp-server.service: Main process exited, code=exited, status=1/FAILURE
Nov 06 22:59:09 simplex systemd[1]: smp-server.service: Failed with result 'exit-code'.

I useed the installation script on Debian 12. It seems like user permission problem for the smp user

Here is the systemd script:

[Unit]
Description=SMP server

[Service]
User=smp
Group=smp
Type=simple
ExecStart=/usr/local/bin/smp-server start
ExecStopPost=/usr/local/bin/simplex-servers-stopscript smp-server
LimitNOFILE=65535
KillSignal=SIGINT
TimeoutStopSec=infinity

[Install]
WantedBy=multi-user.target

How can I get around this? I recently ran the update script, didnt help.

If I run smp-server start as root then the server starts fine. Also if I comment out the user and group lines in the servic file, the server runs fine. But I do not want to run it as root, so how do I fix the permissions?

TrustExecutor avatar Nov 06 '23 22:11 TrustExecutor

Hey.

The line:

smp-server: /var/opt/simplex/smp-server-store.log: openFile: permission denied (Permission denied)

...suggests there's something wrong with you permissions for that file or the whole folder. Official installation script correctly assigns permissions for the /var/opt and /etc/opt here, so not sure how you've got here. Maybe you tried to initialize server with just smp-server init and not sudo su smp -c "smp-server init"? The whole installation process described in the guide.

Anyway, try to execute chown -R smp:smp /var/opt/simplex and start systemd service again, hopefully this should fix it.

shumvgolove avatar Nov 09 '23 08:11 shumvgolove