|
|
|
@@ -104,7 +104,7 @@ struct action |
104 | enum return_action act; /* Action to take when the component terminates */ |
104 | enum return_action act; /* Action to take when the component terminates */ |
105 | char *addr; /* Addresses to notify about it. */ |
105 | char *addr; /* Addresses to notify about it. */ |
106 | char *message; /* Notification mail. */ |
106 | char *message; /* Notification mail. */ |
107 | char *command; /* Execute this command */ |
107 | char *command; /* Execute this command */ |
108 | }; |
108 | }; |
109 | |
109 | |
110 | |
110 | |
@@ -137,14 +137,21 @@ enum pies_comp_mode |
137 | component via the UNIX domain socket. Corresponds to |
137 | component via the UNIX domain socket. Corresponds to |
138 | `start_action = pass' in MeTA1. */ |
138 | `start_action = pass' in MeTA1. */ |
139 | pies_comp_pass_fd, |
139 | pies_comp_pass_fd, |
140 | |
140 | |
| |
141 | /* Components of this type runs once on program startup. Running other |
| |
142 | components is delayed until the last startup component finishes. */ |
| |
143 | pies_comp_startup, |
| |
144 | |
| |
145 | /* FIXME: Runs before program termination */ |
| |
146 | pies_comp_shutdown, |
| |
147 | |
141 | /* |
148 | /* |
142 | ** Init-style components |
149 | ** Init-style components |
143 | */ |
150 | */ |
144 | pies_mark_sysvinit, |
151 | pies_mark_sysvinit, |
145 | /* Start the process when the specified runlevel is entered and wait |
152 | /* Start the process when the specified runlevel is entered and wait |
146 | for its termination */ |
153 | for its termination */ |
147 | pies_comp_wait = pies_mark_sysvinit, |
154 | pies_comp_wait = pies_mark_sysvinit, |
148 | /* Execute the component once, when the specified runlevel is entered */ |
155 | /* Execute the component once, when the specified runlevel is entered */ |
149 | pies_comp_once, |
156 | pies_comp_once, |
150 | /* Execute the component during system boot. Ignore runlevel settings. */ |
157 | /* Execute the component during system boot. Ignore runlevel settings. */ |
@@ -162,7 +169,7 @@ enum pies_comp_mode |
162 | pies_comp_powerokwait, |
169 | pies_comp_powerokwait, |
163 | /* Execute the process when SIGINT is delivered, i.e. someone has |
170 | /* Execute the process when SIGINT is delivered, i.e. someone has |
164 | pressed the Ctrl+Alt+Del combination. */ |
171 | pressed the Ctrl+Alt+Del combination. */ |
165 | pies_comp_ctrlaltdel, |
172 | pies_comp_ctrlaltdel, |
166 | /* Execute the component when a specified ondemand runlevel is called */ |
173 | /* Execute the component when a specified ondemand runlevel is called */ |
167 | pies_comp_ondemand, |
174 | pies_comp_ondemand, |
168 | /* Execute the component on the system boot. */ |
175 | /* Execute the component on the system boot. */ |
@@ -184,16 +191,16 @@ enum pies_comp_mode |
184 | |
191 | |
185 | #define CF_DISABLED 0x001 /* The componenet is disabled */ |
192 | #define CF_DISABLED 0x001 /* The componenet is disabled */ |
186 | #define CF_PRECIOUS 0x002 /* The component is precious (should not |
193 | #define CF_PRECIOUS 0x002 /* The component is precious (should not |
187 | be disabled) */ |
194 | be disabled) */ |
188 | #define CF_WAIT 0x004 /* Wait for the component instance to |
195 | #define CF_WAIT 0x004 /* Wait for the component instance to |
189 | terminate. */ |
196 | terminate. */ |
190 | #define CF_TCPMUX 0x008 /* A plain TCPMUX service */ |
197 | #define CF_TCPMUX 0x008 /* A plain TCPMUX service */ |
191 | #define CF_TCPMUXPLUS 0x010 /* A TCPMUX-plus service, i.e. pies |
198 | #define CF_TCPMUXPLUS 0x010 /* A TCPMUX-plus service, i.e. pies |
192 | must emit a '+' response before starting |
199 | must emit a '+' response before starting |
193 | it */ |
200 | it */ |
194 | #define CF_INTERNAL 0x020 /* An internal inetd service */ |
201 | #define CF_INTERNAL 0x020 /* An internal inetd service */ |
195 | #define CF_SOCKENV 0x040 /* Component wants socket information in |
202 | #define CF_SOCKENV 0x040 /* Component wants socket information in |
196 | the environment */ |
203 | the environment */ |
197 | #define CF_RESOLVE 0x080 /* Resolve IP addresses */ |
204 | #define CF_RESOLVE 0x080 /* Resolve IP addresses */ |
198 | #define CF_SIGGROUP 0x100 /* Send signals to the process group */ |
205 | #define CF_SIGGROUP 0x100 /* Send signals to the process group */ |
199 | |
206 | |
@@ -210,9 +217,9 @@ struct component |
210 | struct component *prev, *next; /* Components form doubly-linked list. */ |
217 | struct component *prev, *next; /* Components form doubly-linked list. */ |
211 | int listidx; /* Index of the list. */ |
218 | int listidx; /* Index of the list. */ |
212 | size_t arridx; /* Index of this component. */ |
219 | size_t arridx; /* Index of this component. */ |
213 | size_t ref_count; /* Reference count. */ |
220 | size_t ref_count; /* Reference count. */ |
214 | struct prog *prog; /* Prog associated with this component. */ |
221 | struct prog *prog; /* Prog associated with this component. */ |
215 | |
222 | |
216 | enum pies_comp_mode mode; |
223 | enum pies_comp_mode mode; |
217 | char *tag; /* Entry tag (for diagnostics purposes) */ |
224 | char *tag; /* Entry tag (for diagnostics purposes) */ |
218 | char *program; /* Program name */ |
225 | char *program; /* Program name */ |
@@ -232,7 +239,7 @@ struct component |
232 | |
239 | |
233 | /* For exec (init) components */ |
240 | /* For exec (init) components */ |
234 | char *runlevels; |
241 | char *runlevels; |
235 | |
242 | |
236 | /* For inetd components */ |
243 | /* For inetd components */ |
237 | size_t max_rate; /* Maximum number of invocations per minute */ |
244 | size_t max_rate; /* Maximum number of invocations per minute */ |
238 | size_t max_ip_connections; /* Max. number of connections per IP address */ |
245 | size_t max_ip_connections; /* Max. number of connections per IP address */ |
@@ -253,9 +260,9 @@ struct component |
253 | char *access_denied_message; |
260 | char *access_denied_message; |
254 | char *max_instances_message; |
261 | char *max_instances_message; |
255 | char *max_ip_connections_message; |
262 | char *max_ip_connections_message; |
256 | |
263 | |
257 | /* Redirectors: */ |
264 | /* Redirectors: */ |
258 | int facility; /* Syslog facility. */ |
265 | int facility; /* Syslog facility. */ |
259 | struct redirector redir[2]; /* Repeaters for stdout and stderr */ |
266 | struct redirector redir[2]; /* Repeaters for stdout and stderr */ |
260 | /* Actions to execute on various exit codes: */ |
267 | /* Actions to execute on various exit codes: */ |
261 | struct grecs_list *act_list; |
268 | struct grecs_list *act_list; |
@@ -334,6 +341,7 @@ int pies_read_config (void); |
334 | int pies_reread_config (void); |
341 | int pies_reread_config (void); |
335 | |
342 | |
336 | void register_prog (struct component *comp); |
343 | void register_prog (struct component *comp); |
| |
344 | void program_init_startup (void); |
337 | int progman_waiting_p (void); |
345 | int progman_waiting_p (void); |
338 | void progman_start (void); |
346 | void progman_start (void); |
339 | void progman_gc (void); |
347 | void progman_gc (void); |
@@ -594,7 +602,7 @@ struct sysvinit_request |
594 | #define SYSV_ACCT_BOOT 0 |
602 | #define SYSV_ACCT_BOOT 0 |
595 | #define SYSV_ACCT_RUNLEVEL 1 |
603 | #define SYSV_ACCT_RUNLEVEL 1 |
596 | #define SYSV_ACCT_PROC_START 2 |
604 | #define SYSV_ACCT_PROC_START 2 |
597 | #define SYSV_ACCT_PROC_STOP 3 |
605 | #define SYSV_ACCT_PROC_STOP 3 |
598 | |
606 | |
599 | void sysvinit_acct (int what, const char *user, const char *id, pid_t pid, |
607 | void sysvinit_acct (int what, const char *user, const char *id, pid_t pid, |
600 | const char *line); |
608 | const char *line); |
|