HALF ECHO LEARN / REFERENCE COLLECTION

v262.2

src/systemctl/systemctl.c

52,177 bytesGit mode 100644Download original fileLGPL-2.1-or-later

Git blob: 18026e1e5236d77ac6d1fd1958ce523350557465

Lines 1001–1105 of 1,105

           "Link one or more units files into the search path");
VERB_SCOPE(, verb_enable,            "revert",           "UNIT…\0",      2,        VERB_ANY, 0,
           "Revert one or more unit files to vendor version");
VERB_SCOPE(, verb_add_dependency,    "add-wants",        "TARGET UNIT…\0", 3,      VERB_ANY, 0,
           "Add 'Wants' dependency for the target on specified one or more units");
VERB_SCOPE(, verb_add_dependency,    "add-requires",     "TARGET UNIT…\0", 3,      VERB_ANY, 0,
           "Add 'Requires' dependency for the target on specified one or more units");
VERB_SCOPE(, verb_edit,              "edit",             "UNIT…\0",      2,        VERB_ANY, VERB_ONLINE_ONLY,
           "Edit one or more unit files");
VERB_SCOPE(, verb_get_default,       "get-default",      NULL,         VERB_ANY, 1,        0,
           "Get the name of the default target");
VERB_SCOPE(, verb_set_default,       "set-default",      "TARGET\0",     2,        2,        0,
           "Set the default target");
 
VERB_GROUP("Machine Commands");
 
VERB_SCOPE(, verb_list_machines,     "list-machines",    "[PATTERN…]\0", VERB_ANY, VERB_ANY, VERB_ONLINE_ONLY,
           "List local containers and host");
 
VERB_GROUP("Job Commands");
 
VERB_SCOPE(, verb_list_jobs,         "list-jobs",        "[PATTERN…]\0", VERB_ANY, VERB_ANY, VERB_ONLINE_ONLY,
           "List jobs");
VERB_SCOPE(, verb_cancel,            "cancel",           "[JOB…]\0",     VERB_ANY, VERB_ANY, VERB_ONLINE_ONLY,
           "Cancel all, one, or more jobs");
 
VERB_GROUP("Environment Commands");
 
VERB_SCOPE(, verb_show_environment,  "show-environment", NULL,         VERB_ANY, 1,        VERB_ONLINE_ONLY,
           "Dump environment");
VERB_SCOPE(, verb_set_environment,   "set-environment",  "VARIABLE=VALUE…\0", 2,   VERB_ANY, VERB_ONLINE_ONLY,
           "Set one or more environment variables");
VERB_SCOPE(, verb_set_environment,   "unset-environment", "VARIABLE…\0", 2,        VERB_ANY, VERB_ONLINE_ONLY,
           "Unset one or more environment variables");
VERB_SCOPE(, verb_import_environment, "import-environment", "VARIABLE…\0", VERB_ANY, VERB_ANY, VERB_ONLINE_ONLY,
           "Import all or some environment variables");
 
VERB_GROUP("Manager State Commands");
 
VERB_SCOPE(, verb_daemon_reload,     "daemon-reload",    NULL,         1,        1,        VERB_ONLINE_ONLY,
           "Reload systemd manager configuration");
VERB_SCOPE(, verb_daemon_reload,     "daemon-reexec",    NULL,         1,        1,        VERB_ONLINE_ONLY,
           "Reexecute systemd manager");
VERB_SCOPE(, verb_log_setting,       "log-level",        "[LEVEL]\0",    VERB_ANY, 2,        VERB_ONLINE_ONLY,
           "Get/set logging threshold for manager");
VERB_SCOPE(, verb_log_setting,       "log-target",       "[TARGET]\0",   VERB_ANY, 2,        VERB_ONLINE_ONLY,
           "Get/set logging target for manager");
VERB_SCOPE(, verb_service_watchdogs, "service-watchdogs", "[BOOL]\0",    VERB_ANY, 2,        VERB_ONLINE_ONLY,
           "Get/set service watchdog state");
 
VERB_GROUP("System Commands");
 
VERB_SCOPE(, verb_is_system_running, "is-system-running", NULL,        VERB_ANY, 1,        0,
           "Check whether system is fully running");
VERB_SCOPE(, verb_start_special,     "default",          NULL,         VERB_ANY, 1,        VERB_ONLINE_ONLY,
           "Enter system default mode");
VERB_SCOPE(, verb_start_system_special, "rescue",        NULL,         VERB_ANY, 1,        VERB_ONLINE_ONLY,
           "Enter system rescue mode");
VERB_SCOPE(, verb_start_system_special, "emergency",     NULL,         VERB_ANY, 1,        VERB_ONLINE_ONLY,
           "Enter system emergency mode");
VERB_SCOPE(, verb_start_system_special, "halt",          NULL,         VERB_ANY, 1,        VERB_ONLINE_ONLY,
           "Shut down and halt the system");
VERB_SCOPE(, verb_start_system_special, "poweroff",      NULL,         VERB_ANY, 1,        VERB_ONLINE_ONLY,
           "Shut down and power-off the system");
VERB_SCOPE(, verb_start_system_special, "reboot",        NULL,         VERB_ANY, 1,        VERB_ONLINE_ONLY,
           "Shut down and reboot the system");
VERB_SCOPE(, verb_start_system_special, "kexec",         NULL,         VERB_ANY, 1,        VERB_ONLINE_ONLY,
           "Shut down and reboot the system with kexec");
VERB_SCOPE(, verb_start_system_special, "soft-reboot",   NULL,         VERB_ANY, 1,        VERB_ONLINE_ONLY,
           "Shut down and reboot userspace");
VERB_SCOPE(, verb_start_special,     "exit",             "[EXIT_CODE]\0", VERB_ANY, 2,       VERB_ONLINE_ONLY,
           "Request user instance or container exit");
VERB_SCOPE(, verb_switch_root,       "switch-root",      "[ROOT [INIT]]\0", VERB_ANY, VERB_ANY, VERB_ONLINE_ONLY,
           "Change to a different root file system");
VERB_SCOPE(, verb_start_system_special, "sleep",         NULL,         VERB_ANY, 1,        VERB_ONLINE_ONLY,
           "Put the system to sleep (through one of the operations below)");
VERB_SCOPE(, verb_start_system_special, "suspend",       NULL,         VERB_ANY, 1,        VERB_ONLINE_ONLY,
           "Suspend the system");
VERB_SCOPE(, verb_start_system_special, "hibernate",     NULL,         VERB_ANY, 1,        VERB_ONLINE_ONLY,
           "Hibernate the system");
VERB_SCOPE(, verb_start_system_special, "hybrid-sleep",  NULL,         VERB_ANY, 1,        VERB_ONLINE_ONLY,
           "Hibernate and suspend the system");
VERB_SCOPE(, verb_start_system_special, "suspend-then-hibernate", NULL, VERB_ANY, 1,       VERB_ONLINE_ONLY,
           "Suspend the system, wake after a period of time, and hibernate");
 
/* Compatibility aliases / deprecated verbs hidden from --help. */
VERB_SCOPE(, verb_trivial_method,    "clear-jobs",       NULL, VERB_ANY, 1,      VERB_ONLINE_ONLY, /* help= */ NULL); /* systemctl < 4 */
VERB_SCOPE(, verb_start,             "condstop",         NULL, 2,      VERB_ANY, VERB_ONLINE_ONLY, /* help= */ NULL); /* ALTLinux */
VERB_SCOPE(, verb_start,             "reload-or-try-restart", NULL, 2, VERB_ANY, VERB_ONLINE_ONLY, /* help= */ NULL); /* systemctl <= 228 */
VERB_SCOPE(, verb_start,             "force-reload",     NULL, 2,      VERB_ANY, VERB_ONLINE_ONLY, /* help= */ NULL); /* SysV */
VERB_SCOPE(, verb_start,             "condreload",       NULL, 2,      VERB_ANY, VERB_ONLINE_ONLY, /* help= */ NULL); /* ALTLinux */
VERB_SCOPE(, verb_start,             "condrestart",      NULL, 2,      VERB_ANY, VERB_ONLINE_ONLY, /* help= */ NULL); /* RH */
VERB_SCOPE(, verb_is_active,         "check",            NULL, 2,      VERB_ANY, VERB_ONLINE_ONLY, /* help= */ NULL); /* deprecated alias of is-active */
 
int systemctl_main(char **args) {
        const Verb *verb = verbs_find_verb(args[0]);
 
        if (verb && (verb->flags & VERB_ONLINE_ONLY) && arg_root)
                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                       "Verb '%s' cannot be used with --root= or --image=.",
                                       args[0] ?: verb->verb);
 
        return dispatch_verb(args, NULL);
}