We'd translate our action to sysv runlevel action, only to discard the result
in talk_initctl(). Let's just ifdef the whole thing away.
Fixes #12103.
};
assert(arg_action >= 0 && arg_action < _ACTION_MAX);
-
return table[arg_action];
}
#endif
if (start_unit(0, NULL, NULL) == 0)
return 0;
+#if HAVE_SYSV_COMPAT
/* Nothing else worked, so let's try /dev/initctl */
if (talk_initctl(action_to_runlevel()) > 0)
return 0;
+#endif
return log_error_errno(SYNTHETIC_ERRNO(EIO),
"Failed to talk to init daemon.");
#include "strv.h"
#include "sysv-compat.h"
-int talk_initctl(char rl) {
#if HAVE_SYSV_COMPAT
+int talk_initctl(char rl) {
struct init_request request;
_cleanup_close_ int fd = -1;
const char *p;
return log_error_errno(r, "Failed to write to %s: %m", p);
return 1;
-#else
- return 0;
-#endif
}
+#endif
int parse_shutdown_time_spec(const char *t, usec_t *ret) {
assert(t);
#include "time-util.h"
+#if HAVE_SYSV_COMPAT
int talk_initctl(char runlevel);
+#endif
+
int parse_shutdown_time_spec(const char *t, usec_t *ret);
/* The init script exit codes for the LSB 'status' verb. (This is different from the 'start' verb, whose exit