mirror of
https://github.com/troglobit/finit.git
synced 2026-10-25 12:04:36 +00:00
commit
4efdc4fe19
4 files changed
+12
-7
No files matched your search
+1
-1
@@ -48,7 +48,7 @@ static void pidfile_callback(void *UNUSED(arg), int fd, int UNUSED(events))
|
|||||||
|
|
||||||
sz = read(fd, ev_buf, sizeof(ev_buf) - 1);
|
sz = read(fd, ev_buf, sizeof(ev_buf) - 1);
|
||||||
if (sz <= 0) {
|
if (sz <= 0) {
|
||||||
_pe("invalid inotify event\n");
|
_pe("invalid inotify event");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ev_buf[sz] = 0;
|
ev_buf[sz] = 0;
|
||||||
|
|||||||
@@ -793,7 +793,7 @@ restart:
|
|||||||
enabled = service_enabled(svc);
|
enabled = service_enabled(svc);
|
||||||
|
|
||||||
_d("%20s(%4d): %8s %3sabled/%-7s cond:%-4s", svc->cmd, svc->pid,
|
_d("%20s(%4d): %8s %3sabled/%-7s cond:%-4s", svc->cmd, svc->pid,
|
||||||
svc_status(svc), enabled? "en" : "dis", svc_dirtystr(svc),
|
svc_status(svc), enabled ? "en" : "dis", svc_dirtystr(svc),
|
||||||
condstr(cond_get_agg(svc->cond)));
|
condstr(cond_get_agg(svc->cond)));
|
||||||
|
|
||||||
switch(svc->state) {
|
switch(svc->state) {
|
||||||
|
|||||||
@@ -429,8 +429,10 @@ char *svc_status(svc_t *svc)
|
|||||||
case SVC_BLOCK_INETD_BUSY:
|
case SVC_BLOCK_INETD_BUSY:
|
||||||
return "busy";
|
return "busy";
|
||||||
}
|
}
|
||||||
|
|
||||||
case SVC_DONE_STATE:
|
case SVC_DONE_STATE:
|
||||||
return "done";
|
return "done";
|
||||||
|
|
||||||
case SVC_STOPPING_STATE:
|
case SVC_STOPPING_STATE:
|
||||||
switch (svc->type) {
|
switch (svc->type) {
|
||||||
case SVC_TYPE_INETD_CONN:
|
case SVC_TYPE_INETD_CONN:
|
||||||
@@ -440,10 +442,13 @@ char *svc_status(svc_t *svc)
|
|||||||
default:
|
default:
|
||||||
return "stopping";
|
return "stopping";
|
||||||
}
|
}
|
||||||
|
|
||||||
case SVC_WAITING_STATE:
|
case SVC_WAITING_STATE:
|
||||||
return "waiting";
|
return "waiting";
|
||||||
|
|
||||||
case SVC_READY_STATE:
|
case SVC_READY_STATE:
|
||||||
return "ready";
|
return "ready";
|
||||||
|
|
||||||
case SVC_RUNNING_STATE:
|
case SVC_RUNNING_STATE:
|
||||||
return "running";
|
return "running";
|
||||||
|
|
||||||
@@ -460,8 +465,8 @@ const char *svc_dirtystr(svc_t *svc)
|
|||||||
return "updated";
|
return "updated";
|
||||||
else if (svc_is_changed(svc))
|
else if (svc_is_changed(svc))
|
||||||
return "UNKNOWN";
|
return "UNKNOWN";
|
||||||
else
|
|
||||||
return "clean";
|
return "clean";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Same base service, return unique ID */
|
/* Same base service, return unique ID */
|
||||||
|
|||||||
@@ -169,9 +169,9 @@ int svc_is_unique (svc_t *svc);
|
|||||||
static inline int svc_in_runlevel(svc_t *svc, int runlevel) { return svc && ISSET(svc->runlevels, runlevel); }
|
static inline int svc_in_runlevel(svc_t *svc, int runlevel) { return svc && ISSET(svc->runlevels, runlevel); }
|
||||||
static inline int svc_has_sighup(svc_t *svc) { return svc && 0 != svc->sighup; }
|
static inline int svc_has_sighup(svc_t *svc) { return svc && 0 != svc->sighup; }
|
||||||
|
|
||||||
static inline void svc_starting (svc_t *svc) { svc->starting = 1; }
|
static inline void svc_starting (svc_t *svc) { svc->starting = 1; }
|
||||||
static inline void svc_started (svc_t *svc) { svc->starting = 0; }
|
static inline void svc_started (svc_t *svc) { svc->starting = 0; }
|
||||||
static inline int svc_is_starting(svc_t *svc) { 0 != svc->starting; }
|
static inline int svc_is_starting(svc_t *svc) { return 0 != svc->starting; }
|
||||||
|
|
||||||
static inline int svc_is_dynamic(svc_t *svc) { return svc && 0 != svc->mtime; }
|
static inline int svc_is_dynamic(svc_t *svc) { return svc && 0 != svc->mtime; }
|
||||||
static inline int svc_is_removed(svc_t *svc) { return svc && -1 == svc->dirty; }
|
static inline int svc_is_removed(svc_t *svc) { return svc && -1 == svc->dirty; }
|
||||||
|
|||||||
Reference in new issue
Block a user