flatcar / Flatcar

Flatcar project repository for issue tracking, project documentation, etc.
https://www.flatcar.org/
Apache License 2.0
654 stars 27 forks source link

Pre-enabled systemd units show as disabled #1330

Open Winnie81 opened 5 months ago

Winnie81 commented 5 months ago

After install Flatcar 3760.2.0 or 3850.0.0:

core@localhost ~ $ systemctl status vmtoolsd ● vmtoolsd.service - Service for virtual machines hosted on VMware Loaded: loaded (/usr/lib/systemd/system/vmtoolsd.service; disabled; preset: disabled) Drop-In: /usr/lib/systemd/system/vmtoolsd.service.d └─flatcar-fixups.conf Active: active (running) since Tue 2024-01-23 03:05:28 UTC; 3min 6s ago Docs: https://github.com/vmware/open-vm-tools Process: 1286 ExecStartPre=/usr/bin/ln -sfrT /usr/share/flatcar/oem-vmware/vmware-tools /etc/vmware-tools (code=exited, status=0/SUCCESS) Main PID: 1373 (vmtoolsd) Tasks: 4 (limit: 7046) Memory: 7.0M CPU: 237ms CGroup: /system.slice/vmtoolsd.service └─1373 /usr/bin/vmtoolsd

Jan 23 03:05:27 localhost systemd[1]: Starting vmtoolsd.service - Service for virtual machines hosted on VMware... Jan 23 03:05:28 localhost systemd[1]: Started vmtoolsd.service - Service for virtual machines hosted on VMware. core@localhost ~ $ systemctl status vgauthd ● vgauthd.service - VGAuth Service for open-vm-tools Loaded: loaded (/usr/lib/systemd/system/vgauthd.service; disabled; preset: disabled) Drop-In: /usr/lib/systemd/system/vgauthd.service.d └─flatcar-fixups.conf Active: active (running) since Tue 2024-01-23 03:05:27 UTC; 3min 55s ago Docs: https://github.com/vmware/open-vm-tools Main PID: 1285 (VGAuthService) Tasks: 1 (limit: 7046) Memory: 4.4M CPU: 29ms CGroup: /system.slice/vgauthd.service └─1285 /usr/bin/VGAuthService -s

Jan 23 03:05:27 localhost systemd[1]: Starting vgauthd.service - VGAuth Service for open-vm-tools... Jan 23 03:05:27 localhost systemd[1]: Started vgauthd.service - VGAuth Service for open-vm-tools. Jan 23 03:05:27 localhost VGAuthService[1285]: Pref_Init: Using '/etc/vmware-tools/vgauth.conf' as preferences filepath Jan 23 03:05:27 localhost VGAuthService[1285]: Core dump limit set to -1

core@localhost ~ $ systemctl is-enabled vmtoolsd disabled core@localhost ~ $ systemctl is-enabled vgauthd disabled

In previous versions, it is enabled by default. I'd like to confirm whether it is by designed currently. Thanks.

t-lo commented 5 months ago

Thank you for raising this, Winnie. The good news is, both services are running (indicated by the Active: active (running) since Tue 2024-01-23 03:05:27 UTC; 3min 55s ago status line on the output above). They are not started directly but via a dependency in /usr/lib/systemd/system/multi-user.target.d/open-vm-tools-sysext-upholds.conf; this changed from previous Flatcar releases when we switched to systemd-sysext for OEM tools.

Formerly, OEM tools like vmtoolsd and vgauthd were installed directly in the OEM partition, and were started directly via their service unit files. With our switch to systemd-sysext we instead ship tools and unit files in an extension image. This also requires us to start OEM services differently, via the "upholds" mechanism instead of a simple, direct service dependency (soft link to a systemd target). We switched to extension images for OEM tools because it makes it very easy for us to update OEM tools alongside the base OS.

So while the services seem deactivated, they are in fact active and guaranteed to start.

pothos commented 5 months ago

When we update to systemd 255 we can use .upholds symlinks that are like the .wants-enablement symlinks. For symlinks under /etc at least this will then show "enabled" but - similar to other services like update-engine.service, this does not work for symlinks under /usr (yet, until someone cares to do this but so far for the first decade of the project this stayed unresolved).