Bug 8081 - systemd init system: /tmp is not mode 1777
Summary: systemd init system: /tmp is not mode 1777
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-03 13:05 UTC by Floris Bos
Modified: 2015-08-04 19:01 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Floris Bos 2015-05-03 13:05:00 UTC
Using:

- latest buildroot from git
- start with raspberrypi2_defconfig
- set systemd as init system
- initramfs linked into kernel

/tmp is not mode 1777 causing software that does not run as root and wants to write to /tmp or (linked folders like /var/log) to fail.

==
# ls -ld /tmp
drwxr-xr-x    7 root     root           220 Jan  1 00:00 /tmp
==

Also tmpfiles service fails to start:

==
 systemd-tmpfiles-setup.service - Create Volatile Files and Directories
   Loaded: loaded (/lib/systemd/system/systemd-tmpfiles-setup.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 1970-01-01 00:00:06 UTC; 2min 8s ago
     Docs: man:tmpfiles.d(5)
           man:systemd-tmpfiles(8)
  Process: 131 ExecStart=/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev (code=exited, status=1/FAILURE)
 Main PID: 131 (code=exited, status=1/FAILURE)
==

And logging is not functional:

==
# journalctl
No journal files were found.
==
Comment 1 Thomas Petazzoni 2015-07-07 21:02:31 UTC
Are you sure you have not done some mistake? I just tested generating an initrd with systemd support, and it boots fine under Qemu, and /tmp has 1777 access rights:

# ls -l /
total 4
drwxr-xr-x    2 root     root             0 Jul  7 21:00 bin
drwxr-xr-x    7 root     root          2980 Jul  7 21:01 dev
drwxr-xr-x   15 root     root             0 Jul  7 21:01 etc
drwxr-xr-x    3 root     root             0 Mar  8  2014 home
-rwxr-xr-x    1 root     root           176 Jul  7 20:50 init
drwxr-xr-x    4 root     root             0 Jul  7 21:00 lib
lrwxrwxrwx    1 root     root             3 Jul  7 15:57 lib32 -> lib
lrwxrwxrwx    1 root     root            11 Jul  7 15:58 linuxrc -> bin/busybox
drwxr-xr-x    2 root     root             0 Oct  4  2014 media
drwxr-xr-x    2 root     root             0 Oct  4  2014 mnt
drwxr-xr-x    2 root     root             0 Oct  4  2014 opt
dr-xr-xr-x   44 root     root             0 Jan  1  1970 proc
drwx------    2 root     root             0 Jul  7 21:01 root
drwxr-xr-x    9 root     root           240 Jul  7 21:01 run
drwxr-xr-x    2 root     root             0 Jul  7 21:00 sbin
drwxr-xr-x    2 root     root             0 Jul  7 21:01 srv
dr-xr-xr-x   12 root     root             0 Jul  7 21:01 sys
drwxrwxrwt    7 root     root           180 Jul  7 21:01 tmp
drwxr-xr-x    7 root     root             0 Jul  7 21:00 usr
drwxr-xr-x    4 root     root             0 Jul  7 21:01 var

Can you confirm that the issue is still reproducible with the latest Buildroot?

Thanks!
Comment 2 Floris Bos 2015-08-04 19:01:11 UTC
Issue with /tmp not being mode 1777 when systemd is used, is no longer reproducible with recent buildroot from git.

Logging is still broken when systemd is used, but there is already bug 7892 for that, so closing this.