]> granicus.if.org Git - postgresql/blob - src/backend/postmaster/pgarch.c
Run pgindent on 9.2 source tree in preparation for first 9.3
[postgresql] / src / backend / postmaster / pgarch.c
1 /*-------------------------------------------------------------------------
2  *
3  * pgarch.c
4  *
5  *      PostgreSQL WAL archiver
6  *
7  *      All functions relating to archiver are included here
8  *
9  *      - All functions executed by archiver process
10  *
11  *      - archiver is forked from postmaster, and the two
12  *      processes then communicate using signals. All functions
13  *      executed by postmaster are included in this file.
14  *
15  *      Initial author: Simon Riggs             simon@2ndquadrant.com
16  *
17  * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
18  * Portions Copyright (c) 1994, Regents of the University of California
19  *
20  *
21  * IDENTIFICATION
22  *        src/backend/postmaster/pgarch.c
23  *
24  *-------------------------------------------------------------------------
25  */
26 #include "postgres.h"
27
28 #include <fcntl.h>
29 #include <signal.h>
30 #include <time.h>
31 #include <sys/time.h>
32 #include <sys/wait.h>
33 #include <unistd.h>
34
35 #include "access/xlog_internal.h"
36 #include "libpq/pqsignal.h"
37 #include "miscadmin.h"
38 #include "postmaster/fork_process.h"
39 #include "postmaster/pgarch.h"
40 #include "postmaster/postmaster.h"
41 #include "storage/fd.h"
42 #include "storage/ipc.h"
43 #include "storage/latch.h"
44 #include "storage/pg_shmem.h"
45 #include "storage/pmsignal.h"
46 #include "utils/guc.h"
47 #include "utils/ps_status.h"
48
49
50 /* ----------
51  * Timer definitions.
52  * ----------
53  */
54 #define PGARCH_AUTOWAKE_INTERVAL 60             /* How often to force a poll of the
55                                                                                  * archive status directory; in
56                                                                                  * seconds. */
57 #define PGARCH_RESTART_INTERVAL 10              /* How often to attempt to restart a
58                                                                                  * failed archiver; in seconds. */
59
60 /* ----------
61  * Archiver control info.
62  *
63  * We expect that archivable files within pg_xlog will have names between
64  * MIN_XFN_CHARS and MAX_XFN_CHARS in length, consisting only of characters
65  * appearing in VALID_XFN_CHARS.  The status files in archive_status have
66  * corresponding names with ".ready" or ".done" appended.
67  * ----------
68  */
69 #define MIN_XFN_CHARS   16
70 #define MAX_XFN_CHARS   40
71 #define VALID_XFN_CHARS "0123456789ABCDEF.history.backup"
72
73 #define NUM_ARCHIVE_RETRIES 3
74
75
76 /* ----------
77  * Local data
78  * ----------
79  */
80 static time_t last_pgarch_start_time;
81 static time_t last_sigterm_time = 0;
82
83 /*
84  * Flags set by interrupt handlers for later service in the main loop.
85  */
86 static volatile sig_atomic_t got_SIGHUP = false;
87 static volatile sig_atomic_t got_SIGTERM = false;
88 static volatile sig_atomic_t wakened = false;
89 static volatile sig_atomic_t ready_to_stop = false;
90
91 /*
92  * Latch used by signal handlers to wake up the sleep in the main loop.
93  */
94 static Latch mainloop_latch;
95
96 /* ----------
97  * Local function forward declarations
98  * ----------
99  */
100 #ifdef EXEC_BACKEND
101 static pid_t pgarch_forkexec(void);
102 #endif
103
104 NON_EXEC_STATIC void PgArchiverMain(int argc, char *argv[]);
105 static void pgarch_exit(SIGNAL_ARGS);
106 static void ArchSigHupHandler(SIGNAL_ARGS);
107 static void ArchSigTermHandler(SIGNAL_ARGS);
108 static void pgarch_waken(SIGNAL_ARGS);
109 static void pgarch_waken_stop(SIGNAL_ARGS);
110 static void pgarch_MainLoop(void);
111 static void pgarch_ArchiverCopyLoop(void);
112 static bool pgarch_archiveXlog(char *xlog);
113 static bool pgarch_readyXlog(char *xlog);
114 static void pgarch_archiveDone(char *xlog);
115
116
117 /* ------------------------------------------------------------
118  * Public functions called from postmaster follow
119  * ------------------------------------------------------------
120  */
121
122 /*
123  * pgarch_start
124  *
125  *      Called from postmaster at startup or after an existing archiver
126  *      died.  Attempt to fire up a fresh archiver process.
127  *
128  *      Returns PID of child process, or 0 if fail.
129  *
130  *      Note: if fail, we will be called again from the postmaster main loop.
131  */
132 int
133 pgarch_start(void)
134 {
135         time_t          curtime;
136         pid_t           pgArchPid;
137
138         /*
139          * Do nothing if no archiver needed
140          */
141         if (!XLogArchivingActive())
142                 return 0;
143
144         /*
145          * Do nothing if too soon since last archiver start.  This is a safety
146          * valve to protect against continuous respawn attempts if the archiver is
147          * dying immediately at launch. Note that since we will be re-called from
148          * the postmaster main loop, we will get another chance later.
149          */
150         curtime = time(NULL);
151         if ((unsigned int) (curtime - last_pgarch_start_time) <
152                 (unsigned int) PGARCH_RESTART_INTERVAL)
153                 return 0;
154         last_pgarch_start_time = curtime;
155
156 #ifdef EXEC_BACKEND
157         switch ((pgArchPid = pgarch_forkexec()))
158 #else
159         switch ((pgArchPid = fork_process()))
160 #endif
161         {
162                 case -1:
163                         ereport(LOG,
164                                         (errmsg("could not fork archiver: %m")));
165                         return 0;
166
167 #ifndef EXEC_BACKEND
168                 case 0:
169                         /* in postmaster child ... */
170                         /* Close the postmaster's sockets */
171                         ClosePostmasterPorts(false);
172
173                         /* Lose the postmaster's on-exit routines */
174                         on_exit_reset();
175
176                         /* Drop our connection to postmaster's shared memory, as well */
177                         PGSharedMemoryDetach();
178
179                         PgArchiverMain(0, NULL);
180                         break;
181 #endif
182
183                 default:
184                         return (int) pgArchPid;
185         }
186
187         /* shouldn't get here */
188         return 0;
189 }
190
191 /* ------------------------------------------------------------
192  * Local functions called by archiver follow
193  * ------------------------------------------------------------
194  */
195
196
197 #ifdef EXEC_BACKEND
198
199 /*
200  * pgarch_forkexec() -
201  *
202  * Format up the arglist for, then fork and exec, archive process
203  */
204 static pid_t
205 pgarch_forkexec(void)
206 {
207         char       *av[10];
208         int                     ac = 0;
209
210         av[ac++] = "postgres";
211
212         av[ac++] = "--forkarch";
213
214         av[ac++] = NULL;                        /* filled in by postmaster_forkexec */
215
216         av[ac] = NULL;
217         Assert(ac < lengthof(av));
218
219         return postmaster_forkexec(ac, av);
220 }
221 #endif   /* EXEC_BACKEND */
222
223
224 /*
225  * PgArchiverMain
226  *
227  *      The argc/argv parameters are valid only in EXEC_BACKEND case.  However,
228  *      since we don't use 'em, it hardly matters...
229  */
230 NON_EXEC_STATIC void
231 PgArchiverMain(int argc, char *argv[])
232 {
233         IsUnderPostmaster = true;       /* we are a postmaster subprocess now */
234
235         MyProcPid = getpid();           /* reset MyProcPid */
236
237         InitLatch(&mainloop_latch); /* initialize latch used in main loop */
238
239         MyStartTime = time(NULL);       /* record Start Time for logging */
240
241         /*
242          * If possible, make this process a group leader, so that the postmaster
243          * can signal any child processes too.
244          */
245 #ifdef HAVE_SETSID
246         if (setsid() < 0)
247                 elog(FATAL, "setsid() failed: %m");
248 #endif
249
250         /*
251          * Ignore all signals usually bound to some action in the postmaster,
252          * except for SIGHUP, SIGTERM, SIGUSR1, SIGUSR2, and SIGQUIT.
253          */
254         pqsignal(SIGHUP, ArchSigHupHandler);
255         pqsignal(SIGINT, SIG_IGN);
256         pqsignal(SIGTERM, ArchSigTermHandler);
257         pqsignal(SIGQUIT, pgarch_exit);
258         pqsignal(SIGALRM, SIG_IGN);
259         pqsignal(SIGPIPE, SIG_IGN);
260         pqsignal(SIGUSR1, pgarch_waken);
261         pqsignal(SIGUSR2, pgarch_waken_stop);
262         pqsignal(SIGCHLD, SIG_DFL);
263         pqsignal(SIGTTIN, SIG_DFL);
264         pqsignal(SIGTTOU, SIG_DFL);
265         pqsignal(SIGCONT, SIG_DFL);
266         pqsignal(SIGWINCH, SIG_DFL);
267         PG_SETMASK(&UnBlockSig);
268
269         /*
270          * Identify myself via ps
271          */
272         init_ps_display("archiver process", "", "", "");
273
274         pgarch_MainLoop();
275
276         exit(0);
277 }
278
279 /* SIGQUIT signal handler for archiver process */
280 static void
281 pgarch_exit(SIGNAL_ARGS)
282 {
283         /* SIGQUIT means curl up and die ... */
284         exit(1);
285 }
286
287 /* SIGHUP signal handler for archiver process */
288 static void
289 ArchSigHupHandler(SIGNAL_ARGS)
290 {
291         int                     save_errno = errno;
292
293         /* set flag to re-read config file at next convenient time */
294         got_SIGHUP = true;
295         SetLatch(&mainloop_latch);
296
297         errno = save_errno;
298 }
299
300 /* SIGTERM signal handler for archiver process */
301 static void
302 ArchSigTermHandler(SIGNAL_ARGS)
303 {
304         int                     save_errno = errno;
305
306         /*
307          * The postmaster never sends us SIGTERM, so we assume that this means
308          * that init is trying to shut down the whole system.  If we hang around
309          * too long we'll get SIGKILL'd.  Set flag to prevent starting any more
310          * archive commands.
311          */
312         got_SIGTERM = true;
313         SetLatch(&mainloop_latch);
314
315         errno = save_errno;
316 }
317
318 /* SIGUSR1 signal handler for archiver process */
319 static void
320 pgarch_waken(SIGNAL_ARGS)
321 {
322         int                     save_errno = errno;
323
324         /* set flag that there is work to be done */
325         wakened = true;
326         SetLatch(&mainloop_latch);
327
328         errno = save_errno;
329 }
330
331 /* SIGUSR2 signal handler for archiver process */
332 static void
333 pgarch_waken_stop(SIGNAL_ARGS)
334 {
335         int                     save_errno = errno;
336
337         /* set flag to do a final cycle and shut down afterwards */
338         ready_to_stop = true;
339         SetLatch(&mainloop_latch);
340
341         errno = save_errno;
342 }
343
344 /*
345  * pgarch_MainLoop
346  *
347  * Main loop for archiver
348  */
349 static void
350 pgarch_MainLoop(void)
351 {
352         pg_time_t       last_copy_time = 0;
353         bool            time_to_stop;
354
355         /*
356          * We run the copy loop immediately upon entry, in case there are
357          * unarchived files left over from a previous database run (or maybe the
358          * archiver died unexpectedly).  After that we wait for a signal or
359          * timeout before doing more.
360          */
361         wakened = true;
362
363         /*
364          * There shouldn't be anything for the archiver to do except to wait for a
365          * signal ... however, the archiver exists to protect our data, so she
366          * wakes up occasionally to allow herself to be proactive.
367          */
368         do
369         {
370                 ResetLatch(&mainloop_latch);
371
372                 /* When we get SIGUSR2, we do one more archive cycle, then exit */
373                 time_to_stop = ready_to_stop;
374
375                 /* Check for config update */
376                 if (got_SIGHUP)
377                 {
378                         got_SIGHUP = false;
379                         ProcessConfigFile(PGC_SIGHUP);
380                 }
381
382                 /*
383                  * If we've gotten SIGTERM, we normally just sit and do nothing until
384                  * SIGUSR2 arrives.  However, that means a random SIGTERM would
385                  * disable archiving indefinitely, which doesn't seem like a good
386                  * idea.  If more than 60 seconds pass since SIGTERM, exit anyway, so
387                  * that the postmaster can start a new archiver if needed.
388                  */
389                 if (got_SIGTERM)
390                 {
391                         time_t          curtime = time(NULL);
392
393                         if (last_sigterm_time == 0)
394                                 last_sigterm_time = curtime;
395                         else if ((unsigned int) (curtime - last_sigterm_time) >=
396                                          (unsigned int) 60)
397                                 break;
398                 }
399
400                 /* Do what we're here for */
401                 if (wakened || time_to_stop)
402                 {
403                         wakened = false;
404                         pgarch_ArchiverCopyLoop();
405                         last_copy_time = time(NULL);
406                 }
407
408                 /*
409                  * Sleep until a signal is received, or until a poll is forced by
410                  * PGARCH_AUTOWAKE_INTERVAL having passed since last_copy_time, or
411                  * until postmaster dies.
412                  */
413                 if (!time_to_stop)              /* Don't wait during last iteration */
414                 {
415                         pg_time_t       curtime = (pg_time_t) time(NULL);
416                         int                     timeout;
417
418                         timeout = PGARCH_AUTOWAKE_INTERVAL - (curtime - last_copy_time);
419                         if (timeout > 0)
420                         {
421                                 int                     rc;
422
423                                 rc = WaitLatch(&mainloop_latch,
424                                                          WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH,
425                                                            timeout * 1000L);
426                                 if (rc & WL_TIMEOUT)
427                                         wakened = true;
428                         }
429                         else
430                                 wakened = true;
431                 }
432
433                 /*
434                  * The archiver quits either when the postmaster dies (not expected)
435                  * or after completing one more archiving cycle after receiving
436                  * SIGUSR2.
437                  */
438         } while (PostmasterIsAlive() && !time_to_stop);
439 }
440
441 /*
442  * pgarch_ArchiverCopyLoop
443  *
444  * Archives all outstanding xlogs then returns
445  */
446 static void
447 pgarch_ArchiverCopyLoop(void)
448 {
449         char            xlog[MAX_XFN_CHARS + 1];
450
451         /*
452          * loop through all xlogs with archive_status of .ready and archive
453          * them...mostly we expect this to be a single file, though it is possible
454          * some backend will add files onto the list of those that need archiving
455          * while we are still copying earlier archives
456          */
457         while (pgarch_readyXlog(xlog))
458         {
459                 int                     failures = 0;
460
461                 for (;;)
462                 {
463                         /*
464                          * Do not initiate any more archive commands after receiving
465                          * SIGTERM, nor after the postmaster has died unexpectedly. The
466                          * first condition is to try to keep from having init SIGKILL the
467                          * command, and the second is to avoid conflicts with another
468                          * archiver spawned by a newer postmaster.
469                          */
470                         if (got_SIGTERM || !PostmasterIsAlive())
471                                 return;
472
473                         /*
474                          * Check for config update.  This is so that we'll adopt a new
475                          * setting for archive_command as soon as possible, even if there
476                          * is a backlog of files to be archived.
477                          */
478                         if (got_SIGHUP)
479                         {
480                                 got_SIGHUP = false;
481                                 ProcessConfigFile(PGC_SIGHUP);
482                         }
483
484                         /* can't do anything if no command ... */
485                         if (!XLogArchiveCommandSet())
486                         {
487                                 ereport(WARNING,
488                                                 (errmsg("archive_mode enabled, yet archive_command is not set")));
489                                 return;
490                         }
491
492                         if (pgarch_archiveXlog(xlog))
493                         {
494                                 /* successful */
495                                 pgarch_archiveDone(xlog);
496                                 break;                  /* out of inner retry loop */
497                         }
498                         else
499                         {
500                                 if (++failures >= NUM_ARCHIVE_RETRIES)
501                                 {
502                                         ereport(WARNING,
503                                                         (errmsg("transaction log file \"%s\" could not be archived: too many failures",
504                                                                         xlog)));
505                                         return;         /* give up archiving for now */
506                                 }
507                                 pg_usleep(1000000L);    /* wait a bit before retrying */
508                         }
509                 }
510         }
511 }
512
513 /*
514  * pgarch_archiveXlog
515  *
516  * Invokes system(3) to copy one archive file to wherever it should go
517  *
518  * Returns true if successful
519  */
520 static bool
521 pgarch_archiveXlog(char *xlog)
522 {
523         char            xlogarchcmd[MAXPGPATH];
524         char            pathname[MAXPGPATH];
525         char            activitymsg[MAXFNAMELEN + 16];
526         char       *dp;
527         char       *endp;
528         const char *sp;
529         int                     rc;
530
531         snprintf(pathname, MAXPGPATH, XLOGDIR "/%s", xlog);
532
533         /*
534          * construct the command to be executed
535          */
536         dp = xlogarchcmd;
537         endp = xlogarchcmd + MAXPGPATH - 1;
538         *endp = '\0';
539
540         for (sp = XLogArchiveCommand; *sp; sp++)
541         {
542                 if (*sp == '%')
543                 {
544                         switch (sp[1])
545                         {
546                                 case 'p':
547                                         /* %p: relative path of source file */
548                                         sp++;
549                                         strlcpy(dp, pathname, endp - dp);
550                                         make_native_path(dp);
551                                         dp += strlen(dp);
552                                         break;
553                                 case 'f':
554                                         /* %f: filename of source file */
555                                         sp++;
556                                         strlcpy(dp, xlog, endp - dp);
557                                         dp += strlen(dp);
558                                         break;
559                                 case '%':
560                                         /* convert %% to a single % */
561                                         sp++;
562                                         if (dp < endp)
563                                                 *dp++ = *sp;
564                                         break;
565                                 default:
566                                         /* otherwise treat the % as not special */
567                                         if (dp < endp)
568                                                 *dp++ = *sp;
569                                         break;
570                         }
571                 }
572                 else
573                 {
574                         if (dp < endp)
575                                 *dp++ = *sp;
576                 }
577         }
578         *dp = '\0';
579
580         ereport(DEBUG3,
581                         (errmsg_internal("executing archive command \"%s\"",
582                                                          xlogarchcmd)));
583
584         /* Report archive activity in PS display */
585         snprintf(activitymsg, sizeof(activitymsg), "archiving %s", xlog);
586         set_ps_display(activitymsg, false);
587
588         rc = system(xlogarchcmd);
589         if (rc != 0)
590         {
591                 /*
592                  * If either the shell itself, or a called command, died on a signal,
593                  * abort the archiver.  We do this because system() ignores SIGINT and
594                  * SIGQUIT while waiting; so a signal is very likely something that
595                  * should have interrupted us too.      If we overreact it's no big deal,
596                  * the postmaster will just start the archiver again.
597                  *
598                  * Per the Single Unix Spec, shells report exit status > 128 when a
599                  * called command died on a signal.
600                  */
601                 int                     lev = (WIFSIGNALED(rc) || WEXITSTATUS(rc) > 128) ? FATAL : LOG;
602
603                 if (WIFEXITED(rc))
604                 {
605                         ereport(lev,
606                                         (errmsg("archive command failed with exit code %d",
607                                                         WEXITSTATUS(rc)),
608                                          errdetail("The failed archive command was: %s",
609                                                            xlogarchcmd)));
610                 }
611                 else if (WIFSIGNALED(rc))
612                 {
613 #if defined(WIN32)
614                         ereport(lev,
615                                   (errmsg("archive command was terminated by exception 0x%X",
616                                                   WTERMSIG(rc)),
617                                    errhint("See C include file \"ntstatus.h\" for a description of the hexadecimal value."),
618                                    errdetail("The failed archive command was: %s",
619                                                          xlogarchcmd)));
620 #elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST
621                         ereport(lev,
622                                         (errmsg("archive command was terminated by signal %d: %s",
623                                                         WTERMSIG(rc),
624                           WTERMSIG(rc) < NSIG ? sys_siglist[WTERMSIG(rc)] : "(unknown)"),
625                                          errdetail("The failed archive command was: %s",
626                                                            xlogarchcmd)));
627 #else
628                         ereport(lev,
629                                         (errmsg("archive command was terminated by signal %d",
630                                                         WTERMSIG(rc)),
631                                          errdetail("The failed archive command was: %s",
632                                                            xlogarchcmd)));
633 #endif
634                 }
635                 else
636                 {
637                         ereport(lev,
638                                 (errmsg("archive command exited with unrecognized status %d",
639                                                 rc),
640                                  errdetail("The failed archive command was: %s",
641                                                    xlogarchcmd)));
642                 }
643
644                 snprintf(activitymsg, sizeof(activitymsg), "failed on %s", xlog);
645                 set_ps_display(activitymsg, false);
646
647                 return false;
648         }
649         ereport(DEBUG1,
650                         (errmsg("archived transaction log file \"%s\"", xlog)));
651
652         snprintf(activitymsg, sizeof(activitymsg), "last was %s", xlog);
653         set_ps_display(activitymsg, false);
654
655         return true;
656 }
657
658 /*
659  * pgarch_readyXlog
660  *
661  * Return name of the oldest xlog file that has not yet been archived.
662  * No notification is set that file archiving is now in progress, so
663  * this would need to be extended if multiple concurrent archival
664  * tasks were created. If a failure occurs, we will completely
665  * re-copy the file at the next available opportunity.
666  *
667  * It is important that we return the oldest, so that we archive xlogs
668  * in order that they were written, for two reasons:
669  * 1) to maintain the sequential chain of xlogs required for recovery
670  * 2) because the oldest ones will sooner become candidates for
671  * recycling at time of checkpoint
672  *
673  * NOTE: the "oldest" comparison will presently consider all segments of
674  * a timeline with a smaller ID to be older than all segments of a timeline
675  * with a larger ID; the net result being that past timelines are given
676  * higher priority for archiving.  This seems okay, or at least not
677  * obviously worth changing.
678  */
679 static bool
680 pgarch_readyXlog(char *xlog)
681 {
682         /*
683          * open xlog status directory and read through list of xlogs that have the
684          * .ready suffix, looking for earliest file. It is possible to optimise
685          * this code, though only a single file is expected on the vast majority
686          * of calls, so....
687          */
688         char            XLogArchiveStatusDir[MAXPGPATH];
689         char            newxlog[MAX_XFN_CHARS + 6 + 1];
690         DIR                *rldir;
691         struct dirent *rlde;
692         bool            found = false;
693
694         snprintf(XLogArchiveStatusDir, MAXPGPATH, XLOGDIR "/archive_status");
695         rldir = AllocateDir(XLogArchiveStatusDir);
696         if (rldir == NULL)
697                 ereport(ERROR,
698                                 (errcode_for_file_access(),
699                                  errmsg("could not open archive status directory \"%s\": %m",
700                                                 XLogArchiveStatusDir)));
701
702         while ((rlde = ReadDir(rldir, XLogArchiveStatusDir)) != NULL)
703         {
704                 int                     basenamelen = (int) strlen(rlde->d_name) - 6;
705
706                 if (basenamelen >= MIN_XFN_CHARS &&
707                         basenamelen <= MAX_XFN_CHARS &&
708                         strspn(rlde->d_name, VALID_XFN_CHARS) >= basenamelen &&
709                         strcmp(rlde->d_name + basenamelen, ".ready") == 0)
710                 {
711                         if (!found)
712                         {
713                                 strcpy(newxlog, rlde->d_name);
714                                 found = true;
715                         }
716                         else
717                         {
718                                 if (strcmp(rlde->d_name, newxlog) < 0)
719                                         strcpy(newxlog, rlde->d_name);
720                         }
721                 }
722         }
723         FreeDir(rldir);
724
725         if (found)
726         {
727                 /* truncate off the .ready */
728                 newxlog[strlen(newxlog) - 6] = '\0';
729                 strcpy(xlog, newxlog);
730         }
731         return found;
732 }
733
734 /*
735  * pgarch_archiveDone
736  *
737  * Emit notification that an xlog file has been successfully archived.
738  * We do this by renaming the status file from NNN.ready to NNN.done.
739  * Eventually, a checkpoint process will notice this and delete both the
740  * NNN.done file and the xlog file itself.
741  */
742 static void
743 pgarch_archiveDone(char *xlog)
744 {
745         char            rlogready[MAXPGPATH];
746         char            rlogdone[MAXPGPATH];
747
748         StatusFilePath(rlogready, xlog, ".ready");
749         StatusFilePath(rlogdone, xlog, ".done");
750         if (rename(rlogready, rlogdone) < 0)
751                 ereport(WARNING,
752                                 (errcode_for_file_access(),
753                                  errmsg("could not rename file \"%s\" to \"%s\": %m",
754                                                 rlogready, rlogdone)));
755 }