1158
|
|
|
Teddy Hogeborn |
5 years ago
|
|
|
1138
|
|
Fix bug in server Debian package: Fails to start on first install
There has been a very long-standing bug where installation of the server (the "mandos" Debian package) would fail to start the server properly right after installation. It would work on manual (re)start after installation, or after reboot, and even after package purge and reinstall, it would then work the first time. The problem, it turns out, is when the new "_mandos" user (and corresponding group) is created, the D-Bus server is not reloaded, and is therefore not aware of that user, and does not recognize the user and group name in the /etc/dbus-1/system.d/mandos.conf file. The Mandos server, when it tries to start and access the D-Bus, is then not permitted to connect to its D-Bus bus name, and disables D-Bus use as a fallback measure; i.e. the server works, but it is not controllable via D-Bus commands (via mandos-ctl or mandos-monitor). The next time the D-Bus daemon is reloaded for any reason, the new user & group would become visible to the D-Bus daemon and after that, any restart of the Mandos server would succeed and it would bind to its D-Bus name properly, and thereby be visible and controllable by mandos-ctl & mandos-monitor. This was mostly invisible when using sysvinit, but systemd makes the problem visible since the systemd service file for the Mandos server is configured to not consider the Mandos server "started" until the D-Bus name has been bound; this makes the starting of the service wait for 90 seconds and then fail with a timeout error.
Fixing this should also make the Debian CI autopkgtest tests work.
* debian/mandos.postinst (configure): After creating (or renaming) user & group, reload D-Bus daemon (if present).
|
Teddy Hogeborn |
5 years ago
|
|
|
971
|
|
|
Teddy Hogeborn |
5 years ago
|
|
|
967
|
|
|
Teddy Hogeborn |
5 years ago
|
|
|
837
|
|
|
Teddy Hogeborn |
8 years ago
|
|
|
825
|
|
|
Teddy Hogeborn |
8 years ago
|
|
|
690
|
|
|
Teddy Hogeborn |
10 years ago
|
|
|
650
|
|
|
Teddy Hogeborn |
10 years ago
|
|
|
524
|
|
|
Björn Påhlsson |
13 years ago
|
|
|
515
|
|
|
Teddy Hogeborn |
13 years ago
|
|
|
347
|
|
|
Teddy Hogeborn |
15 years ago
|
|
|
275
|
|
|
Teddy Hogeborn |
15 years ago
|
|
|
250
|
|
|
Teddy Hogeborn |
15 years ago
|
|
|
238
|
|
First version of a somewhat complete D-Bus server interface. Also change user/group name to "_mandos".
* debian/mandos.postinst: Rename old "mandos" user and group to "_mandos"; create "_mandos" user and group if none exist. * debian/mandos-client.postinst: - '' -
* initramfs-tools-hook: Try "_mandos" before "mandos" as user and group name.
* mandos (_datetime_to_dbus_struct): New; was previously local. (Client.started): Renamed to "last_started". All users changed. (Client.started): New; boolean. (Client.dbus_object_path): New. (Client.check_command): Renamed to "checker_command". All users changed. (Client.__init__): Set and use "self.dbus_object_path". Set "self.started". (Client.start): Update "self.started". Emit "self.PropertyChanged" signals for both "started" and "last_started". (Client.stop): Update "self.started". Emit "self.PropertyChanged" signal for "started". (Client.checker_callback): Take additional "command" argument. All callers changed. Emit "self.PropertyChanged" signal. (Client.bump_timeout): Emit "self.PropertyChanged" signal for "last_checked_ok". (Client.start_checker): Emit "self.PropertyChanged" signal for "checker_running". (Client.stop_checker): Emit "self.PropertyChanged" signal for "checker_running". (Client.still_valid): Bug fix: use "getattr(self, started, False)" instead of "self.started" in case this client object is so new that the "started" attribute has not been created yet. (Client.IntervalChanged, Client.CheckerIsRunning, Client.GetChecker, Client.GetCreated, Client.GetFingerprint, Client.GetHost, Client.GetInterval, Client.GetName, Client.GetStarted, Client.GetTimeout, Client.StateChanged, Client.TimeoutChanged): Removed; all callers changed. (Client.CheckerCompleted): Add "condition" and "command" arguments. All callers changed. (Client.GetAllProperties, Client.PropertyChanged): New. (Client.StillValid): Renamed to "IsStillValid". (Client.StartChecker): Changed to its own function to avoid the return value from "Client.start_checker()". (Client.Stop): Changed to its own function to avoid the return value from "Client.stop()". (main): Try "_mandos" before "mandos" as user and group name. Removed inner function "remove_from_clients". New inner class "MandosServer".
|
Teddy Hogeborn |
16 years ago
|
|
|
210
|
|
|
Teddy Hogeborn |
16 years ago
|
|
|
195
|
|
|
Teddy Hogeborn |
16 years ago
|
|
|
188
|
|
|
Teddy Hogeborn |
16 years ago
|
|
|