* 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. */
| 200 | * This code is here just because of historical reasons. |
| 201 | */ |
| 202 | void |
| 203 | AuxiliaryProcessMain(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; |
no test coverage detected