logind-action.c revision 6a79c58603ea816a1b4fa1520397b4e138bc1ca0
3802a3d3d7af51ddff31943d5514382f01265770Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
12b42c76672a66c2d4ea7212c14f8f1b5a62b78dTom Gundersen/***
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek This file is part of systemd.
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
b975b0d514321f169b3c4599a8ea92e13741b4e4Zbigniew Jędrzejewski-Szmek Copyright 2012 Lennart Poettering
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
b975b0d514321f169b3c4599a8ea92e13741b4e4Zbigniew Jędrzejewski-Szmek systemd is free software; you can redistribute it and/or modify it
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek under the terms of the GNU Lesser General Public License as published by
b975b0d514321f169b3c4599a8ea92e13741b4e4Zbigniew Jędrzejewski-Szmek the Free Software Foundation; either version 2.1 of the License, or
b975b0d514321f169b3c4599a8ea92e13741b4e4Zbigniew Jędrzejewski-Szmek (at your option) any later version.
b975b0d514321f169b3c4599a8ea92e13741b4e4Zbigniew Jędrzejewski-Szmek
b975b0d514321f169b3c4599a8ea92e13741b4e4Zbigniew Jędrzejewski-Szmek systemd is distributed in the hope that it will be useful, but
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek WITHOUT ANY WARRANTY; without even the implied warranty of
b975b0d514321f169b3c4599a8ea92e13741b4e4Zbigniew Jędrzejewski-Szmek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b975b0d514321f169b3c4599a8ea92e13741b4e4Zbigniew Jędrzejewski-Szmek Lesser General Public License for more details.
b975b0d514321f169b3c4599a8ea92e13741b4e4Zbigniew Jędrzejewski-Szmek
b975b0d514321f169b3c4599a8ea92e13741b4e4Zbigniew Jędrzejewski-Szmek You should have received a copy of the GNU Lesser General Public License
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek along with systemd; If not, see <http://www.gnu.org/licenses/>.
b975b0d514321f169b3c4599a8ea92e13741b4e4Zbigniew Jędrzejewski-Szmek***/
b975b0d514321f169b3c4599a8ea92e13741b4e4Zbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek#include <unistd.h>
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
0e8415f2e5c42e87ca3b7a96138675f64696cb7aZbigniew Jędrzejewski-Szmek#include "sd-messages.h"
0e8415f2e5c42e87ca3b7a96138675f64696cb7aZbigniew Jędrzejewski-Szmek#include "conf-parser.h"
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek#include "special.h"
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek#include "sleep-config.h"
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek#include "bus-util.h"
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek#include "bus-error.h"
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek#include "logind-action.h"
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmekint manager_handle_action(
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek Manager *m,
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek InhibitWhat inhibit_key,
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek HandleAction handle,
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek bool ignore_inhibited,
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek bool is_edge) {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek static const char * const message_table[_HANDLE_ACTION_MAX] = {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_POWEROFF] = "Powering Off...",
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_REBOOT] = "Rebooting...",
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_HALT] = "Halting...",
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_KEXEC] = "Rebooting via kexec...",
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_SUSPEND] = "Suspending...",
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_HIBERNATE] = "Hibernating...",
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_HYBRID_SLEEP] = "Hibernating and suspending..."
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek };
330427e271c37400f091bf4570b5d8fa96574d36Zbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek static const char * const target_table[_HANDLE_ACTION_MAX] = {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_POWEROFF] = SPECIAL_POWEROFF_TARGET,
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_REBOOT] = SPECIAL_REBOOT_TARGET,
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_HALT] = SPECIAL_HALT_TARGET,
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_KEXEC] = SPECIAL_KEXEC_TARGET,
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_SUSPEND] = SPECIAL_SUSPEND_TARGET,
330427e271c37400f091bf4570b5d8fa96574d36Zbigniew Jędrzejewski-Szmek [HANDLE_HIBERNATE] = SPECIAL_HIBERNATE_TARGET,
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_HYBRID_SLEEP] = SPECIAL_HYBRID_SLEEP_TARGET
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek };
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek InhibitWhat inhibit_operation;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek Inhibitor *offending = NULL;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek bool supported;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek int r;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek assert(m);
a8ca47227d1ab716ba928d8b9334b655ca5a840cZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek /* If the key handling is turned off, don't do anything */
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek if (handle == HANDLE_IGNORE) {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek log_debug("Refusing operation, as it is turned off.");
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek return 0;
a8ca47227d1ab716ba928d8b9334b655ca5a840cZbigniew Jędrzejewski-Szmek }
a8ca47227d1ab716ba928d8b9334b655ca5a840cZbigniew Jędrzejewski-Szmek
a8ca47227d1ab716ba928d8b9334b655ca5a840cZbigniew Jędrzejewski-Szmek /* If we are docked don't react to lid closing */
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek if (inhibit_key == INHIBIT_HANDLE_LID_SWITCH) {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek int n;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek if (manager_is_docked(m)) {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek log_debug("Ignoring lid switch request, system is docked.");
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek return 0;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek }
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek n = manager_count_displays(m);
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek if (n != 1) {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek log_debug("Ignoring lid switch request, %s displays connected.");
dca348bcbb462305864526c587495a14a76bfcdeJan Engelhardt return 0;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek }
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek }
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek /* If the key handling is inhibited, don't do anything */
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek if (inhibit_key > 0) {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek if (manager_is_inhibited(m, inhibit_key, INHIBIT_BLOCK, NULL, true, false, 0, NULL)) {
b8bde11658366290521e3d03316378b482600323Jan Engelhardt log_debug("Refusing operation, %s is inhibited.", inhibit_what_to_string(inhibit_key));
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek return 0;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek }
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek }
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek /* Locking is handled differently from the rest. */
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek if (handle == HANDLE_LOCK) {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek if (!is_edge)
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek return 0;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek log_info("Locking sessions...");
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek session_send_lock_all(m, true);
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek return 1;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek }
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek if (handle == HANDLE_SUSPEND)
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek supported = can_sleep("suspend") > 0;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek else if (handle == HANDLE_HIBERNATE)
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek supported = can_sleep("hibernate") > 0;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek else if (handle == HANDLE_HYBRID_SLEEP)
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek supported = can_sleep("hybrid-sleep") > 0;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek else if (handle == HANDLE_KEXEC)
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek supported = access(KEXEC, X_OK) >= 0;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek else
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek supported = true;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek if (!supported) {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek log_warning("Requested operation not supported, ignoring.");
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek return -ENOTSUP;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek }
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek if (m->action_what) {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek log_debug("Action already in progress, ignoring.");
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek return -EALREADY;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek }
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek inhibit_operation = handle == HANDLE_SUSPEND || handle == HANDLE_HIBERNATE || handle == HANDLE_HYBRID_SLEEP ? INHIBIT_SLEEP : INHIBIT_SHUTDOWN;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek /* If the actual operation is inhibited, warn and fail */
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek if (!ignore_inhibited &&
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek manager_is_inhibited(m, inhibit_operation, INHIBIT_BLOCK, NULL, false, false, 0, &offending)) {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek _cleanup_free_ char *comm = NULL, *u = NULL;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
cc64d0175a3c2c974709e9962c00fbe04d74c43fZbigniew Jędrzejewski-Szmek get_process_comm(offending->pid, &comm);
dca348bcbb462305864526c587495a14a76bfcdeJan Engelhardt u = uid_to_name(offending->uid);
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek /* If this is just a recheck of the lid switch then don't warn about anything */
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek if (!is_edge) {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek log_debug("Refusing operation, %s is inhibited by UID %lu/%s, PID %lu/%s.",
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek inhibit_what_to_string(inhibit_operation),
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek (unsigned long) offending->uid, strna(u),
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek (unsigned long) offending->pid, strna(comm));
cc64d0175a3c2c974709e9962c00fbe04d74c43fZbigniew Jędrzejewski-Szmek return 0;
cc64d0175a3c2c974709e9962c00fbe04d74c43fZbigniew Jędrzejewski-Szmek }
cc64d0175a3c2c974709e9962c00fbe04d74c43fZbigniew Jędrzejewski-Szmek
cc64d0175a3c2c974709e9962c00fbe04d74c43fZbigniew Jędrzejewski-Szmek log_error("Refusing operation, %s is inhibited by UID %lu/%s, PID %lu/%s.",
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek inhibit_what_to_string(inhibit_operation),
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek (unsigned long) offending->uid, strna(u),
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek (unsigned long) offending->pid, strna(comm));
cc64d0175a3c2c974709e9962c00fbe04d74c43fZbigniew Jędrzejewski-Szmek
cc64d0175a3c2c974709e9962c00fbe04d74c43fZbigniew Jędrzejewski-Szmek warn_melody();
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek return -EPERM;
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek }
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek log_info("%s", message_table[handle]);
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek
ff9b60f38bf68eba4a47cabff14547d92e083214Torstein Husebø r = bus_manager_shutdown_or_sleep_now_or_later(m, target_table[handle], inhibit_operation, &error);
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek if (r < 0) {
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek log_error("Failed to execute operation: %s", bus_error_message(&error, r));
cc64d0175a3c2c974709e9962c00fbe04d74c43fZbigniew Jędrzejewski-Szmek return r;
cc64d0175a3c2c974709e9962c00fbe04d74c43fZbigniew Jędrzejewski-Szmek }
cc64d0175a3c2c974709e9962c00fbe04d74c43fZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek return 1;
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek}
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmekstatic const char* const handle_action_table[_HANDLE_ACTION_MAX] = {
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_IGNORE] = "ignore",
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek [HANDLE_POWEROFF] = "poweroff",
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek [HANDLE_REBOOT] = "reboot",
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek [HANDLE_HALT] = "halt",
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek [HANDLE_KEXEC] = "kexec",
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek [HANDLE_SUSPEND] = "suspend",
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek [HANDLE_HIBERNATE] = "hibernate",
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek [HANDLE_HYBRID_SLEEP] = "hybrid-sleep",
b8bde11658366290521e3d03316378b482600323Jan Engelhardt [HANDLE_LOCK] = "lock"
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek};
8a8d55f2c104cf99efe5f244fc4857a15e9f60deZbigniew Jędrzejewski-Szmek
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-SzmekDEFINE_STRING_TABLE_LOOKUP(handle_action, HandleAction);
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-SzmekDEFINE_CONFIG_PARSE_ENUM(config_parse_handle_action, handle_action, HandleAction, "Failed to parse handle action setting");
fdfccdbc985944a57017a25f44dd6acc1a937babZbigniew Jędrzejewski-Szmek