⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.144
Server IP:
157.245.143.252
Server:
Linux www 6.11.0-9-generic #9-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 14 13:19:59 UTC 2024 x86_64
Server Software:
nginx/1.26.0
PHP Version:
8.3.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
lib
/
udev
/
rules.d
/
View File Name :
56-dm-mpath.rules
ACTION!="add|change", GOTO="mpath_end" ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="mpath_end" ENV{DM_UUID}!="mpath-?*", GOTO="mpath_end" IMPORT{db}="MPATH_DEVICE_READY" # device-mapper rules v2 compatibility ENV{.DM_SUSPENDED}!="?*", ENV{.DM_SUSPENDED}="$env{DM_SUSPENDED}" # Coldplug event while device is suspended (e.g. during a reload) ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{.DM_SUSPENDED}=="1", \ PROGRAM="/bin/logger -t 11-dm-mpath.rules -p daemon.warning \"Coldplug event for suspended device\"", \ ENV{DM_COLDPLUG_SUSPENDED}="1", GOTO="scan_import" # Coldplug event. Import previously set properties. ACTION!="add", GOTO="mpath_coldplug_end" ENV{DM_ACTIVATION}!="1", GOTO="mpath_coldplug_end" ENV{DM_UDEV_RULES_VSN}!="1|2", ENV{.DM_SUSPENDED}!="1", GOTO="scan_import" # With DM rules < v3, DM_UDEV_DISABLE_OTHER_RULES_FLAG has been restored # from DB in 10-dm.rules. If the device is not suspended, clear the flag. # This is safe for multipath where DM_UDEV_DISABLE_OTHER_RULES_FLAG is basically # equivalent to DM_SUSPENDED==1 || DISK_RO==1 ENV{DM_UDEV_RULES_VSN}=="1|2", ENV{.DM_SUSPENDED}!="1", ENV{DISK_RO}!="1", \ ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="", GOTO="scan_import" LABEL="mpath_coldplug_end" # If this uevent didn't come from dm, don't try to update the # device state # Note that .MPATH_DEVICE_READY_OLD=="" here. Thus we won't activate the # device below at mpath_is_ready, which is correct. ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \ IMPORT{db}="DM_COLDPLUG_SUSPENDED", \ GOTO="check_mpath_ready" ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}" # multipath sets DM_SUBSYSTEM_UDEV_FLAG2 when it reloads a # table with no active devices. If this happens, mark the # device not ready ENV{DM_SUBSYSTEM_UDEV_FLAG2}=="1", ENV{MPATH_DEVICE_READY}="0", \ GOTO="check_mpath_unchanged" # If the last path has failed mark the device not ready # Note that DM_NR_VALID_PATHS is only set for PATH_FAILED|PATH_REINSTATED # events. # This may not be reliable, as events aren't necessarily received in order. ENV{DM_NR_VALID_PATHS}=="0", ENV{MPATH_DEVICE_READY}="0", GOTO="check_mpath_unchanged" # Don't run multipath -U during "coldplug" after switching root, # because paths are just being added to the udev db. ACTION=="add", ENV{.MPATH_DEVICE_READY_OLD}=="1", GOTO="paths_ok" # Check the map state directly with multipath -U. # This doesn't attempt I/O on the device. PROGRAM=="/usr/sbin/multipath -U -v1 %k", GOTO="paths_ok" ENV{MPATH_DEVICE_READY}="0", GOTO="check_mpath_unchanged" LABEL="paths_ok" # For PATH_FAILED events, keep the existing value of MPATH_DEVICE_READY. # If it's not PATH_FAILED, this event is either a PATH_REINSTATED or a # table reload where there are active paths. Mark the device ready. ENV{DM_ACTION}!="PATH_FAILED", ENV{MPATH_DEVICE_READY}="1" LABEL="check_mpath_unchanged" # A previous coldplug event occurred while the device was suspended. # Activation might have been partially skipped. Activate the device now, # i.e. disable the MPATH_UNCHANGED logic and set DM_ACTIVATION=1. IMPORT{db}="DM_COLDPLUG_SUSPENDED" ENV{DM_COLDPLUG_SUSPENDED}=="1", ENV{.DM_SUSPENDED}!="1", \ ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0", \ PROGRAM="/bin/logger -t 11-dm-mpath.rules -p daemon.notice \"Forcing activation of previously suspended device\"", \ GOTO="check_mpath_ready" # DM_SUBSYSTEM_UDEV_FLAG0 is the "RELOAD" flag for multipath subsystem. # Drop the DM_ACTIVATION flag here as mpath reloads tables if any of its # paths are lost/recovered. For any stack above the mpath device, this is not # something that should be reacted upon since it would be useless extra work. # It's exactly mpath's job to provide *seamless* device access to any of the # paths that are available underneath. ENV{DM_SUBSYSTEM_UDEV_FLAG0}=="1", \ ENV{DM_ACTIVATION}="0", ENV{MPATH_UNCHANGED}="1" # For path failed or reinstated events, unset DM_ACTIVATION. # This is similar to the DM_SUBSYSTEM_UDEV_FLAG0 case above. ENV{DM_ACTION}=="PATH_FAILED|PATH_REINSTATED", \ ENV{DM_ACTIVATION}="0", ENV{MPATH_UNCHANGED}="1" LABEL="check_mpath_ready" ENV{MPATH_DEVICE_READY}!="0", GOTO="mpath_is_ready" # Do not initiate scanning if no path is available, # otherwise there would be a hang or IO error on access. # We'd like to avoid this, especially within udev processing. # This is communicated to later rules in .DM_NOSCAN. # Likewise, skip all foreign rules if no path is available. # Use DM_UDEV_DISABLE_OTHER_RULES_FLAG to communicate this # to upper layers. With dm rules < v3, save the original value here; # it will be restored in a late udev rule. ENV{DM_UDEV_RULES_VSN}=="1|2", \ ENV{.MPATH_SAVE_DISABLE_OTHER_RULES_FLAG}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}" ENV{.DM_NOSCAN}="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" GOTO="scan_import" LABEL="mpath_is_ready" # If the device comes back online, set DM_ACTIVATION so that # upper layers do a rescan. If the device is currently suspended, # we have to postpone the activation until the next event. # In this case, we have to set MPATH_DEVICE_READY=0; otherwise, the # MPATH_UNCHANGED logic will cause later rules to skipped in the next event. ENV{.MPATH_DEVICE_READY_OLD}!="0", GOTO="scan_import" ENV{.DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="scan_import" ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0" # The code to check multipath state ends here. We need to set # properties and symlinks regardless whether the map is usable or # not. If symlinks get lost, systemd may auto-unmount file systems. LABEL="scan_import" # If DM_UDEV_PRIMARY_SOURCE_FLAG is not set, the properties below # have never been properly set. Don't import them. ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="import_end" # DM rules v3 will import missing properties on 13-dm-disk.rules. # No need to do it here. ENV{DM_UDEV_RULES_VSN}!="1|2", GOTO="import_end" # Don't import the properties from db if we will run blkid later. ENV{.DM_NOSCAN}!="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" IMPORT{db}="ID_FS_TYPE" IMPORT{db}="ID_FS_USAGE" IMPORT{db}="ID_FS_UUID_ENC" IMPORT{db}="ID_FS_LABEL_ENC" IMPORT{db}="ID_PART_ENTRY_NAME" IMPORT{db}="ID_PART_ENTRY_UUID" IMPORT{db}="ID_PART_ENTRY_SCHEME" IMPORT{db}="ID_PART_GPT_AUTO_ROOT" LABEL="import_end" # Reset previous DM_COLDPLUG_SUSPENDED if activation happens now ENV{.DM_SUSPENDED}!="1", ENV{DM_ACTIVATION}=="1", ENV{DM_COLDPLUG_SUSPENDED}="" # device-mapper rules v2 compatibility for 13-dm-disk.rules ENV{DM_UDEV_RULES_VSN}=="1|2", ENV{DM_NOSCAN}="$env{.DM_NOSCAN}" # Multipath maps should take precedence over their members. ENV{DM_UDEV_LOW_PRIORITY_FLAG}!="1", OPTIONS+="link_priority=50" # Set some additional symlinks that typically exist for mpath # path members, too, and should be overridden. # kpartx_id is very robust, it works for suspended maps and maps # with 0 dependencies. It sets DM_TYPE, DM_PART, DM_WWN TEST=="/usr/lib/udev/kpartx_id", \ IMPORT{program}=="kpartx_id %M %m $env{DM_UUID}" ENV{DM_TYPE}=="?*", ENV{DM_SERIAL}=="?*", \ SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_SERIAL}" ENV{DM_WWN}=="?*", SYMLINK+="disk/by-id/wwn-$env{DM_WWN}" LABEL="mpath_end"