diff options
Diffstat (limited to 'src/pies.h')
-rw-r--r-- | src/pies.h | 53 |
1 files changed, 52 insertions, 1 deletions
@@ -122,6 +122,9 @@ struct pies_privs | |||
122 | 122 | ||
123 | enum pies_comp_mode | 123 | enum pies_comp_mode |
124 | { | 124 | { |
125 | /* | ||
126 | ** Pies native component types. | ||
127 | */ | ||
125 | /* Execute the component, no sockets are opened. This is the default | 128 | /* Execute the component, no sockets are opened. This is the default |
126 | Pies mode. */ | 129 | Pies mode. */ |
127 | pies_comp_exec, | 130 | pies_comp_exec, |
@@ -137,7 +140,47 @@ enum pies_comp_mode | |||
137 | /* Open a socket, start a component, and pass the socket fd to the | 140 | /* Open a socket, start a component, and pass the socket fd to the |
138 | component via the UNIX domain socket. Corresponds to | 141 | component via the UNIX domain socket. Corresponds to |
139 | `start_action = pass' in MeTA1. */ | 142 | `start_action = pass' in MeTA1. */ |
140 | pies_comp_pass_fd | 143 | pies_comp_pass_fd, |
144 | |||
145 | /* | ||
146 | ** Init-style components | ||
147 | */ | ||
148 | |||
149 | /* Start the process when the specified runlevel is entered and wait | ||
150 | for its termination */ | ||
151 | pies_comp_wait, | ||
152 | /* Execute the component once, when the specified runlevel is entered */ | ||
153 | pies_comp_once, | ||
154 | /* Execute the component during system boot. Ignore runlevel settings. */ | ||
155 | pies_comp_boot, | ||
156 | /* Execute the component during system boot and wait for it to terminate. | ||
157 | Ignore runlevel settings. */ | ||
158 | pies_comp_bootwait, | ||
159 | /* Execute the component when the power goes down. */ | ||
160 | pies_comp_powerfail, | ||
161 | /* Execute the component when the power goes down. Wait for it to | ||
162 | terminate. */ | ||
163 | pies_comp_powerwait, | ||
164 | /* Execute the component when the power is restored. Wait for it to | ||
165 | terminate. */ | ||
166 | pies_comp_powerokwait, | ||
167 | /* Execute the process when SIGINT is delivered, i.e. someone has | ||
168 | pressed the Ctrl+Alt+Del combination. */ | ||
169 | pies_comp_ctrlaltdel, | ||
170 | /* Execute the component when a specified ondemand runlevel is called */ | ||
171 | pies_comp_ondemand, | ||
172 | /* Execute the component on the system boot. */ | ||
173 | pies_comp_sysinit, | ||
174 | /* Execute the component when running on the UPS and pies is informed that | ||
175 | the UPS battery is almost empty. */ | ||
176 | pies_comp_powerfailnow, | ||
177 | /* Execute the component a signal from the keyboard handler arrives, | ||
178 | indicating that a special key combination was pressed on the console | ||
179 | keyboard. */ | ||
180 | pies_comp_kbrequest, | ||
181 | |||
182 | /* Restart the component wherever it terminates */ | ||
183 | pies_comp_respawn = pies_comp_exec, | ||
141 | }; | 184 | }; |
142 | 185 | ||
143 | #define CF_DISABLED 0x001 /* The componenet is disabled */ | 186 | #define CF_DISABLED 0x001 /* The componenet is disabled */ |
@@ -176,6 +219,9 @@ struct component | |||
176 | mode_t umask; /* Umask to install before starting */ | 219 | mode_t umask; /* Umask to install before starting */ |
177 | limits_record_t limits; /* System limits */ | 220 | limits_record_t limits; /* System limits */ |
178 | 221 | ||
222 | /* For exec (init) components */ | ||
223 | char *runlevels; | ||
224 | |||
179 | /* For inetd components */ | 225 | /* For inetd components */ |
180 | size_t max_rate; /* Maximum number of invocations per minute */ | 226 | size_t max_rate; /* Maximum number of invocations per minute */ |
181 | size_t max_ip_connections; /* Max. number of connections per IP address */ | 227 | size_t max_ip_connections; /* Max. number of connections per IP address */ |
@@ -225,7 +271,12 @@ extern char **mailer_argv; | |||
225 | extern size_t default_max_rate; | 271 | extern size_t default_max_rate; |
226 | extern char *qotdfile; | 272 | extern char *qotdfile; |
227 | 273 | ||
274 | extern int init_process; | ||
275 | extern char *console_device; | ||
276 | extern int initdefault; | ||
277 | |||
228 | void register_prog (struct component *comp); | 278 | void register_prog (struct component *comp); |
279 | int progman_running_p (void); | ||
229 | size_t progman_running_count (void); | 280 | size_t progman_running_count (void); |
230 | void progman_start (void); | 281 | void progman_start (void); |
231 | void progman_wake_sleeping (int); | 282 | void progman_wake_sleeping (int); |