mirror of
https://github.com/troglobit/finit.git
synced 2026-11-03 13:28:27 +00:00
service_register(): Skip bootstrap services if not in bootstrap
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
8dc263d508
commit
12d8ac2399
1 file changed
+8
-2
+8
-2
@@ -512,7 +512,7 @@ int service_register(int type, char *line, struct timeval *mtime, char *username
|
|||||||
#ifdef INETD_ENABLED
|
#ifdef INETD_ENABLED
|
||||||
int forking = 0;
|
int forking = 0;
|
||||||
#endif
|
#endif
|
||||||
int log = 0;
|
int log = 0, levels = 0;
|
||||||
char *service = NULL, *proto = NULL, *ifaces = NULL;
|
char *service = NULL, *proto = NULL, *ifaces = NULL;
|
||||||
char *cmd, *desc, *runlevels = NULL, *cond = NULL;
|
char *cmd, *desc, *runlevels = NULL, *cond = NULL;
|
||||||
svc_t *svc;
|
svc_t *svc;
|
||||||
@@ -567,6 +567,12 @@ int service_register(int type, char *line, struct timeval *mtime, char *username
|
|||||||
goto incomplete;
|
goto incomplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
levels = conf_parse_runlevels(runlevels);
|
||||||
|
if (runlevel > 0 && !ISOTHER(levels, 0)) {
|
||||||
|
_e("Skipping %s, bootstrap is completed.", cmd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Example: inetd ssh/tcp@eth0,eth1 or 222/tcp@eth2 */
|
/* Example: inetd ssh/tcp@eth0,eth1 or 222/tcp@eth2 */
|
||||||
if (service) {
|
if (service) {
|
||||||
ifaces = strchr(service, '@');
|
ifaces = strchr(service, '@');
|
||||||
@@ -654,7 +660,7 @@ recreate:
|
|||||||
svc->args[i][0] = 0;
|
svc->args[i][0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
svc->runlevels = conf_parse_runlevels(runlevels);
|
svc->runlevels = levels;
|
||||||
_d("Service %s runlevel 0x%2x", svc->cmd, svc->runlevels);
|
_d("Service %s runlevel 0x%2x", svc->cmd, svc->runlevels);
|
||||||
|
|
||||||
conf_parse_cond(svc, cond);
|
conf_parse_cond(svc, cond);
|
||||||
|
|||||||
Reference in new issue
Block a user