path: monero_0.18.4.5+~0+20200826-1/README.md ```bash gdb /path/to/monerod `pidof monerod` ``` path: monero_0.18.4.5+~0+20200826-1/src/daemonizer/posix_fork.cpp if (pid > 0) { pidofs.close(); exit(0); } path: monero_0.18.4.5+~0+20200826-1/src/daemonizer/posix_fork.cpp { // We're in the parent process and need to exit. pidofs.close(); // When the exit() function is used, the program terminates without // invoking local variables' destructors. Only global variables are path: monero_0.18.4.5+~0+20200826-1/src/daemonizer/posix_fork.cpp int pid = ::getpid(); pidofs << pid << std::endl; pidofs.close(); } path: monero_0.18.4.5+~0+20200826-1/src/daemonizer/posix_fork.cpp // Only in the final child process do we write the PID to the // file (and close it). std::ofstream pidofs; if (! pidfile.empty ()) { path: monero_0.18.4.5+~0+20200826-1/src/daemonizer/posix_fork.cpp } pidofs.open(pidfile, std::fstream::out | std::fstream::trunc); if (pidofs.fail()) { path: monero_0.18.4.5+~0+20200826-1/src/daemonizer/posix_fork.cpp { int pid = ::getpid(); pidofs << pid << std::endl; pidofs.close(); } path: monero_0.18.4.5+~0+20200826-1/src/daemonizer/posix_fork.cpp } if (! pidofs.fail()) { int pid = ::getpid(); path: monero_0.18.4.5+~0+20200826-1/src/daemonizer/posix_fork.cpp pidofs.open(pidfile, std::fstream::out | std::fstream::trunc); if (pidofs.fail()) { quit("Failed to open specified PID file for writing");