/* when changing defaults, remember to update the manpage */
static const char *sitename, *remote_host;
-static const char *feedfile, *path_cli, *path_cli_dir;
+static const char *feedfile, *path_run, *path_cli, *path_cli_dir;
static int quiet_multiple=0;
static int become_daemon=1, try_filemon=1;
static int try_stream=1;
{0,"no-filemon", 0, &try_filemon, op_setint, 0 },
{'C',"inndconf", "F", &inndconffile, op_string },
{'P',"port", "PORT", &port, op_integer },
+{0,"chdir", "DIR", &path_run, op_string },
{0,"cli", "DIR/|PATH", &path_cli, op_string },
{0,"help", 0, 0, help },
if (max_bad_data_ratio < 0 || max_bad_data_ratio > 100)
badusage("bad input data ratio must be between 0..100");
max_bad_data_ratio *= 0.01;
-
+
+ if (!path_run)
+ path_run= innconf->pathrun;
+
if (!feedfile) {
feedfile= xasprintf("%s/%s",innconf->pathoutgoing,sitename);
} else if (!feedfile[0]) {
}
if (!path_cli) {
- path_cli_dir= xasprintf("%s/innduct", innconf->pathrun);
+ path_cli_dir= "innduct";
} else if (!path_cli[0] || !strcmp(path_cli,"none")) {
path_cli= 0; /* ok, don't then */
} else if (path_ends_slash(path_cli)) {
/* set things up */
+ r= chdir(path_run);
+ if (r) sysdie("could not chdir to pathrun %s", path_run);
+
path_lock= xasprintf("%s_lock", feedfile);
path_flushing= xasprintf("%s_flushing", feedfile);
path_defer= xasprintf("%s_defer", feedfile);