]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/user-sessions/user-sessions.c
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
6 #include "label-util.h"
9 #include "reboot-util.h"
10 #include "string-util.h"
12 static int run(int argc
, char *argv
[]) {
16 return log_error_errno(SYNTHETIC_ERRNO(EINVAL
),
17 "This program requires one argument.");
27 /* We only touch /run/nologin. See create_shutdown_run_nologin_or_warn() for details. */
29 if (streq(argv
[1], "start"))
30 return unlink_or_warn("/run/nologin");
31 if (streq(argv
[1], "stop"))
32 return create_shutdown_run_nologin_or_warn();
34 return log_error_errno(SYNTHETIC_ERRNO(EINVAL
), "Unknown verb '%s'.", argv
[1]);
37 DEFINE_MAIN_FUNCTION(run
);