aboutsummaryrefslogtreecommitdiff
path: root/src/pies.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-01-04 14:22:24 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2013-01-04 14:22:24 +0200
commita9c18ad30ba6072ca460b2abc482374fb3c207b2 (patch)
treebd969853eaebe30e04fd8658d9ba323f6f6ff2ab /src/pies.h
parentcf14c349fad774e477a80d1c5e6572f21f17ced1 (diff)
downloadpies-a9c18ad30ba6072ca460b2abc482374fb3c207b2.tar.gz
pies-a9c18ad30ba6072ca460b2abc482374fb3c207b2.tar.bz2
Implement runlevel transitions.
* src/sysvinit.c: New file. * src/Makefile.am: Add new file. * src/pies.c (initdefault, dfl_level): Move to sysvinit.c (modetab): Add new modes. (inittrans): Move to sysvinit.c * src/pies.h (is_sysvinit): New macro. (dfl_level): New extern. (runlevel_match, inittrans, is_comp_wait): New protos. * src/progman.c (progman_running_p): Take into account only components. Use is_comp_wait to determine if the component should be waited for. (prog_start): Run sysvinit components only when started as init process. (runlevel_match): Move to sysvinit.c (prog_start_prerequisites): Return immediately if the component is disabled.
Diffstat (limited to 'src/pies.h')
-rw-r--r--src/pies.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/pies.h b/src/pies.h
index 9b3ae9d..a679afd 100644
--- a/src/pies.h
+++ b/src/pies.h
@@ -145,10 +145,10 @@ enum pies_comp_mode
145 /* 145 /*
146 ** Init-style components 146 ** Init-style components
147 */ 147 */
148 148 pies_mark_sysvinit,
149 /* Start the process when the specified runlevel is entered and wait 149 /* Start the process when the specified runlevel is entered and wait
150 for its termination */ 150 for its termination */
151 pies_comp_wait, 151 pies_comp_wait = pies_mark_sysvinit,
152 /* Execute the component once, when the specified runlevel is entered */ 152 /* Execute the component once, when the specified runlevel is entered */
153 pies_comp_once, 153 pies_comp_once,
154 /* Execute the component during system boot. Ignore runlevel settings. */ 154 /* Execute the component during system boot. Ignore runlevel settings. */
@@ -183,6 +183,8 @@ 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
186#define CF_DISABLED 0x001 /* The componenet is disabled */ 188#define CF_DISABLED 0x001 /* The componenet is disabled */
187#define CF_PRECIOUS 0x002 /* The component is precious (should not 189#define CF_PRECIOUS 0x002 /* The component is precious (should not
188 be disabled) */ 190 be disabled) */
@@ -274,6 +276,7 @@ extern char *qotdfile;
274extern int init_process; 276extern int init_process;
275extern char *console_device; 277extern char *console_device;
276extern int initdefault; 278extern int initdefault;
279extern int dfl_level;
277 280
278void register_prog (struct component *comp); 281void register_prog (struct component *comp);
279int progman_running_p (void); 282int progman_running_p (void);
@@ -445,5 +448,11 @@ struct inetd_builtin
445}; 448};
446 449
447struct inetd_builtin *inetd_builtin_lookup (const char *service, int socktype); 450struct inetd_builtin *inetd_builtin_lookup (const char *service, int socktype);
451
452/* sysvinit.c */
453int runlevel_match (struct component *comp);
454void inittrans (void);
455int is_comp_wait (struct component *comp);
456
448 457
449 458

Return to:

Send suggestions and report system problems to the System administrator.