[systemd-devel] tmp.mount inactive => /tmp not mounted

Andrei Borzenkov arvidjaar at gmail.com
Sat Sep 12 00:37:03 PDT 2015


12.09.2015 03:51, Aaron_Wright at selinc.com пишет:
> I recently switched to using systemd in my initrd, and nearly everything
> works fine, expect now the system comes up without /tmp being mounted
> correctly. I'm not sure where to start looking. Can anyone nudge me in the
> right direction?
>
> The tmp.mount unit seems to be inactive. It didn't do that before I
> started using systemd in initrd.
>
> ~ # systemctl status tmp.mount
> ● tmp.mount - Temporary Directory
>     Loaded: loaded (/usr/lib/systemd/system/tmp.mount; static; vendor
> preset: enabled)
>     Active: inactive (dead) since Sat 2015-09-12 00:28:11 UTC; 33s ago
>      Where: /tmp
>       What: tmpfs
>       Docs: man:hier(7)
>             http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
>
> The local-fs.target unit is active and happy.
>
> ~ # systemctl status local-fs.target
> ● local-fs.target - Local File Systems
>     Loaded: loaded (/usr/lib/systemd/system/local-fs.target; static; vendor
> preset: enabled)
>     Active: active since Sat 2015-09-12 00:28:12 UTC; 1min 24s ago
>       Docs: man:systemd.special(7)
>
> But its dependencies list tmp.mount as not active.
>
> ~ # systemctl list-dependencies local-fs.target
> local-fs.target
> ● ├─-.mount
> ● ├─systemd-remount-fs.service
> ● ├─tmp.mount
> ● └─var.mount
>
> The list of mounts show that tmpfs is mounted on /tmp, but it isn't
> really. I assume this is a /tmp in initrd that is masked by switching the
> root to /sysroot (similar to the rootfs on the first line), because it is
> read-only like the root file system (can't make any files in it), and when
> I manually start tmp.mount that problem is fixed.
>

Yes, that's possible. Why do you include tmp.mount in initrd in the 
first place? Did you try to skip it? What initrd implementation do you use?

> ~ # cat /proc/mounts
> rootfs / rootfs rw 0 0
> sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
> proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
> devtmpfs /dev devtmpfs rw,nosuid,size=954032k,nr_inodes=238508,mode=755 0
> 0
> tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
> devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0
> tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0
> tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
> cgroup /sys/fs/cgroup/systemd cgroup
> rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd
> 0 0
> tmpfs /tmp tmpfs rw 0 0
> /dev/disk/by-partlabel/rootfs / ext4 ro,relatime,data=ordered 0 0
> /dev/disk/by-partlabel/varfs /var ext4
> rw,relatime,discard,nodelalloc,data=journal 0 0
>
> /etc/fstab is pretty tame. Not sure if it would be causing an issue or
> not.
>
> ~ # cat /etc/fstab
> PARTLABEL=rootfs / ext4 ro 0 1
> PARTLABEL=varfs /var ext4 rw,data=journal,discard 0 2
>
> Some journal output for reference. The root file system is read-only, so
> the errors with chmod are expected. These errors don't occur when /tmp is
> mounted properly.
>
> systemd[1]: systemd 219 running in system mode. (-PAM -AUDIT -SELINUX -IMA
> -APPARMOR -SMACK -SYSVINIT -UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS -ACL -XZ
> -LZ4 -SECCOMP +BLKID -ELFUTILS -KMOD -IDN)
> systemd[1]: Started Remount Root and Kernel File Systems.
> systemd[1]: Reached target Local File Systems (Pre).
> systemd[1]: Starting Local File Systems (Pre).
> systemd[1]: Found device SILICONSYSTEMS_INC_8GB varfs.
> systemd[1]: Mounting /var...
> systemd[1]: Mounted /var.
> systemd[1]: Starting Flush Journal to Persistent Storage...
> systemd[1]: Started Flush Journal to Persistent Storage.
> systemd[1]: Reached target Local File Systems.
> systemd[1]: Starting Local File Systems.
> systemd[1]: Starting Create Volatile Files and Directories...
> systemd-tmpfiles[161]: chmod(/tmp) failed: Read-only file system
> systemd[1]: systemd-tmpfiles-setup.service: main process exited,
> code=exited, status=1/FAILURE
> systemd[1]: Failed to start Create Volatile Files and Directories.
> systemd[1]: Unit systemd-tmpfiles-setup.service entered failed state.
> systemd[1]: systemd-tmpfiles-setup.service failed.
> systemd[1]: Reached target System Initialization.
>
>
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>



More information about the systemd-devel mailing list