X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=blobdiff_plain;f=dss.c;h=793e9194b1c695fb89d50d3fae5f63703dceeccd;hp=63f5f568fd735a8470f54d8df1663e243de81c06;hb=55c90e8e1d56bc2aec456067cdd1789d09f97d74;hpb=492928ebe8b83c31aeca4866fef37ab07174ed9c diff --git a/dss.c b/dss.c index 63f5f56..793e919 100644 --- a/dss.c +++ b/dss.c @@ -172,7 +172,9 @@ static void dump_dss_config(const char *msg) COMMAND(create) \ COMMAND(prune) \ COMMAND(run) \ - COMMAND(kill) + COMMAND(kill) \ + COMMAND(reload) \ + #define COMMAND(x) static int com_ ##x(void); COMMANDS #undef COMMAND @@ -240,7 +242,7 @@ static char *get_config_file_name(void) return config_file; } -static int com_kill(void) +static int send_signal(int sig) { pid_t pid; char *config_file = get_config_file_name(); @@ -253,12 +255,22 @@ static int com_kill(void) dss_msg("%d\n", (int)pid); return 0; } - ret = kill(pid, SIGTERM); + ret = kill(pid, sig); if (ret < 0) return -ERRNO_TO_DSS_ERROR(errno); return 1; } +static int com_kill(void) +{ + return send_signal(SIGTERM); +} + +static int com_reload(void) +{ + return send_signal(SIGHUP); +} + static void dss_get_snapshot_list(struct snapshot_list *sl) { get_snapshot_list(sl, conf.unit_interval_arg, conf.num_intervals_arg);