Mon Nov 17 14:35:18 PST 2008
- Previous message: [Slony1-commit] slony1-engine/doc/adminguide slonik_ref.sgml
- Next message: [Slony1-commit] slony1-engine/tests/test1 generate_dml.sh
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Update of /home/cvsd/slony1/slony1-engine/src/slony_logshipper In directory main.slony.info:/tmp/cvs-serv24981 Modified Files: ipcutil.c slony_logshipper.c Log Message: Added patch per Richard Yen to allow log shipper to rescan automatically Index: slony_logshipper.c =================================================================== RCS file: /home/cvsd/slony1/slony1-engine/src/slony_logshipper/slony_logshipper.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** slony_logshipper.c 9 Sep 2007 02:37:05 -0000 1.2 --- slony_logshipper.c 17 Nov 2008 22:35:16 -0000 1.3 *************** *** 48,51 **** --- 48,52 ---- * Global data */ + int rescan_interval = 0; int parse_errors = 0; int opt_quiet = 0; *************** *** 135,139 **** * */ ! while ((opt = getopt(argc, (char **)argv, "hvqcflrtTw")) != EOF) { switch (opt) --- 136,140 ---- * */ ! while ((opt = getopt(argc, (char **)argv, "hvqcflrtTws:")) != EOF) { switch (opt) *************** *** 179,182 **** --- 180,187 ---- opt_nowait = 1; break; + + case 's': + rescan_interval = atoi(optarg); + break; default: *************** *** 312,316 **** default: if (!opt_quiet) ! printf("logshipper deamon created - pid = %d\n", pid); return 0; --- 317,321 ---- default: if (!opt_quiet) ! printf("logshipper daemon created - pid = %d\n", pid); return 0; *************** *** 366,369 **** --- 371,387 ---- break; + if (rc == -2) + { + archscan_sort = NULL; + errlog(LOG_INFO, "Queue is empty. Going to rescan in %d seconds\n", rescan_interval); + sleep(rescan_interval); + if (archscan(optind, argc, (char **)argv) < 0) + { + return -1; + } + errlog(LOG_INFO, "Archive dir scanned\n"); + continue; + } + if (rc < 0) { *************** *** 1173,1176 **** --- 1191,1195 ---- " -f stay in foreground (don't daemonize)\n" " -w enter smart shutdown mode immediately\n" + " -s indicate (integer value) rescan interval\n" "\n"); exit(1); Index: ipcutil.c =================================================================== RCS file: /home/cvsd/slony1/slony1-engine/src/slony_logshipper/ipcutil.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ipcutil.c 27 Sep 2007 18:02:52 -0000 1.3 --- ipcutil.c 17 Nov 2008 22:35:16 -0000 1.4 *************** *** 449,455 **** * Receive one single message blocking for it. */ ! rc = msgrcv(msgid, &msg, sizeof(msg), 0, 0); if (rc < 0) { if (errno == EINTR) continue; --- 449,457 ---- * Receive one single message blocking for it. */ ! rc = msgrcv(msgid, &msg, sizeof(msg), 0, IPC_NOWAIT); if (rc < 0) { + if (errno == ENOMSG) + return -1; if (errno == EINTR) continue;
- Previous message: [Slony1-commit] slony1-engine/doc/adminguide slonik_ref.sgml
- Next message: [Slony1-commit] slony1-engine/tests/test1 generate_dml.sh
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list