Пример #1
0
static void
reincarnate (int signum)
{
    int                 ret = 0;
    glusterfs_ctx_t    *ctx = NULL;
    cmd_args_t         *cmd_args = NULL;

    ctx = glusterfs_ctx_get ();
    cmd_args = &ctx->cmd_args;


    if (cmd_args->volfile_server) {
        gf_log ("glusterfsd", GF_LOG_NORMAL,
                "Fetching the volume file from server...");
        ret = glusterfs_volfile_fetch (ctx);
    } else {
        gf_log ("glusterfsd", GF_LOG_NORMAL,
                "Reloading volfile ...");
        ret = glusterfs_volumes_init (ctx);
    }

    if (ret < 0)
        gf_log ("glusterfsd", GF_LOG_ERROR,
                "volume initialization failed.");

    /* Also, SIGHUP should do logroate */
    gf_log_logrotate (1);

    return;
}
Пример #2
0
static void
log_rotate (int signum)
{
        gf_log_logrotate (1);

        if (signal (SIGHUP, *log_rotate) == SIG_ERR) {
                gf_log ("umountd", GF_LOG_ERROR, "signal () failed");
                exit (EXIT_FAILURE);
        }

        return;
}