diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /app-admin/cronolog/files/1.6.2-patches/cronolog-sigusr1.patch |
reinit the tree, so we can have metadata
Diffstat (limited to 'app-admin/cronolog/files/1.6.2-patches/cronolog-sigusr1.patch')
-rw-r--r-- | app-admin/cronolog/files/1.6.2-patches/cronolog-sigusr1.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/app-admin/cronolog/files/1.6.2-patches/cronolog-sigusr1.patch b/app-admin/cronolog/files/1.6.2-patches/cronolog-sigusr1.patch new file mode 100644 index 000000000000..e7cc8be2c425 --- /dev/null +++ b/app-admin/cronolog/files/1.6.2-patches/cronolog-sigusr1.patch @@ -0,0 +1,46 @@ +*** a/src/cronolog.c.orig 2001-05-03 17:42:48.000000000 +0100 +--- b/src/cronolog.c 2003-08-15 14:03:17.000000000 +0100 +*************** +*** 84,95 **** +--- 84,97 ---- + + #include "cronoutils.h" + #include "getopt.h" ++ #include <signal.h> + + + /* Forward function declaration */ + + int new_log_file(const char *, const char *, mode_t, const char *, + PERIODICITY, int, int, char *, size_t, time_t, time_t *); ++ void terminate_self(int); + + + /* Definition of version and usage messages */ +*************** +*** 306,311 **** +--- 308,317 ---- + DEBUG(("Rotation period is per %d %s\n", period_multiple, periods[periodicity])); + + ++ /* set up signal handlers to catch USR1 and HUP when restarting Apache */ ++ signal(SIGUSR1, terminate_self); ++ signal(SIGHUP, terminate_self); ++ + /* Loop, waiting for data on standard input */ + + for (;;) +*************** +*** 416,418 **** +--- 422,432 ---- + } + return log_fd; + } ++ ++ void terminate_self(int sig) ++ { ++ time_t time_now = time(NULL); ++ DEBUG(("%s (%d): received signal USR1; terminating.\n", ++ timestamp(time_now), time_now)); ++ exit(6); ++ } |