[systemd-devel] Update .Xauthority on hostnamed change

Igor Chudov nir at altlinux.org
Thu Aug 22 12:42:46 UTC 2019


Hello!

I want to update user's .Xauthority file with cookies targeted at new hostname on hostname change via hostnamectl. I need an advice about the best possible approach for solving this problem. I tried to investigate several possible approaches:

- Add xauth functions to systemd-hostnamed (or hostnamectl). This approach will require linking with Xorg libraries and efforts to maintain patch aside from mainstream;
- Implement separate systemd service which is activated on request to D-Bus interface org.freedesktop.hostname1 . The problem is that I will need to know if systemd-hostnamed changed hostname correctly somehow and will also need to know previous hostname;
- Implement separate application listening D-Bus for PropertiesChanged signal and somehow verify if required property changed.

So... Is there any other (more sane) way to solve a problem? Maybe it is possible to create a hook for hostnamed?

-- 
With best regards, Igor Chudov



More information about the systemd-devel mailing list