mirror of
https://github.com/systemd/systemd.git
synced 2026-08-04 15:10:33 +00:00
daemon-util: Rename starting/stopping message constants
Currently, NOTIFY_READY from daemon-util.h conflicts with NOTIFY_READY from NotifyState from service.h so let's rename the constants to avoid the conflict.
This commit is contained in:
@@ -39,7 +39,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to start up daemon: %m");
|
||||
|
||||
notify_stop = notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify_stop = notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
r = sd_event_loop(m->event);
|
||||
if (r < 0)
|
||||
|
||||
@@ -1939,7 +1939,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_notify(false, NOTIFY_READY);
|
||||
r = sd_notify(false, NOTIFY_READY_MESSAGE);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to send readiness notification, ignoring: %m");
|
||||
|
||||
|
||||
@@ -2044,7 +2044,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_notify(false, NOTIFY_READY);
|
||||
r = sd_notify(false, NOTIFY_READY_MESSAGE);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to send readiness notification, ignoring: %m");
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
notify_stop = notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify_stop = notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
while (!server.quit) {
|
||||
struct epoll_event event;
|
||||
|
||||
@@ -1180,7 +1180,7 @@ static int run(int argc, char **argv) {
|
||||
log_debug("%s running as pid "PID_FMT,
|
||||
program_invocation_short_name, getpid_cached());
|
||||
|
||||
notify_message = notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify_message = notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
while (s.active) {
|
||||
r = sd_event_get_state(s.event);
|
||||
|
||||
@@ -982,7 +982,7 @@ static int run(int argc, char **argv) {
|
||||
|
||||
notify_message = notify_start("READY=1\n"
|
||||
"STATUS=Processing input...",
|
||||
NOTIFY_STOPPING);
|
||||
NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
for (;;) {
|
||||
r = sd_event_get_state(u.event);
|
||||
|
||||
@@ -2057,7 +2057,7 @@ static int dispatch_notify_event(sd_event_source *es, int fd, uint32_t revents,
|
||||
* there's something to send it will be turned on again. */
|
||||
|
||||
if (!s->sent_notify_ready) {
|
||||
if (send(s->notify_fd, NOTIFY_READY, strlen(NOTIFY_READY), MSG_DONTWAIT) < 0) {
|
||||
if (send(s->notify_fd, NOTIFY_READY_MESSAGE, strlen(NOTIFY_READY_MESSAGE), MSG_DONTWAIT) < 0) {
|
||||
if (errno == EAGAIN)
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -664,7 +664,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_notify(false, NOTIFY_READY);
|
||||
r = sd_notify(false, NOTIFY_READY_MESSAGE);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to send readiness notification, ignoring: %m");
|
||||
|
||||
|
||||
@@ -1088,7 +1088,7 @@ static int manager_dispatch_reload_signal(sd_event_source *s, const struct signa
|
||||
else
|
||||
log_info("Config file reloaded.");
|
||||
|
||||
(void) sd_notify(/* unset= */ false, NOTIFY_READY);
|
||||
(void) sd_notify(/* unset= */ false, NOTIFY_READY_MESSAGE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1268,7 +1268,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to fully start up daemon: %m");
|
||||
|
||||
notify_message = notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify_message = notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
return manager_run(m);
|
||||
}
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to fully start up daemon: %m");
|
||||
|
||||
r = sd_notify(false, NOTIFY_READY);
|
||||
r = sd_notify(false, NOTIFY_READY_MESSAGE);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to send readiness notification, ignoring: %m");
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to start up daemon: %m");
|
||||
|
||||
notify_stop = notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify_stop = notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
r = sd_event_loop(m->event);
|
||||
if (r < 0)
|
||||
|
||||
@@ -1229,6 +1229,6 @@ int manager_reload(Manager *m, sd_bus_message *message) {
|
||||
log_debug("Reloaded.");
|
||||
r = 0;
|
||||
finish:
|
||||
(void) sd_notify(/* unset_environment= */ false, NOTIFY_READY);
|
||||
(void) sd_notify(/* unset_environment= */ false, NOTIFY_READY_MESSAGE);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Could not start manager: %m");
|
||||
|
||||
notify_message = notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify_message = notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
r = sd_event_loop(m->event);
|
||||
if (r < 0)
|
||||
|
||||
@@ -34,7 +34,7 @@ static int run(int argc, char *argv[]) {
|
||||
return log_error_errno(r, "Failed to start up daemon: %m");
|
||||
|
||||
_unused_ _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
|
||||
notify_stop = notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify_stop = notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
r = sd_event_loop(m->event);
|
||||
if (r < 0)
|
||||
|
||||
@@ -660,7 +660,7 @@ static int manager_dispatch_reload_signal(sd_event_source *s, const struct signa
|
||||
manager_set_defaults(m);
|
||||
manager_parse_config_file(m);
|
||||
|
||||
(void) sd_notify(/* unset= */ false, NOTIFY_READY);
|
||||
(void) sd_notify(/* unset= */ false, NOTIFY_READY_MESSAGE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to start up daemon: %m");
|
||||
|
||||
notify_msg = notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify_msg = notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
log_debug("systemd-oomd started%s.", arg_dry_run ? " in dry run mode" : "");
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to fully start up daemon: %m");
|
||||
|
||||
r = sd_notify(false, NOTIFY_READY);
|
||||
r = sd_notify(false, NOTIFY_READY_MESSAGE);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to send readiness notification, ignoring: %m");
|
||||
|
||||
|
||||
@@ -690,7 +690,7 @@ static int manager_dispatch_reload_signal(sd_event_source *s, const struct signa
|
||||
manager_flush_caches(m, LOG_INFO);
|
||||
manager_verify_all(m);
|
||||
|
||||
(void) sd_notify(/* unset= */ false, NOTIFY_READY);
|
||||
(void) sd_notify(/* unset= */ false, NOTIFY_READY_MESSAGE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to drop remaining caps: %m");
|
||||
|
||||
notify_stop = notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify_stop = notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
r = sd_event_loop(m->event);
|
||||
if (r < 0)
|
||||
|
||||
@@ -154,7 +154,7 @@ int bus_event_loop_with_idle(
|
||||
|
||||
/* Inform the service manager that we are going down, so that it will queue all
|
||||
* further start requests, instead of assuming we are still running. */
|
||||
(void) sd_notify(false, NOTIFY_STOPPING);
|
||||
(void) sd_notify(false, NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
r = bus_async_unregister_and_exit(e, bus, name);
|
||||
if (r < 0)
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
#define NOTIFY_READY "READY=1\n" "STATUS=Processing requests..."
|
||||
#define NOTIFY_STOPPING "STOPPING=1\n" "STATUS=Shutting down..."
|
||||
#define NOTIFY_READY_MESSAGE "READY=1\n" "STATUS=Processing requests..."
|
||||
#define NOTIFY_STOPPING_MESSAGE "STOPPING=1\n" "STATUS=Shutting down..."
|
||||
|
||||
static inline const char* notify_start(const char *start, const char *stop) {
|
||||
if (start)
|
||||
|
||||
@@ -478,7 +478,7 @@ static int run(int argc, char **argv) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
notify = notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify = notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
|
||||
@@ -688,7 +688,7 @@ static int run(int argc, char *argv[]) {
|
||||
return r;
|
||||
}
|
||||
|
||||
notify_stop = notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify_stop = notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
r = sd_event_loop(context.event);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to run event loop: %m");
|
||||
|
||||
@@ -1240,7 +1240,7 @@ static int run(int argc, char* argv[]) {
|
||||
_unused_ _cleanup_(notify_on_cleanup) const char *notify_message =
|
||||
notify_start("READY=1\n"
|
||||
"STATUS=Exposing disks in target mode...",
|
||||
NOTIFY_STOPPING);
|
||||
NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
r = sd_event_loop(event);
|
||||
if (r < 0)
|
||||
|
||||
@@ -1182,7 +1182,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_notify(false, NOTIFY_READY);
|
||||
r = sd_notify(false, NOTIFY_READY_MESSAGE);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to send readiness notification, ignoring: %m");
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ static int run(int argc, char *argv[]) {
|
||||
|
||||
notify_message = notify_start("READY=1\n"
|
||||
"STATUS=Daemon is running",
|
||||
NOTIFY_STOPPING);
|
||||
NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
r = manager_setup_save_time_event(m);
|
||||
if (r < 0)
|
||||
|
||||
@@ -406,7 +406,7 @@ static int process_and_watch_password_files(bool watch) {
|
||||
}
|
||||
|
||||
_unused_ _cleanup_(notify_on_cleanup) const char *notify_stop =
|
||||
notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
for (;;) {
|
||||
usec_t timeout = USEC_INFINITY;
|
||||
|
||||
@@ -234,7 +234,7 @@ void manager_exit(Manager *manager) {
|
||||
|
||||
manager->exit = true;
|
||||
|
||||
(void) sd_notify(/* unset= */ false, NOTIFY_STOPPING);
|
||||
(void) sd_notify(/* unset= */ false, NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
/* close sources of new events and discard buffered events */
|
||||
manager->ctrl = udev_ctrl_unref(manager->ctrl);
|
||||
@@ -1407,7 +1407,7 @@ int manager_main(Manager *manager) {
|
||||
log_warning_errno(r, "Failed to apply permissions on static device nodes, ignoring: %m");
|
||||
|
||||
_unused_ _cleanup_(notify_on_cleanup) const char *notify_message =
|
||||
notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
/* We will start processing events in the loop below. Before starting processing, let's remove the
|
||||
* event serialization fd from the fdstore, to avoid retrieving the serialized events again in future
|
||||
|
||||
@@ -47,7 +47,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to start up daemon: %m");
|
||||
|
||||
notify_stop = notify_start(NOTIFY_READY, NOTIFY_STOPPING);
|
||||
notify_stop = notify_start(NOTIFY_READY_MESSAGE, NOTIFY_STOPPING_MESSAGE);
|
||||
|
||||
r = sd_event_loop(m->event);
|
||||
if (r < 0)
|
||||
|
||||
Reference in New Issue
Block a user