You are not logged in.

#1 2016-02-19 09:59:05

Bradan
Member
Registered: 2015-10-13
Posts: 21

Shutdown hangs when disconnecting USB devices while shutting down.

Hello,

My PC often doesn't shut down really well whenever I disconnect a USB device while it is shutting down. Here is the log:

-- Subject: Unit user-120.slice has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit user-120.slice has finished shutting down.
Feb 19 09:37:18 pc-linux systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Subject: Unit nginx.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nginx.service has finished shutting down.
Feb 19 09:37:18 pc-linux systemd[1]: Stopped target Network.
-- Subject: Unit network.target has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit network.target has finished shutting down.
Feb 19 09:37:18 pc-linux mkinitcpio[3252]: ==> Build complete.
Feb 19 09:37:18 pc-linux systemd[1]: Started Generate shutdown-ramfs.
-- Subject: Unit mkinitcpio-generate-shutdown-ramfs.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mkinitcpio-generate-shutdown-ramfs.service has finished starting up.
-- 
-- The start-up result is done.
Feb 19 09:37:18 pc-linux org.gnome.zeitgeist.Engine[1269]: [08:37:18.756857 WARNING] zeitgeist-daemon.vala:449: The connection is closed
Feb 19 09:37:18 pc-linux acpid[468]: exiting
Feb 19 09:37:18 pc-linux systemd[1]: Stopped ACPI event daemon.
-- Subject: Unit acpid.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit acpid.service has finished shutting down.
Feb 19 09:37:18 pc-linux kernel: nvidia-modeset: Freed GPU:0 (GPU-14d80e8a-ba7b-9cdf-a514-da6c8ec4824b) @ PCI:0000:01:00.0
Feb 19 09:37:18 pc-linux /usr/lib/gdm/gdm-x-session[1210]: (II) NVIDIA(GPU-0): Deleting GPU-0
Feb 19 09:37:18 pc-linux /usr/lib/gdm/gdm-x-session[1210]: (WW) xf86CloseConsole: KDSETMODE failed: Input/output error
Feb 19 09:37:18 pc-linux /usr/lib/gdm/gdm-x-session[1210]: (WW) xf86CloseConsole: VT_GETMODE failed: Input/output error
Feb 19 09:37:18 pc-linux /usr/lib/gdm/gdm-x-session[1210]: (WW) xf86CloseConsole: VT_ACTIVATE failed: Input/output error
Feb 19 09:37:18 pc-linux /usr/lib/gdm/gdm-x-session[1210]: (EE) systemd-logind: ReleaseControl failed: Connection is closed
Feb 19 09:37:18 pc-linux /usr/lib/gdm/gdm-x-session[1210]: (II) Server terminated successfully (0). Closing log file.
Feb 19 09:37:18 pc-linux systemd[1]: Stopped Session c4 of user username.
-- Subject: Unit session-c4.scope has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit session-c4.scope has finished shutting down.
Feb 19 09:37:20 pc-linux mysqld[458]: 2016-02-19  9:37:20 140127061228288 [Note] InnoDB: Shutdown completed; log sequence number 1745210
Feb 19 09:37:20 pc-linux mysqld[458]: 2016-02-19  9:37:20 140127061228288 [Note] /usr/bin/mysqld: Shutdown complete
Feb 19 09:37:20 pc-linux systemd[1]: Stopped MariaDB database server.
-- Subject: Unit mysqld.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysqld.service has finished shutting down.
Feb 19 09:37:23 pc-linux kernel: usb 3-4: USB disconnect, device number 3
Feb 19 09:38:34 pc-linux systemd-logind[470]: Power key pressed.
Feb 19 09:38:35 pc-linux systemd-logind[470]: Power key pressed.
Feb 19 09:38:35 pc-linux systemd-logind[470]: Power key pressed.
Feb 19 09:38:36 pc-linux org.freedesktop.Tracker1[1269]: Received signal:15->'Beendet'
Feb 19 09:38:36 pc-linux org.freedesktop.Tracker1[1269]: OK
Feb 19 09:38:36 pc-linux systemd[1196]: Stopped D-Bus User Message Bus.
-- Subject: Unit UNIT has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished shutting down.
Feb 19 09:38:36 pc-linux systemd[1196]: Stopped target Basic System.
-- Subject: Unit UNIT has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished shutting down.
Feb 19 09:38:36 pc-linux systemd[1196]: Stopped target Paths.
-- Subject: Unit UNIT has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished shutting down.
Feb 19 09:38:36 pc-linux systemd[1196]: Stopped target Sockets.
-- Subject: Unit UNIT has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished shutting down.
Feb 19 09:38:36 pc-linux systemd[1196]: Closed Sound System.
-- Subject: Unit UNIT has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished shutting down.
Feb 19 09:38:36 pc-linux systemd[1196]: Stopped target Timers.
-- Subject: Unit UNIT has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished shutting down.
Feb 19 09:38:36 pc-linux systemd[1196]: Closed D-Bus User Message Bus Socket.
-- Subject: Unit UNIT has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished shutting down.
Feb 19 09:38:36 pc-linux systemd[1196]: Reached target Shutdown.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished starting up.
-- 
-- The start-up result is done.
Feb 19 09:38:36 pc-linux systemd[1196]: Starting Exit the Session...
-- Subject: Unit UNIT has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has begun starting up.

Especially this part:

Feb 19 09:37:23 pc-linux kernel: usb 3-4: USB disconnect, device number 3
Feb 19 09:38:34 pc-linux systemd-logind[470]: Power key pressed.
Feb 19 09:38:35 pc-linux systemd-logind[470]: Power key pressed.
Feb 19 09:38:35 pc-linux systemd-logind[470]: Power key pressed.
Feb 19 09:38:36 pc-linux org.freedesktop.Tracker1[1269]: Received signal:15->'Beendet'
Feb 19 09:38:36 pc-linux org.freedesktop.Tracker1[1269]: OK

I had to press the power button a few times for it to shut down. Do you know a solution regarding this? I tend to disconnect my phone (lg nexus 4 if that helps) while the computer shuts down. I don't want to wait until it is finished.

Offline

#2 2016-02-25 09:35:34

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Shutdown hangs when disconnecting USB devices while shutting down.

I assume the device that cause problem is the 'nexus 4'? How is this device normally accessed? Does it contains a filesystem that you mount to access files in it? If yes, are you properly unmounting it before the shutdown? If not, then it might be the source of the problem. The system try to unmount the filesystem and don't succeed since the device is unplugged. By the way disconnecting a mounted device without unmounting it can lead to filesystem corruption and data loss.

Last edited by olive (2016-02-25 09:36:08)

Offline

#3 2016-02-26 08:56:33

Bradan
Member
Registered: 2015-10-13
Posts: 21

Re: Shutdown hangs when disconnecting USB devices while shutting down.

Thank you for your answer.

olive wrote:

I assume the device that cause problem is the 'nexus 4'? How is this device normally accessed? Does it contains a filesystem that you mount to access files in it? If yes, are you properly unmounting it before the shutdown? If not, then it might be the source of the problem. The system try to unmount the filesystem and don't succeed since the device is unplugged.

Hmm, good question. Well, MTP is something special, it isn't really mounted. Paths in nautilus look like "mtp://[usb:003,003]/Internal%20storage" and "cat /proc/mounts" doesn't change when connecting/disconnecting the device. Even if I don't ever go into the device the disconnect event blocks the shutdown.

olive wrote:

By the way disconnecting a mounted device without unmounting it can lead to filesystem corruption and data loss.

Nexus 4 is a mobile phone and the interface to access it is MTP, which is strictly file based (you can't modify the filesystem's plain bytes). There is no possibility to corrupt the file system itself as far as I know. Ofcourse, with harddisks you are right.

Offline

Board footer

Powered by FluxBB