f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina Pavel Březina <pbrezina@redhat.com>
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina Copyright (C) 2016 Red Hat
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina This program is free software; you can redistribute it and/or modify
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina it under the terms of the GNU General Public License as published by
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina the Free Software Foundation; either version 3 of the License, or
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina (at your option) any later version.
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina This program is distributed in the hope that it will be useful,
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina but WITHOUT ANY WARRANTY; without even the implied warranty of
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina GNU General Public License for more details.
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina You should have received a copy of the GNU General Public License
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina along with this program. If not, see <http://www.gnu.org/licenses/>.
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina#define SSS_SYSTEMD_BUS "org.freedesktop.systemd1"
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina#define SSS_SYSTEMD_PATH "/org/freedesktop/systemd1"
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina#define SSS_SYSTEMD_IFACE "org.freedesktop.systemd1.Manager"
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina#define SSS_SYSTEMD_MODE "replace" /* replace queued job if present */
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina DEBUG(SSSDBG_CRIT_FAILURE, "Unable to connect to systemd D-Bus "
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březinastatic errno_t sssctl_systemd_call(const char *method)
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina msg = sbus_create_message(NULL, SSS_SYSTEMD_BUS, SSS_SYSTEMD_PATH,
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina DEBUG(SSSDBG_CRIT_FAILURE, "Unable to create D-Bus Message!\n");
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina reply = dbus_connection_send_with_reply_and_block(conn, msg, 5000, &error);
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina DEBUG(SSSDBG_CRIT_FAILURE, "Unable to send D-Bus message "
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina ret = sbus_parse_message(reply, DBUS_TYPE_OBJECT_PATH, &job);
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina DEBUG(SSSDBG_CRIT_FAILURE, "Unable to get D-Bus reply [%d]: %s!\n",
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina DEBUG(SSSDBG_TRACE_FUNC, "New systemd job created: %s\n", job);
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina DEBUG(SSSDBG_TRACE_FUNC, "Starting SSSD via systemd...\n");
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina DEBUG(SSSDBG_TRACE_FUNC, "Stopping SSSD via systemd...\n");
f4f2edba5c555773d7c9adfa95562b96b0c0cdb2Pavel Březina DEBUG(SSSDBG_TRACE_FUNC, "Restarting SSSD via systemd...\n");