lightdm user detected, wont change hostname
-
We use FOG to deploy linux machines. After the image has been deployed, the FOG Service needs to change the hostname.
This works perfectly fine on windows, on linux the lightdm user gets detected:------------------------------------------------------------------------------ ----------------------------------UserTracker--------------------------------- ------------------------------------------------------------------------------ 04.10.2024 13:17:29 Client-Info Client Version: 0.13.0 04.10.2024 13:17:29 Client-Info Client OS: Linux 04.10.2024 13:17:29 Client-Info Server Version: 1.5.10 04.10.2024 13:17:29 Middleware::Response Success 04.10.2024 13:17:29 Middleware::Communication URL: https://fog.lan/fog/service/usertracking.report.php?action=login&user=tcimagehost\lightdm&mac=<MAC>&newService&json
this causes the hostname changer module to not change the hostname:
------------------------------------------------------------------------------ --------------------------------HostnameChanger------------------------------- ------------------------------------------------------------------------------ 04.10.2024 13:15:54 Client-Info Client Version: 0.13.0 04.10.2024 13:15:54 Client-Info Client OS: Linux 04.10.2024 13:15:54 Client-Info Server Version: 1.5.10 04.10.2024 13:15:54 Middleware::Response Success 04.10.2024 13:15:54 HostnameChanger Users still logged in and enforce is disabled, delaying any further actions ------------------------------------------------------------------------------
In “FOG Configuration -> FOG Settings -> Active Directory Defaults” the checkmark is set by “ENFORCE HOST CHANGES”.
In “FOG Configuration -> FOG Settings -> FOG Client - Task Reboot” the checkmarks are set by “Client Taskreboot enabled” and “Task Force Reboot”.
Going to “Hosts -> <Host> -> Active Directory” and enabling “Name Change/AD Join Forced reboot?” fixes the issue, but I don’t know how to force this for all hosts by default, especially including new hosts.
FOG Version 1.5.10
FOG Client Version 0.13.0 -
@pilipp_edv FOG Configuration Page -> FOG Settings -> FOG_ENFORCE_HOST_CHANGES will set this globally, though for existing hosts it may need to be enabled as well.
If this is okay for all hosts, just create a group -> add all hosts to the group -> then set up things in the same way from the group to enable this setting for all hosts that already exist.
-
@Tom-Elliott thanks for the reply, but there is no “FOG_ENFORCE_HOST_CHANGES” in FOG Configuration -> FOG Settings, only “ENFORCE HOST CHANGES” under FOG Configuration -> FOG Settings -> Active Directory Defaults and that one is already ticked.
Either that or I’m just blind. -
@pilipp_edv That’s the same thing.
In the DB the actual name is FOG_ENFORCE_HOST_CHANGES, and for 1.5.x we tried to do some fancy things by replacing
_
withFOG
-
@Tom-Elliott but why is it not enforced despite that setting being enabled?
-
@pilipp_edv I don’t know. The hosts don’t have that thing checked. Maybe there’s a bug, but I don’t know.
What I do know is that the individual host is supposed to have it checked. I thought the value there effectively worked as a global toggle.
-
can you check the services tab on your dashboard? Is the hostname changer ticked?
also how is the host created in the first place (manually, autoregister, api?)
-
@AUTH-IT-Center the hostname changer is enabled, yes. The hosts are created via full registration and inventory. Using the group-based workaround provided by @Tom-Elliott works so far.
I think there are two problems here, the fog client detects the lightdm linux user and stops and the settings don’t get applied to clients from FOG Configuration -> FOG Settings -> Active Directory defaults.
Note that we don’t join the clients to our domain, we only change their hostname.
-
for the record the Active Directory is working only for the Windows clients as described in the FOG client repo but as you said you don’t want them to join only rename. Since we are discussing for linux clients maybe that is the clue for not being enabled by default.
The database cells
hostUseAD
andhostEnforce
are the ones that enable the procedure to occur. Another test would be to add a host and check what value it has on the dB forhosts.hostUseAD
andhosts.hostEnforce
without adding the host to the group or changing anything from the dashboard. -
@AUTH-IT-Center hostEnforce falls under the UI for AD stuff because initially this was thought to only be required for Domain Joins (as hostname, restart, domain join, restart) would generally be the order of things. Then we extended the client to work on Mac OS and Linux. However, we just never moved the “enforce” changes.
Why? Domain joins for all systems also require reboots, so this “checkbox” is needed for both AD stuff and just baseline Hostname changes.
-
today I had to add some hosts (manually) and the force reboot was indeed checked when I added the hostname and mac address.
Is it possible that the registration from the FOS client doesn’t apply it on host creation?
-
@AUTH-IT-Center That is correct. That’s what that FOG Settings item is meant to do. If that is checked, on registration it should set that flag on future registrations, but it doesn’t on existing hosts that were registered before it was checked. If after this is checked and a new host registers and this isn’t working, I would believe there to be a bug.
Though a workaround exists, so while, it would be a bug, it may not be the biggest concern to get fixed immediately over say actual imaging issues.