MCPcopy Create free account
hub / github.com/apache/cloudberry / AuxiliaryProcessMain

Function AuxiliaryProcessMain

src/backend/bootstrap/bootstrap.c:202–512  ·  view source on GitHub ↗

* AuxiliaryProcessMain * * The main entry point for auxiliary processes, such as the bgwriter, * walwriter, walreceiver, bootstrapper and the shared memory checker code. * * This code is here just because of historical reasons. */

Source from the content-addressed store, hash-verified

200 * This code is here just because of historical reasons.
201 */
202void
203AuxiliaryProcessMain(int argc, char *argv[])
204{
205 char *progname = argv[0];
206 int flag;
207 char *userDoption = NULL;
208
209 /*
210 * Initialize process environment (already done if under postmaster, but
211 * not if standalone).
212 */
213 if (!IsUnderPostmaster)
214 InitStandaloneProcess(argv[0]);
215
216 /*
217 * process command arguments
218 */
219
220 /* Set defaults, to be overridden by explicit options below */
221 if (!IsUnderPostmaster)
222 InitializeGUCOptions();
223
224 /* Ignore the initial --boot argument, if present */
225 if (argc > 1 && strcmp(argv[1], "--boot") == 0)
226 {
227 argv++;
228 argc--;
229 }
230
231 /* If no -x argument, we are a CheckerProcess */
232 MyAuxProcType = CheckerProcess;
233
234 while ((flag = getopt(argc, argv, "B:c:d:D:FkK:r:x:R:u:X:-:")) != -1)
235 {
236 switch (flag)
237 {
238 case 'B':
239 SetConfigOption("shared_buffers", optarg, PGC_POSTMASTER, PGC_S_ARGV);
240 break;
241 case 'D':
242 userDoption = pstrdup(optarg);
243 break;
244 case 'd':
245 {
246 /* Turn on debugging for the bootstrap process. */
247 char *debugstr;
248
249 debugstr = psprintf("debug%s", optarg);
250 SetConfigOption("log_min_messages", debugstr,
251 PGC_POSTMASTER, PGC_S_ARGV);
252 SetConfigOption("client_min_messages", debugstr,
253 PGC_POSTMASTER, PGC_S_ARGV);
254 pfree(debugstr);
255 }
256 break;
257 case 'F':
258 SetConfigOption("fsync", "false", PGC_POSTMASTER, PGC_S_ARGV);
259 break;

Callers 3

mainFunction · 0.85
SubPostmasterMainFunction · 0.85
StartChildProcessFunction · 0.85

Calls 15

InitStandaloneProcessFunction · 0.85
InitializeGUCOptionsFunction · 0.85
getoptFunction · 0.85
SetConfigOptionFunction · 0.85
psprintfFunction · 0.85
pg_strcasecmpFunction · 0.85
strlcpyFunction · 0.85
ParseLongOptionFunction · 0.85
proc_exitFunction · 0.85
init_ps_displayFunction · 0.85
SelectConfigFilesFunction · 0.85
checkDataDirFunction · 0.85

Tested by

no test coverage detected