chiark / gitweb /
service/socket: show main/control pids in dump
[elogind.git] / service.c
index 7ed9783f796c2786fe7c402dc9df122efea3f8fb..3d840cbd92f9c3c8a1cfa53d9e8de01b2f41edb2 100644 (file)
--- a/service.c
+++ b/service.c
@@ -768,6 +768,16 @@ static void service_dump(Unit *u, FILE *f, const char *prefix) {
                 prefix, kill_mode_to_string(s->kill_mode),
                 prefix, service_type_to_string(s->type));
 
+        if (s->control_pid > 0)
+                fprintf(f,
+                        "%sControl PID: %llu\n",
+                        prefix, (unsigned long long) s->control_pid);
+
+        if (s->main_pid > 0)
+                fprintf(f,
+                        "%sMain PID: %llu\n",
+                        prefix, (unsigned long long) s->main_pid);
+
         if (s->pid_file)
                 fprintf(f,
                         "%sPIDFile: %s\n",
@@ -968,6 +978,9 @@ static void service_set_state(Service *s, ServiceState state) {
             state == SERVICE_AUTO_RESTART)
                 service_notify_sockets(s);
 
+        if (old_state == state)
+                return;
+
         log_debug("%s changed %s → %s", unit_id(UNIT(s)), service_state_to_string(old_state), service_state_to_string(state));
 
         unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state]);