mirror of
https://github.com/troglobit/finit.git
synced 2026-11-17 19:30:29 +00:00
Fix: Loss of dynamic service on second reload (unmodified).
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
05a8ace030
commit
838ec0423d
3 files changed
+13
-3
No files matched your search
@@ -659,9 +659,9 @@ int service_register(int type, char *line, time_t mtime, char *username)
|
|||||||
return errno = ENOMEM;
|
return errno = ENOMEM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (svc->mtime != mtime)
|
|
||||||
svc->dirty = 1;
|
/* New, recently modified or unchanged ... used on reload. */
|
||||||
svc->mtime = mtime;
|
svc_check_dirty(svc, mtime);
|
||||||
|
|
||||||
if (desc)
|
if (desc)
|
||||||
strlcpy(svc->desc, desc + 3, sizeof(svc->desc));
|
strlcpy(svc->desc, desc + 3, sizeof(svc->desc));
|
||||||
|
|||||||
@@ -330,6 +330,15 @@ void svc_mark_dynamic(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void svc_check_dirty(svc_t *svc, time_t mtime)
|
||||||
|
{
|
||||||
|
if (svc->mtime != mtime)
|
||||||
|
svc->dirty = 1;
|
||||||
|
else
|
||||||
|
svc->dirty = 0;
|
||||||
|
svc->mtime = mtime;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* svc_clean_dynamic - Stop and cleanup stale services removed from /etc/finit.d
|
* svc_clean_dynamic - Stop and cleanup stale services removed from /etc/finit.d
|
||||||
* @cb: Callback to run for each stale service
|
* @cb: Callback to run for each stale service
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ void svc_foreach (void (*cb)(svc_t *));
|
|||||||
void svc_foreach_dynamic (void (*cb)(svc_t *));
|
void svc_foreach_dynamic (void (*cb)(svc_t *));
|
||||||
|
|
||||||
void svc_mark_dynamic (void);
|
void svc_mark_dynamic (void);
|
||||||
|
void svc_check_dirty (svc_t *svc, time_t mtime);
|
||||||
void svc_clean_dynamic (void (*cb)(svc_t *));
|
void svc_clean_dynamic (void (*cb)(svc_t *));
|
||||||
|
|
||||||
char *svc_status (svc_t *svc);
|
char *svc_status (svc_t *svc);
|
||||||
|
|||||||
Reference in new issue
Block a user