1

On Arch Linux, since a few system updates (unfortunately I cannot say which ones), vmware.service hangs during shutdown / reboot.

I discovered that if I manually stop that service (systemctl stop vmware.service) while gdm.service is still running (i.e. from Gnome terminal), the service is stopped quickly and shutdown then is as fast as expected. I've googled around and found that also on Fedora 21 there is a similar problem and one user ended up switching to lightdm to fix that. I don't want to switch to lightdm so I'm wondering if there is any way to tell systemd to stop vmware.service before stopping gdm.service. Or if anyone has a workardound for that...

1 Answer 1

0

Surely, there is a way. systemd supports specifying so-called "ordering dependencies" between pairs of units which make systemd follow a certain mutual ordering when these units happen to be activated/deactivated in a single transaction.

From systemd.unit(5):

Before=, After=

A space-separated list of unit names. Configures ordering dependencies between units. If a unit foo.service contains a setting Before=bar.service and both units are being started, bar.service's start-up is delayed until foo.service is started up. <...> Note that when two units with an ordering dependency between them are shut down, the inverse of the start-up order is applied. i.e. if a unit is configured with After= on another unit, the former is stopped before the latter if both are shut down. <...>

So, you want vmware.service to be deactivated (stopped) before gdm.service is stopped. Per the above, can be achieved by adding a After=gdm.service ordering dependency to the vmware.service unit.

In order to avoid copying the whole unit to /etc/systemd/system, you may want to use the mechanism of drop-ins (see "example 2"). You need to create a file named /etc/systemd/system/vmware.service.d/<some name>.conf with only the required directives and section headers:

[Unit]
After=gdm.service

After doing this, issue a systemctl daemon-reload command to make systemd re-read the units. On shutdown, the new dependency list should become effective.

3
  • Hi, thanks for your answer! Your answer is formally correct, however vmware daemon still hangs on shutdown... :(
    – lviggiani
    May 22, 2015 at 6:39
  • Then it needs more investigation. I suppose the reason is that "stop before gdm" ≠ "stop before user sessions exit", and vmware actually needs the latter. However, I don't know whether this is achievable at all.
    – intelfx
    May 22, 2015 at 12:04
  • Yes I understand what you say... so I ended up adding TimeoutStopSec=1 to my vmware.service. I know it's not an elegant solution but it works.
    – lviggiani
    May 25, 2015 at 9:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .