SHA256
1
0
forked from pool/systemd

Accepting request 909721 from Base:System

- Avoid the error message when udev is updated due to udev being
  already active when the sockets are started again (bsc#1188291)

OBS-URL: https://build.opensuse.org/request/show/909721
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=334
This commit is contained in:
Dominique Leuenberger 2021-08-04 20:28:26 +00:00 committed by Git OBS Bridge
commit 71ccb19fd8
4 changed files with 42 additions and 22 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jul 29 13:12:48 UTC 2021 - Franck Bui <fbui@suse.com>
- Avoid the error message when udev is updated due to udev being
already active when the sockets are started again (bsc#1188291)
-------------------------------------------------------------------
Mon Jul 26 10:54:10 UTC 2021 - Franck Bui <fbui@suse.com>

View File

@ -974,17 +974,21 @@ rm -f /etc/udev/rules.d/{20,55,65}-cdrom.rules
%postun -n udev%{?mini}
%regenerate_initrd_post
systemctl daemon-reload || :
# On package update, restarting the socket units will probably fail as
# udevd is most likely running. Therefore systemctl will refuse to
# start them again once stopped. It's not an issue since we are mostly
# interested to make PID1 use the updated unit files once the socket
# units wil be started again. And that will happen when systemd-udevd
# itself will be restarted.
if [ $1 -ge 1 ]; then
systemctl try-restart systemd-udevd-{control,kernel}.socket 2>/dev/null || :
systemctl try-restart systemd-udevd.service || :
fi
# The order of the units being restarted is important here because there's currently no
# way to queue multiple jobs into a single transaction atomically. Therefore systemctl
# will create 3 restart jobs that can be handled by PID1 separately and if the jobs for
# the sockets are being handled first then starting them again will fail as the service
# is still active hence the sockets held by udevd. However if the restart job for udevd
# is handled first, there should be enough time to queue the socket jobs before the stop
# job for udevd is processed. Hence PID1 will automatically sort the restart jobs
# correctly by stopping the service then the sockets and then by starting the sockets and
# the unit.
#
# Note that when systemd-udevd is restarted, there will always be a short time
# frame where no socket will be listening to the events sent by the kernel, no
# matter if the socket unit is restarted in first or not.
%service_del_postun_with_restart systemd-udevd.service systemd-udevd-{control,kernel}.socket
%posttrans -n udev%{?mini}
%regenerate_initrd_posttrans

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jul 29 13:12:48 UTC 2021 - Franck Bui <fbui@suse.com>
- Avoid the error message when udev is updated due to udev being
already active when the sockets are started again (bsc#1188291)
-------------------------------------------------------------------
Mon Jul 26 10:54:10 UTC 2021 - Franck Bui <fbui@suse.com>

View File

@ -972,17 +972,21 @@ rm -f /etc/udev/rules.d/{20,55,65}-cdrom.rules
%postun -n udev%{?mini}
%regenerate_initrd_post
systemctl daemon-reload || :
# On package update, restarting the socket units will probably fail as
# udevd is most likely running. Therefore systemctl will refuse to
# start them again once stopped. It's not an issue since we are mostly
# interested to make PID1 use the updated unit files once the socket
# units wil be started again. And that will happen when systemd-udevd
# itself will be restarted.
if [ $1 -ge 1 ]; then
systemctl try-restart systemd-udevd-{control,kernel}.socket 2>/dev/null || :
systemctl try-restart systemd-udevd.service || :
fi
# The order of the units being restarted is important here because there's currently no
# way to queue multiple jobs into a single transaction atomically. Therefore systemctl
# will create 3 restart jobs that can be handled by PID1 separately and if the jobs for
# the sockets are being handled first then starting them again will fail as the service
# is still active hence the sockets held by udevd. However if the restart job for udevd
# is handled first, there should be enough time to queue the socket jobs before the stop
# job for udevd is processed. Hence PID1 will automatically sort the restart jobs
# correctly by stopping the service then the sockets and then by starting the sockets and
# the unit.
#
# Note that when systemd-udevd is restarted, there will always be a short time
# frame where no socket will be listening to the events sent by the kernel, no
# matter if the socket unit is restarted in first or not.
%service_del_postun_with_restart systemd-udevd.service systemd-udevd-{control,kernel}.socket
%posttrans -n udev%{?mini}
%regenerate_initrd_posttrans