<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>I dug up my old stuff for getting it started and see that I just
disabled the unix socket completely. I was never able to get it to
work for the reasons you are seeing, so I enabled it in listening
mode. There are comments in the service file about it, but to do
so, I changed the 'ExecStart' line in the systemd service file to
be:</p>
<p> <i><b>ExecStart=/usr/sbin/slurmrestd $SLURMRESTD_OPTIONS</b></i></p>
<p>Then I created /etc/default/slurmrestd and added:</p>
<blockquote>
<p><i><b>SLURM_JWT=daemon</b></i><i><b><br>
</b></i><i><b>SLURMRESTD_LISTEN=0.0.0.0:8081</b></i><i><b><br>
</b></i><i><b>SLURMRESTD_DEBUG=4</b></i><i><b><br>
</b></i><i><b>SLURMRESTD_OPTIONS="-f /etc/slurm/slurm.conf"</b></i></p>
</blockquote>
<p>You can change those as needed. This made it listen on port 8081
only (no socket and not 6820)</p>
<p>I was then able to just use curl on port 8081 to test things.</p>
<p>Hope that helps.</p>
<p>Brian Andrus<br>
</p>
<div class="moz-cite-prefix">On 12/29/2022 6:49 AM, Chris Stackpole
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:213dbdf0-2588-1bdf-2f57-4f1cf919a027@advancedclustering.com">Greetings,
<br>
<br>
Thanks for responding!
<br>
<br>
On 12/28/22 20:35, Brian Andrus wrote:
<br>
<blockquote type="cite">I suspect if you delete
/var/lib/slurmrestd.socket and then start slurmrestd, it will
create it as the user you need it to be.
<br>
<br>
Or just change the owner of it to the slurmrestd owner.
<br>
</blockquote>
<br>
<br>
No go on that. Because /var/lib requires root to create
/var/lib/slurmrestd.socket . Which is what I meant by "has to
write into a root-only directory to create the unix socket".
<br>
Here, I'll show what happens with me.
<br>
Spun up a virtual machine with nothing changed on a fresh compile
of 22.05.07.
<br>
<br>
# rm -rf /var/lib/slurmrestd.socket
<br>
# systemctl start slurmrestd
<br>
# systemctl status slurmrestd
<br>
<snip>
<br>
Active: failed (Result: exit-code) since Thu 2022-12-29 08:39:45
CST; 54s ago
<br>
<snip>
<br>
<br>
# journalctl -xe
<br>
<snip>
<br>
Dec 29 08:39:45 testslurmvm.cluster slurmrestd[114317]: fatal:
_create_socket: [unix:/var/lib/slurmrestd.socket] Unable to bind
UNIX socket: Permission denied
<br>
Dec 29 08:39:45 testslurmvm.cluster systemd[1]:
slurmrestd.service: Main process exited, code=exited,
status=1/FAILURE
<br>
<br>
Now what about giving ownership to the user?
<br>
<br>
# touch /var/lib/slurmrestd.socket
<br>
# systemctl start slurmrestd
<br>
# systemctl status slurmrestd
<br>
<snip>
<br>
Active: failed (Result: exit-code) since Thu 2022-12-29 08:45:37
CST; 1min 2s ago
<br>
<snip>
<br>
# journalctl -xe
<br>
<snip>
<br>
Dec 29 08:45:37 testslurmvm.cluster slurmrestd[114402]: error:
Error unlink(/var/lib/slurmrestd.socket): Permission denied
<br>
Dec 29 08:45:37 testslurmvm.cluster slurmrestd[114402]: fatal:
_create_socket: [unix:/var/lib/slurmrestd.socket] Unable to bind
UNIX socket: Address already in use
<br>
<br>
Again, it doesn't have permissions to modify those files nor
create files inside that directory.
<br>
<br>
On 12/28/22 20:35, Brian Andrus wrote:
<br>
> I have been running slurmrestd as a separate user for some
time.
<br>
<br>
Under 22.05.07? Because that's what broke things for me. And I
think that it's this change:
<br>
<br>
| -- slurmrestd - switch users earlier on startup to avoid sockets
being
<br>
| made as root.
<br>
<br>
I'm not saying it's a bad change either - but I don't see any
documentation on the proper way to handle it and I don't feel like
editing the service file is the proper way to handle it.
<br>
<br>
Thanks!
<br>
<br>
</blockquote>
</body>
</html>