Skip to content

Commit

Permalink
udev: Handle PTP device symlink properly on udev action 'change'
Browse files Browse the repository at this point in the history
PTP device symlink creation rules are currently executed only when the
udev action is 'add'. If a user reloads the rules and runs the udevadm
trigger command to reapply changes, the symlink may be deleted, which
can prevent the chronyd service from restarting properly.

Signed-off-by: Chengen Du <chengen.du@canonical.com>
(cherry picked from commit 6bd12be)

Resolves: RHEL-59871
  • Loading branch information
yukariatlas authored and dtardon committed Sep 24, 2024
1 parent d6ed92f commit 8db4d72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rules.d/50-udev-default.rules.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ SUBSYSTEM=="pci|usb|platform", IMPORT{builtin}="path_id"

SUBSYSTEM=="net", IMPORT{builtin}="net_driver"

SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK+="ptp_kvm"
SUBSYSTEM=="ptp", ATTR{clock_name}=="hyperv", SYMLINK+="ptp_hyperv"

ACTION!="add", GOTO="default_end"

SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666"
Expand Down Expand Up @@ -116,7 +119,4 @@ KERNEL=="vhost-net", GROUP="kvm", MODE="{{DEV_KVM_MODE}}", OPTIONS+="static_node

KERNEL=="udmabuf", GROUP="kvm"

SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK+="ptp_kvm"
SUBSYSTEM=="ptp", ATTR{clock_name}=="hyperv", SYMLINK+="ptp_hyperv"

LABEL="default_end"

0 comments on commit 8db4d72

Please sign in to comment.