diff options
Diffstat (limited to 'src/pies.h')
-rw-r--r-- | src/pies.h | 53 |
1 files changed, 52 insertions, 1 deletions
@@ -119,12 +119,15 @@ struct pies_privs int allgroups; struct grecs_list *groups; }; enum pies_comp_mode { + /* + ** Pies native component types. + */ /* Execute the component, no sockets are opened. This is the default Pies mode. */ pies_comp_exec, /* Open a socket and start a component with stdin/stdout bound to that socket. Corresponds to MeTA1 notion of `start_action = accept'. */ @@ -134,13 +137,53 @@ enum pies_comp_mode `start_action = nostartaccept' in MeTA1. */ pies_comp_inetd, /* Open a socket, start a component, and pass the socket fd to the component via the UNIX domain socket. Corresponds to `start_action = pass' in MeTA1. */ - pies_comp_pass_fd + pies_comp_pass_fd, + + /* + ** Init-style components + */ + + /* Start the process when the specified runlevel is entered and wait + for its termination */ + pies_comp_wait, + /* Execute the component once, when the specified runlevel is entered */ + pies_comp_once, + /* Execute the component during system boot. Ignore runlevel settings. */ + pies_comp_boot, + /* Execute the component during system boot and wait for it to terminate. + Ignore runlevel settings. */ + pies_comp_bootwait, + /* Execute the component when the power goes down. */ + pies_comp_powerfail, + /* Execute the component when the power goes down. Wait for it to + terminate. */ + pies_comp_powerwait, + /* Execute the component when the power is restored. Wait for it to + terminate. */ + pies_comp_powerokwait, + /* Execute the process when SIGINT is delivered, i.e. someone has + pressed the Ctrl+Alt+Del combination. */ + pies_comp_ctrlaltdel, + /* Execute the component when a specified ondemand runlevel is called */ + pies_comp_ondemand, + /* Execute the component on the system boot. */ + pies_comp_sysinit, + /* Execute the component when running on the UPS and pies is informed that + the UPS battery is almost empty. */ + pies_comp_powerfailnow, + /* Execute the component a signal from the keyboard handler arrives, + indicating that a special key combination was pressed on the console + keyboard. */ + pies_comp_kbrequest, + + /* Restart the component wherever it terminates */ + pies_comp_respawn = pies_comp_exec, }; #define CF_DISABLED 0x001 /* The componenet is disabled */ #define CF_PRECIOUS 0x002 /* The component is precious (should not be disabled) */ #define CF_WAIT 0x004 /* Wait for the component instance to @@ -173,12 +216,15 @@ struct component instances */ char *rmfile; /* Try to remove this file before starting */ struct pies_privs privs; /* UID/GIDS+groups to run under */ mode_t umask; /* Umask to install before starting */ limits_record_t limits; /* System limits */ + /* For exec (init) components */ + char *runlevels; + /* For inetd components */ size_t max_rate; /* Maximum number of invocations per minute */ size_t max_ip_connections; /* Max. number of connections per IP address */ int socket_type; /* Socket type */ struct inetd_builtin *builtin; /* Builtin function */ char *service; @@ -222,13 +268,18 @@ extern char *mailer_program; extern char *mailer_command_line; extern int mailer_argc; extern char **mailer_argv; extern size_t default_max_rate; extern char *qotdfile; +extern int init_process; +extern char *console_device; +extern int initdefault; + void register_prog (struct component *comp); +int progman_running_p (void); size_t progman_running_count (void); void progman_start (void); void progman_wake_sleeping (int); void progman_stop (void); void progman_cleanup (int expect_term); void progman_stop_component (const char *name); |