mirror of
https://github.com/troglobit/finit.git
synced 2026-11-10 16:31:21 +00:00
Track oldpid of services to fix empty pid in restart message
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
3d98ad293b
commit
8aba63a9e3
2 files changed
+3
-2
No files matched your search
+2
-1
@@ -621,6 +621,7 @@ static void service_cleanup(svc_t *svc)
|
|||||||
basename(svc->cmd), fn);
|
basename(svc->cmd), fn);
|
||||||
|
|
||||||
/* No longer running, update books. */
|
/* No longer running, update books. */
|
||||||
|
svc->oldpid = svc->pid;
|
||||||
svc->start_time = svc->pid = 0;
|
svc->start_time = svc->pid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1284,7 +1285,7 @@ static void service_retry(svc_t *svc)
|
|||||||
|
|
||||||
_d("%s crashed, trying to start it again, attempt %d", svc->cmd, *restart_cnt);
|
_d("%s crashed, trying to start it again, attempt %d", svc->cmd, *restart_cnt);
|
||||||
logit(LOG_CONSOLE | LOG_WARNING, "Service %s[%d] died, restarting (%d/%d)",
|
logit(LOG_CONSOLE | LOG_WARNING, "Service %s[%d] died, restarting (%d/%d)",
|
||||||
svc_ident(svc, NULL, 0), svc->pid, *restart_cnt, SVC_RESPAWN_MAX);
|
svc_ident(svc, NULL, 0), svc->oldpid, *restart_cnt, SVC_RESPAWN_MAX);
|
||||||
svc_unblock(svc);
|
svc_unblock(svc);
|
||||||
service_step(svc);
|
service_step(svc);
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ typedef struct svc {
|
|||||||
/* Service details */
|
/* Service details */
|
||||||
int sighalt; /* Signal to stop prorcess, default: SIGTERM */
|
int sighalt; /* Signal to stop prorcess, default: SIGTERM */
|
||||||
int killdelay; /* Delay in msec before sending SIGKILL */
|
int killdelay; /* Delay in msec before sending SIGKILL */
|
||||||
pid_t pid;
|
pid_t oldpid, pid;
|
||||||
char pidfile[256];
|
char pidfile[256];
|
||||||
long start_time; /* Start time, as seconds since boot, from sysinfo() */
|
long start_time; /* Start time, as seconds since boot, from sysinfo() */
|
||||||
int started; /* Set for run/task/sysv to track if started */
|
int started; /* Set for run/task/sysv to track if started */
|
||||||
|
|||||||
Reference in new issue
Block a user