Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd service smp-server.service cannot start #885

Open
TrustExecutor opened this issue Nov 6, 2023 · 1 comment
Open

systemd service smp-server.service cannot start #885

TrustExecutor opened this issue Nov 6, 2023 · 1 comment

Comments

@TrustExecutor
Copy link

TrustExecutor commented Nov 6, 2023

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 TrustExecutor changed the title systemd service smp-server.service cnanot start systemd service smp-server.service cannot start Nov 7, 2023
@shumvgolove
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants