clipboard-history: ringboard-server fails to start: "Failed to open pressure file"

$ target/myrelease/ringboard-server --help
Error: an I/O error occurred
│
╰─▶ No such file or directory (os error 2)
    ╰╴Failed to open pressure file: "/sys/fs/cgroup/\n13:rdma:/\n12:pids:/\n11:hugetlb:/\n10:net_prio:/\n9:perf_event:/\n8:net_cls:/\n7:freezer:/\n6:devices:/\n5:memory:/\n4:blkio:/\n3:cpuacct:/\n2:cpu:/\n1:cpuset:/memory.pressure"

Does it expect cgroup v2 instead of v1?

Is there a keep-it-simple mode without memory pressure monitoring? What if somebody is running a Linux kernel without cgroup support at all?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 30 (18 by maintainers)

Commits related to this issue

Most upvoted comments

No worries and thanks for testing this!

I think this will still be broken when used outside of systemd if the current cgroup is owned by root, but I kinda want to say that’s user error. Will wait for someone to run into that case so I can understand it better, but that’s where @vi’s approach of ignoring the failure might make sense as creating a user cgroup just to run the server is going to be too much of a hassle. Seems like basically everything uses systemd though so eh: https://en.wikipedia.org/wiki/Systemd#Adoption

@AguirreIF did you run the sed commands? The error there is because the binary ringboard-server wasn’t found which is normal. The sed commands are supposed to inline the absolute path. Anyway, does the service starts up normally with the /bin/sh path stuff (or an absolute path)? If so, then the error is fixed right? I assume your original error was that the service refused to start with the cgroup perms error?

Ok, can you run these commands (assuming you use systemd?):

curl -s https://raw.githubusercontent.com/SUPERCILEX/clipboard-history/master/ringboard.slice --create-dirs -O --output-dir ~/.config/systemd/user/
curl -s https://raw.githubusercontent.com/SUPERCILEX/clipboard-history/master/server/ringboard-server.service --create-dirs -O --output-dir ~/.config/systemd/user/
sed -i "s|ExecStart=ringboard-server|ExecStart=$(which ringboard-server)|g" ~/.config/systemd/user/ringboard-server.service
curl -s https://raw.githubusercontent.com/SUPERCILEX/clipboard-history/master/$XDG_SESSION_TYPE/ringboard-$XDG_SESSION_TYPE.service -O --output-dir ~/.config/systemd/user/
sed -i "s|ExecStart=ringboard-$XDG_SESSION_TYPE|ExecStart=$(which ringboard-$XDG_SESSION_TYPE)|g" ~/.config/systemd/user/ringboard-$XDG_SESSION_TYPE.service
systemctl --user daemon-reload
systemctl --user restart ringboard-server

If that doesn’t work, try modifying ~/.config/systemd/user/ringboard.slice to include

[Slice]
Delegate=true

and then

systemctl --user daemon-reload
systemctl --user restart ringboard-server

to see if it works.

Actually nevermind, I think I need to make a slice for myself.

Also can you try installing dbus-user-session with your package manager and then rebooting to see if it’s fixed? Based on this thread it seems like you have one global cgroup instead of one per process.

I wonder if you’re in hybrid mode. Can you run grep cgroup2 /proc/mounts and stat -f /sys/fs/cgroup/unified and see what those output?

Indeed, I expected it to only warn on any errors regarding memory pressure monitoring, but the commit only changed things about parsing content of a file.