+static char *get_config_file_name(void)
+{
+ char *home, *config_file;
+
+ if (conf.config_file_given)
+ return dss_strdup(conf.config_file_arg);
+ home = get_homedir();
+ config_file = make_message("%s/.dssrc", home);
+ free(home);
+ return config_file;
+}
+
+static int send_signal(int sig)
+{
+ pid_t pid;
+ char *config_file = get_config_file_name();
+ int ret = get_dss_pid(config_file, &pid);
+
+ free(config_file);
+ if (ret < 0)
+ return ret;
+ if (conf.dry_run_given) {
+ dss_msg("%d\n", (int)pid);
+ return 0;
+ }
+ 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);
+}
+