Bug 34031 - create static device inodes for SysV init
Summary: create static device inodes for SysV init
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: udev (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Alexey Shabalin
QA Contact: qa-sisyphus
URL: https://bugzilla.altlinux.org/show_bu...
Keywords:
Depends on: 31718
Blocks: 34019
  Show dependency tree
 
Reported: 2017-10-19 17:01 MSK by Ivan Zakharyaschev
Modified: 2017-10-22 17:55 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Zakharyaschev 2017-10-19 17:01:17 MSK
(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 Ivan Zakharyaschev 2017-10-19 19:05:38 MSK
Исправил в task #190896, можно пропустить, если нет замечаний.
Comment 2 Repository Robot 2017-10-22 17:55:55 MSK
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.