mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
Fix: Loss of dynamic service on second reload (unmodified).
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -659,9 +659,9 @@ int service_register(int type, char *line, time_t mtime, char *username)
|
||||
return errno = ENOMEM;
|
||||
}
|
||||
}
|
||||
if (svc->mtime != mtime)
|
||||
svc->dirty = 1;
|
||||
svc->mtime = mtime;
|
||||
|
||||
/* New, recently modified or unchanged ... used on reload. */
|
||||
svc_check_dirty(svc, mtime);
|
||||
|
||||
if (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
|
||||
* @cb: Callback to run for each stale service
|
||||
|
||||
Reference in New Issue
Block a user