OpenSUSE Leap 15.6: error starting tmux when using tmpfs

I was using tmux fine but after swapping default tmp directory for tmpfs I’m getting an error “couldn’t create directory /run/tmux/1000 (No such file or directory)” when launching tmux.

tmux only works If I manually create /run/tmux/ directory with write rule for users.

What can I do to solve this issue? I’d like to keep using tmpfs.

I’m using SUSE Leap 15.6

You mean you made /tmp into a tmpfs file system?
Please show at least the /etc/fstab entry for it.

And why do you think this has anything to do with /run/ ?

I don’t have an fstab entry for it. I’m using systemd unit for tmpfs:

$ systemctl cat tmp.mount 

[Unit]
Description=Temporary Directory /tmp
Documentation=https://systemd.io/TEMPORARY_DIRECTORIES
Documentation=man:file-hierarchy(7)
Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
ConditionPathIsSymbolicLink=!/tmp
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
After=swap.target

[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime,nosuid,nodev,size=50%%,nr_inodes=1m

I do not see such a construct in man tmpfs. One % should be enough, and I have no idea what %% will lead into.

BTW the man systemd.mount says:

In general, configuring mount points through /etc/fstab is the preferred approach to manage mounts for humans

Thus I am not sure why you take this route.

And you did not answer my second question.

I didn’t edit that file, it was preinstalled (not enabled).
I’ve only removed a systemd unit for mounting default tmp directory and replaced with this tmpfs unit.

I haven’t changed anything else. tmux was launching without errors when I was using the old default tmp directory without tmpfs.

bor@10:~> findmnt -u /tmp
TARGET
     SOURCE
           FSTYPE OPTIONS
/tmp tmpfs tmpfs  rw,nosuid,nodev,nr_inodes=1048576,inode64
bor@10:~> ll -d /run/tmux/
drwxrwxrwt 2 root root 40 Nov  4 20:43 /run/tmux/
bor@10:~> systemctl cat tmp.mount
[Unit]
Description=Temporary Directory /tmp
Documentation=https://systemd.io/TEMPORARY_DIRECTORIES
Documentation=man:file-hierarchy(7)
Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
ConditionPathIsSymbolicLink=!/tmp
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
After=swap.target

[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime,nosuid,nodev,size=50%%,nr_inodes=1m

You need to identify the issue first.

Found the reason for the error .
It’s because systemd-tmpfiles-setup.service wasn’t enabled.
After enabling it with systemctl unmask systemd-tmpfiles-setup.service there’s no error now.

So, initially I’d disabled systemd’s default tmp mount, enabled tmpfs but forgot to enable systemd-tmpfiles-setup.service

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.