Bug 34031 - create static device inodes for SysV init
: create static device inodes for SysV init
Status: CLOSED FIXED
: Sisyphus
(All bugs in Sisyphus/udev)
: unstable
: all Linux
: P3 normal
Assigned To:
:
: https://bugzilla.altlinux.org/show_bu...
:
: 31718
: 34019
  Show dependency tree
 
Reported: 2017-10-19 17:01 by
Modified: 2017-10-22 17:55 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2017-10-19 17:01:17
(In reply to comment https://bugzilla.altlinux.org/show_bug.cgi?id=31718#c2 )

> - для создания static-nodes в /dev используется systemd-tmpfiles под sysv из
> /etc/rc.d/init.d/udevd

Сейчас не работает. Я так понял, что нужно вместо:

create_static_inodes()
{
        mkdir -p /run/tmpfiles.d
        [ -x "$kmod" ] && $kmod static-nodes --format=tmpfiles
--output=/run/tmpfiles.d/kmod.conf
        [ -x "$systemd_tmpfiles" ] && $systemd_tmpfiles --prefix=/dev --create
}

делать:

create_static_inodes()
{
        mkdir -p /run/tmpfiles.d
        [ -x "$kmod" ] && $kmod static-nodes --format=tmpfiles
--output=/run/tmpfiles.d/kmod.conf
        [ -x "$systemd_tmpfiles" ] && $systemd_tmpfiles --prefix=/dev --create
--boot
}

Не знаю, для каких версий помимо Sisyphus это актуально.

Устройства не создаются, когда там восклицательные знаки (только с --boot
обрабатываются) при таких версиях:

-bash-4.3# rpm -qf /etc/init.d/udevd
udev-233-alt1.x86_64
-bash-4.3# cat /run/tmpfiles.d/kmod.conf 
c! /dev/autofs 0600 - - - 10:235
c! /dev/fuse 0600 - - - 10:229
c! /dev/cuse 0600 - - - 10:203
c! /dev/btrfs-control 0600 - - - 10:234
d /dev/net 0755 - - -
c! /dev/net/tun 0600 - - - 10:200
c! /dev/ppp 0600 - - - 108:0
c! /dev/userio 0600 - - - 10:240
c! /dev/uinput 0600 - - - 10:223
d /dev/mapper 0755 - - -
c! /dev/mapper/control 0600 - - - 10:236
d /dev/vfio 0755 - - -
c! /dev/vfio/vfio 0600 - - - 10:196
c! /dev/vhci 0600 - - - 10:137
c! /dev/uhid 0600 - - - 10:239
c! /dev/vhost-net 0600 - - - 10:238
d /dev/snd 0755 - - -
c! /dev/snd/timer 0600 - - - 116:33
d /dev/snd 0755 - - -
c! /dev/snd/seq 0600 - - - 116:1
-bash-4.3# rpm -qf /bin/kmod 
kmod-23-alt1.x86_64
-bash-4.3# 

и при таких:

[root@vb ~]# cat /run/tmpfiles.d/kmod.conf 
c! /dev/autofs 0600 - - - 10:235
c! /dev/fuse 0600 - - - 10:229
c! /dev/cuse 0600 - - - 10:203
c! /dev/btrfs-control 0600 - - - 10:234
d /dev/net 0755 - - -
c! /dev/net/tun 0600 - - - 10:200
c! /dev/ppp 0600 - - - 108:0
c! /dev/userio 0600 - - - 10:240
c! /dev/uinput 0600 - - - 10:223
d /dev/mapper 0755 - - -
c! /dev/mapper/control 0600 - - - 10:236
d /dev/vfio 0755 - - -
c! /dev/vfio/vfio 0600 - - - 10:196
c! /dev/vhci 0600 - - - 10:137
c! /dev/uhid 0600 - - - 10:239
c! /dev/vhost-net 0600 - - - 10:238
d /dev/snd 0755 - - -
c! /dev/snd/timer 0600 - - - 116:33
d /dev/snd 0755 - - -
c! /dev/snd/seq 0600 - - - 116:1
[root@vb ~]# man systemd-tmpfiles
[root@vb ~]# rpm -qf /etc/init.d/udevd
udev-232-alt1
[root@vb ~]# rpm -qf /bin/kmod 
kmod-21-alt1
[root@vb ~]# cut --fields=2 -d' ' </lib/modules/"$(uname -r)"/modules.devname |
(cd /dev/; xargs ls -ld)
ls: cannot access Device: No such file or directory
ls: cannot access fuse: No such file or directory
ls: cannot access cuse: No such file or directory
ls: cannot access btrfs-control: No such file or directory
ls: cannot access ppp: No such file or directory
ls: cannot access userio: No such file or directory
ls: cannot access uinput: No such file or directory
ls: cannot access vfio/vfio: No such file or directory
ls: cannot access vhci: No such file or directory
ls: cannot access uhid: No such file or directory
ls: cannot access vhost-net: No such file or directory
ls: cannot access snd/timer: No such file or directory
ls: cannot access snd/seq: No such file or directory
crw------- 1 root root 10, 235 авг  8 23:13 autofs
crw------- 1 root root 10, 236 авг  8 23:13 mapper/control
crw-rw-rw- 1 root root 10, 200 авг  8 23:13 net/tun
[root@vb ~]# 

Почувствовал это из-за отсутствия /dev/net/tun при работе libvirtd без systemd
-- как у них: https://bugzilla.novell.com/show_bug.cgi?id=792178#c3 (libvirt
should load tun module)
------- Comment #1 From 2017-10-19 19:05:38 -------
Исправил в task #190896, можно пропустить, если нет замечаний.
------- Comment #2 From 2017-10-22 17:55:55 -------
systemd-1:234-alt4 -> sisyphus:

Thu Oct 19 2017 Ivan Zakharyaschev <imz@altlinux.org> 1:234-alt4
- udevd.init (SysV): fix creating static device inodes (ALT: #34031).
  (Use an option introduced in v209 for "unsafe" tmpfiles actions,
  because the static devices are listed as such by kmod.)
- This also helps the unmounting of NFS when halting after having
  upgraded/reinstalled udev (& other) on a system with SysV init
  (ALT: #34019) by a lucky coincidence.