manager: add Reload() D-Bus command

System Internals / NetworkManager - Thomas Haller [redhat.com] - 1 June 2016 12:06 UTC

Add new Reload D-Bus command to reload NetworkManager configuration.

For now, this is like sending SIGHUP to the process. There are several advantages here:

- it is guarded via PolicyKit authentication while signals can only be sent by root.

- the user can wait for the reload to be complete instead of sending an asynchronous signal. For now, we operation completes after nm_config_reload() returns, but later we could delay the response further until specific parts are fully reloaded.

- SIGHUP reloads everything including re-reading configuration from disk while SIGUSR1 reloads just certain parts such as writing out DNS configuration anew. Now, the Reload command has a flags argument which is more granular in selecting parts which are to be reloaded. For example, via signals the user can:

1) send SIGUSR1: this writes out the DNS configuration to resolv.conf and possibly reloads other parts without re-reading configuration and without restarting the DNS plugin. 2) send SIGHUP: this reloads configuration from disk, writes out resolv.conf and restarts the DNS plugin.

There is no way, to only restart the DNS plugin without also reloading everything else.

1d0e0ee manager: add Reload() D-Bus command
clients/cli/general.c | 3 +
data/NetworkManager.service.in | 1 +
introspection/nm-manager.xml | 9 ++
libnm-core/nm-errors.h | 2 +
libnm-glib/nm-client.c | 3 +
libnm-glib/nm-client.h | 5 +-
libnm/nm-client.h | 4 +-
libnm/nm-manager.c | 3 +
man/nmcli-examples.xml | 3 +-
po/POTFILES.skip | 1 +
policy/org.freedesktop.NetworkManager.policy.in.in | 10 +++
src/nm-audit-manager.h | 1 +
src/nm-auth-utils.h | 1 +
src/nm-manager.c | 86 ++++++++++++++++++++
tools/test-networkmanager-service.py | 1 +
15 files changed, 130 insertions(+), 3 deletions(-)

Upstream: cgit.freedesktop.org


  • Share