Skip to content

Commit

Permalink
debug pidfile
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian committed Nov 14, 2023
1 parent 6a29598 commit 4913126
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/daemon-unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ daemonize_start(bool access_datapath)

if (pidfile) {
make_pidfile();
} else {
VLOG_WARN("pidfile %llu is NULL", &pidfile);
}

/* Make sure that the unixctl commands for vlog get registered in a
Expand All @@ -507,6 +509,7 @@ daemonize_complete(void)
{
if (pidfile) {
free(pidfile);
VLOG_WARN("daemonize_complete, setting pidfile to NULL");
pidfile = NULL;
}

Expand Down
4 changes: 4 additions & 0 deletions lib/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ daemonize(void)
void
set_pidfile(const char *name)
{
printf("set_pidfile(%s)\n", name);
VLOG_WARN("set_pidfile(%s)", name);
assert_single_threaded();
free(pidfile);
pidfile = make_pidfile_name(name);
VLOG_WARN("pidfile %llu is set to %s", &pidfile, pidfile);
printf("pidfile %llu is set to %s\n", &pidfile, pidfile);
}

/* Disables self confinement. */
Expand Down

0 comments on commit 4913126

Please sign in to comment.