aboutsummaryrefslogtreecommitdiff
path: root/src/pies.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pies.h')
-rw-r--r--src/pies.h57
1 files changed, 46 insertions, 11 deletions
diff --git a/src/pies.h b/src/pies.h
index e0d24d2..ad8e8ee 100644
--- a/src/pies.h
+++ b/src/pies.h
@@ -98,7 +98,6 @@ enum return_action
98 98
99struct action 99struct action
100{ 100{
101 struct action *next;
102 size_t nstat; 101 size_t nstat;
103 unsigned *status; 102 unsigned *status;
104 enum return_action act; /* Action to take when the component terminates */ 103 enum return_action act; /* Action to take when the component terminates */
@@ -202,8 +201,16 @@ enum pies_comp_mode
202 201
203#define ISCF_TCPMUX(f) ((f) & (CF_TCPMUX | CF_TCPMUXPLUS)) 202#define ISCF_TCPMUX(f) ((f) & (CF_TCPMUX | CF_TCPMUXPLUS))
204 203
204struct prog;
205
205struct component 206struct component
206{ 207{
208 struct component *prev, *next; /* Components form doubly-linked list. */
209 int listidx; /* Index of the list. */
210 size_t arridx; /* Index of this component. */
211 size_t ref_count; /* Reference count. */
212 struct prog *prog; /* Prog associated with this component. */
213
207 enum pies_comp_mode mode; 214 enum pies_comp_mode mode;
208 char *tag; /* Entry tag (for diagnostics purposes) */ 215 char *tag; /* Entry tag (for diagnostics purposes) */
209 char *program; /* Program name */ 216 char *program; /* Program name */
@@ -217,7 +224,7 @@ struct component
217 size_t max_instances; /* Maximum number of simultaneously running 224 size_t max_instances; /* Maximum number of simultaneously running
218 instances */ 225 instances */
219 char *rmfile; /* Try to remove this file before starting */ 226 char *rmfile; /* Try to remove this file before starting */
220 struct pies_privs privs; /* UID/GIDS+groups to run under */ 227 struct pies_privs privs; /* UID/GIDS+groups to run as */
221 mode_t umask; /* Umask to install before starting */ 228 mode_t umask; /* Umask to install before starting */
222 limits_record_t limits; /* System limits */ 229 limits_record_t limits; /* System limits */
223 230
@@ -249,8 +256,7 @@ struct component
249 int facility; /* Syslog facility. */ 256 int facility; /* Syslog facility. */
250 struct redirector redir[2]; /* Repeaters for stdout and stderr */ 257 struct redirector redir[2]; /* Repeaters for stdout and stderr */
251 /* Actions to execute on various exit codes: */ 258 /* Actions to execute on various exit codes: */
252 struct action *act_head, *act_tail; 259 struct grecs_list *act_list;
253 struct action act_temp; /* Auxiliary object used during configuration */
254 /* ACLs for control interface */ 260 /* ACLs for control interface */
255 pies_acl_t list_acl; /* List access control list */ 261 pies_acl_t list_acl; /* List access control list */
256 pies_acl_t adm_acl; /* Administrative ACL (stop, start, etc.) */ 262 pies_acl_t adm_acl; /* Administrative ACL (stop, start, etc.) */
@@ -262,6 +268,7 @@ enum pies_action {
262 ACTION_CONT, 268 ACTION_CONT,
263 ACTION_STOP, 269 ACTION_STOP,
264 ACTION_RESTART, 270 ACTION_RESTART,
271 ACTION_RELOAD,
265 ACTION_CTRLALTDEL, 272 ACTION_CTRLALTDEL,
266 ACTION_KBREQUEST 273 ACTION_KBREQUEST
267}; 274};
@@ -289,7 +296,7 @@ extern size_t pies_master_argc;
289extern char **pies_master_argv; 296extern char **pies_master_argv;
290extern char *default_control_url[2]; 297extern char *default_control_url[2];
291 298
292enum config_syntax 299enum config_syntax_type
293 { 300 {
294 CONF_PIES, 301 CONF_PIES,
295 CONF_META1, 302 CONF_META1,
@@ -297,12 +304,16 @@ enum config_syntax
297 CONF_INITTAB 304 CONF_INITTAB
298 }; 305 };
299 306
300int str_to_config_syntax (const char *str, enum config_syntax *psynt); 307struct config_syntax;
301void add_config (enum config_syntax syntax, const char *name); 308
309struct config_syntax *str_to_config_syntax (const char *str);
310void config_file_add (struct config_syntax *syntax, const char *name);
311void config_file_add_type (enum config_syntax_type syntax, const char *name);
302 312
303void free_redirector (struct redirector *rp); 313void free_redirector (struct redirector *rp);
304 314
305void pies_schedule_action (int act); 315void pies_schedule_action (int act);
316void free_action (struct action *act);
306 317
307void register_prog (struct component *comp); 318void register_prog (struct component *comp);
308int progman_running_p (void); 319int progman_running_p (void);
@@ -313,11 +324,10 @@ void progman_stop (void);
313void progman_cleanup (int expect_term); 324void progman_cleanup (int expect_term);
314void progman_filter (int (*filter) (struct component *, void *data), 325void progman_filter (int (*filter) (struct component *, void *data),
315 void *data); 326 void *data);
327int progman_wait_until (int (*cond) (void *), void *data);
316void progman_stop_tag (const char *name); 328void progman_stop_tag (const char *name);
317void progman_dump_prereq (void);
318void progman_dump_depmap (void);
319int progman_accept (int socket, void *data); 329int progman_accept (int socket, void *data);
320int progman_build_depmap (void); 330
321void progman_create_sockets (void); 331void progman_create_sockets (void);
322struct component *progman_lookup_component (const char *tag); 332struct component *progman_lookup_component (const char *tag);
323struct component *progman_lookup_tcpmux (const char *service, 333struct component *progman_lookup_tcpmux (const char *service,
@@ -351,6 +361,11 @@ pies_depmap_t depmap_alloc (size_t count);
351pies_depmap_t depmap_copy (pies_depmap_t dpm); 361pies_depmap_t depmap_copy (pies_depmap_t dpm);
352void depmap_set (pies_depmap_t dmap, size_t row, size_t col); 362void depmap_set (pies_depmap_t dmap, size_t row, size_t col);
353int depmap_isset (pies_depmap_t dmap, size_t row, size_t col); 363int depmap_isset (pies_depmap_t dmap, size_t row, size_t col);
364void depmap_clear (pies_depmap_t dmap, size_t row, size_t col);
365
366void depmap_clear_all (pies_depmap_t dmap, enum pies_depmap_direction dir,
367 size_t coord);
368
354void depmap_tc (pies_depmap_t dmap); 369void depmap_tc (pies_depmap_t dmap);
355size_t depmap_first (pies_depmap_t dmap, enum pies_depmap_direction dir, 370size_t depmap_first (pies_depmap_t dmap, enum pies_depmap_direction dir,
356 size_t coord, pies_depmap_pos_t *ppos); 371 size_t coord, pies_depmap_pos_t *ppos);
@@ -365,10 +380,25 @@ int socket_type_to_str (int socket_type, const char **pres);
365 380
366struct component *component_create (const char *name); 381struct component *component_create (const char *name);
367void component_free (struct component *comp); 382void component_free (struct component *comp);
383void component_ref_incr (struct component *comp);
384void component_ref_decr (struct component *comp);
385
386void component_config_begin (void);
387void component_config_rollback (void);
388void component_config_commit (void);
389
390int component_is_active (struct component *comp);
368 391
369void component_finish (struct component *comp, grecs_locus_t *locus); 392void component_finish (struct component *comp, grecs_locus_t *locus);
370struct grecs_keyword *find_component_keyword (const char *ident); 393struct grecs_keyword *find_component_keyword (const char *ident);
371 394
395void components_dump_depmap (void);
396void components_trace (char **argv, enum pies_depmap_direction dir);
397
398struct component *component_depmap_first (enum pies_depmap_direction dir,
399 size_t idx, pies_depmap_pos_t *ppos);
400struct component *component_depmap_next (pies_depmap_pos_t pos);
401
372 402
373 403
374void pies_pause (void); 404void pies_pause (void);
@@ -401,6 +431,7 @@ void enable_socket (int fd);
401int parse_limits (limits_record_t *plrec, char *str, char **endp); 431int parse_limits (limits_record_t *plrec, char *str, char **endp);
402int set_limits (const char *name, limits_record_t lrec); 432int set_limits (const char *name, limits_record_t lrec);
403void free_limits (limits_record_t rec); 433void free_limits (limits_record_t rec);
434int limits_cmp (limits_record_t a, limits_record_t b);
404 435
405 436
406void meta1_parser_set_debug (void); 437void meta1_parser_set_debug (void);
@@ -451,9 +482,13 @@ int switch_to_privs (uid_t uid, gid_t gid, struct grecs_list *retain_groups);
451 482
452void pies_priv_setup (struct pies_privs *); 483void pies_priv_setup (struct pies_privs *);
453void pies_epriv_setup (struct pies_privs *); 484void pies_epriv_setup (struct pies_privs *);
485
486int pies_privs_cmp (struct pies_privs const *a, struct pies_privs const *b);
487void pies_privs_free (struct pies_privs *p);
488
454 489
455/* inetd.c */ 490/* inetd.c */
456int inetd_parse_conf (const char *file); 491int inetd_config_parse (const char *file);
457 492
458/* inetd-bi.c */ 493/* inetd-bi.c */
459struct inetd_builtin 494struct inetd_builtin

Return to:

Send suggestions and report system problems to the System administrator.