You are not logged in.

#1 2025-12-08 13:00:42

andyturfer
Member
Registered: 2021-01-08
Posts: 106

[SOLVED] Slow shutdown after using an Android Virtual Device

I run Arch with KDE Plasma. Whenever I fire up (and then close down) an AVD (Android Virtual Device), my computer takes ages to shutdown. During the shutdown process, I see this:

A stop job is running for User Manager for UID 1000 (10s / 1min 49s)

This only happens if I use an AVD. If I don't fire up an AVD, shutdown is fast. So I'm guessing just closing the AVD is not closing everything, hence the reason why the shutdown takes so long.

How can I diagnose the issue to find out exactly what's blocking the shutdown?

Last edited by andyturfer (2025-12-15 13:14:23)

Offline

#2 2025-12-15 12:06:11

andyturfer
Member
Registered: 2021-01-08
Posts: 106

Re: [SOLVED] Slow shutdown after using an Android Virtual Device

I found a solution! Either run this before shutting down or rebooting:

adb kill-server

Or add this systemd shutdown unit:

# /etc/systemd/system/adb-kill.service

[Unit]
Description=Kill ADB server on shutdown or reboot
DefaultDependencies=no
Before=shutdown.target reboot.target halt.target poweroff.target

[Service]
Type=oneshot
ExecStart=/usr/bin/adb kill-server
RemainAfterExit=yes

[Install]
WantedBy=shutdown.target

Then enable the unit:

$ sudo systemctl daemon-reload
$ sudo sytsemctl enable --now adb-kill.service

After doing this, I no longer get the "...stop job is waiting..." delays when rebooting or shutting down.

Offline

Board footer

Powered by FluxBB