From d8221ce9bdd2d7ae6162bed0e1c85e9f7a3ff8f2 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Fri, 4 Jan 2013 15:33:00 +0200 Subject: Fix sysvinit transition logic. * src/pies.c (main): Call sysvinit_begin to initialize sysvinit subsystem. In the main loop, force wakeup if inittrans returns 1. * src/pies.h (is_sysvinit): Rewrite macro. (progman_sysvinit_enable): New proto. (inittrans): Change return type. * src/progman.c (progman_sysvinit_enable): New function. (progman_running_p): Additional debugging. (prog_start): Special handling for sysvinit components. Remove calls to runlevel_match * src/sysvinit.c (runlevel_match): Remove function. (sysvinit_begin): New function. (inittrans): Return boolean value indicating whether a transition has been made. Call progman_sysvinit_enable to change the status of sysvinit components as appropriate. --- src/pies.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/pies.h') diff --git a/src/pies.h b/src/pies.h index a679afd..fc4f59c 100644 --- a/src/pies.h +++ b/src/pies.h @@ -183,8 +183,6 @@ enum pies_comp_mode pies_comp_respawn = pies_comp_exec, }; -#define is_sysvinit(m) ((m)>=pies_mark_sysvinit) - #define CF_DISABLED 0x001 /* The componenet is disabled */ #define CF_PRECIOUS 0x002 /* The component is precious (should not be disabled) */ @@ -253,6 +251,8 @@ struct component struct action act_temp; /* Auxiliary object used during configuration */ }; +#define is_sysvinit(cp) ((cp)->mode >= pies_mark_sysvinit || (cp)->runlevels) + union pies_sockaddr_storage { struct sockaddr s; @@ -301,6 +301,9 @@ void progman_run_comp (struct component *comp, int fd, void progman_iterate_comp (int (*fun) (struct component *, void *), void *data); +void progman_sysvinit_enable (int (*fun) (struct component *, int, void *), + void *data); + void fd_report (int fd, const char *msg); int check_acl (pies_acl_t acl, struct sockaddr *s, socklen_t salen); @@ -450,8 +453,8 @@ struct inetd_builtin struct inetd_builtin *inetd_builtin_lookup (const char *service, int socktype); /* sysvinit.c */ -int runlevel_match (struct component *comp); -void inittrans (void); +void sysvinit_begin (void); +int inittrans (void); int is_comp_wait (struct component *comp); -- cgit v1.2.1