diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-01-04 15:33:00 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-01-04 22:11:21 +0200 |
commit | d8221ce9bdd2d7ae6162bed0e1c85e9f7a3ff8f2 (patch) | |
tree | 5fab301e38fede054aa85708c6c8590c1825e541 /src/pies.h | |
parent | 95bc9b24928eb9951f0644307e417df0bc8c53b4 (diff) | |
download | pies-d8221ce9bdd2d7ae6162bed0e1c85e9f7a3ff8f2.tar.gz pies-d8221ce9bdd2d7ae6162bed0e1c85e9f7a3ff8f2.tar.bz2 |
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.
Diffstat (limited to 'src/pies.h')
-rw-r--r-- | src/pies.h | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -183,8 +183,6 @@ enum pies_comp_mode | |||
183 | pies_comp_respawn = pies_comp_exec, | 183 | pies_comp_respawn = pies_comp_exec, |
184 | }; | 184 | }; |
185 | 185 | ||
186 | #define is_sysvinit(m) ((m)>=pies_mark_sysvinit) | ||
187 | |||
188 | #define CF_DISABLED 0x001 /* The componenet is disabled */ | 186 | #define CF_DISABLED 0x001 /* The componenet is disabled */ |
189 | #define CF_PRECIOUS 0x002 /* The component is precious (should not | 187 | #define CF_PRECIOUS 0x002 /* The component is precious (should not |
190 | be disabled) */ | 188 | be disabled) */ |
@@ -253,6 +251,8 @@ struct component | |||
253 | struct action act_temp; /* Auxiliary object used during configuration */ | 251 | struct action act_temp; /* Auxiliary object used during configuration */ |
254 | }; | 252 | }; |
255 | 253 | ||
254 | #define is_sysvinit(cp) ((cp)->mode >= pies_mark_sysvinit || (cp)->runlevels) | ||
255 | |||
256 | union pies_sockaddr_storage | 256 | union pies_sockaddr_storage |
257 | { | 257 | { |
258 | struct sockaddr s; | 258 | struct sockaddr s; |
@@ -301,6 +301,9 @@ void progman_run_comp (struct component *comp, int fd, | |||
301 | 301 | ||
302 | void progman_iterate_comp (int (*fun) (struct component *, void *), | 302 | void progman_iterate_comp (int (*fun) (struct component *, void *), |
303 | void *data); | 303 | void *data); |
304 | void progman_sysvinit_enable (int (*fun) (struct component *, int, void *), | ||
305 | void *data); | ||
306 | |||
304 | void fd_report (int fd, const char *msg); | 307 | void fd_report (int fd, const char *msg); |
305 | 308 | ||
306 | int check_acl (pies_acl_t acl, struct sockaddr *s, socklen_t salen); | 309 | int check_acl (pies_acl_t acl, struct sockaddr *s, socklen_t salen); |
@@ -450,8 +453,8 @@ struct inetd_builtin | |||
450 | struct inetd_builtin *inetd_builtin_lookup (const char *service, int socktype); | 453 | struct inetd_builtin *inetd_builtin_lookup (const char *service, int socktype); |
451 | 454 | ||
452 | /* sysvinit.c */ | 455 | /* sysvinit.c */ |
453 | int runlevel_match (struct component *comp); | 456 | void sysvinit_begin (void); |
454 | void inittrans (void); | 457 | int inittrans (void); |
455 | int is_comp_wait (struct component *comp); | 458 | int is_comp_wait (struct component *comp); |
456 | 459 | ||
457 | 460 | ||