Thu 06 Mar 2008 02:49:16 PM UTC, original submission:
Using glusterfs-1.3.8pre2, the --pidfile command line argument does not work with glusterfsd, as the pidfile is not created/updated at all. After invertigation, looks like the pidfile_lock call inside glusterfs/src/glusterfs.c comes too early, before the command line arguments are parsed.
I made the following change in your code to get it working properly:
$ diff -u glusterfs/src/glusterfs.c.old glusterfs/src/glusterfs.c
--- glusterfs/src/glusterfs.c.old 2008-03-05 16:42:33.000000000 +0100
+++ glusterfs/src/glusterfs.c 2008-03-06 15:26:07.810731251 +0100
@@ -440,9 +440,6 @@
setrlimit (RLIMIT_CORE, &lim);
setrlimit (RLIMIT_NOFILE, &lim);
- if (pidfile)
- pidfd = pidfile_lock (pidfile);
-
asprintf (&ctx.logfile, "%s/log/glusterfs/%s.log",
DATADIR, basename (argv[0]));
@@ -454,6 +451,9 @@
argp_parse (&argp, argc, argv, 0, 0, &ctx);
+ if (pidfile)
+ pidfd = pidfile_lock (pidfile);
+
if (gf_log_init (ctx.logfile) == -1) {
fprintf (stderr,
"glusterfs: failed to open logfile \"%s\"\n",
|