--- freem/src/mumps.c 2025/04/16 05:57:42 1.25 +++ freem/src/mumps.c 2025/04/16 17:36:12 1.26 @@ -1,5 +1,5 @@ /* - * $Id: mumps.c,v 1.25 2025/04/16 05:57:42 snw Exp $ + * $Id: mumps.c,v 1.26 2025/04/16 17:36:12 snw Exp $ * main module of freem * * @@ -24,6 +24,9 @@ * along with FreeM. If not, see . * * $Log: mumps.c,v $ + * Revision 1.26 2025/04/16 17:36:12 snw + * Add FreeBSD shm cleanup script + * * Revision 1.25 2025/04/16 05:57:42 snw * Remove non-useful procctl calls * @@ -594,14 +597,18 @@ int main (int argc, char **argv, char ** } } + logprintf (FM_LOG_INFO, "environment: privilege shedding complete"); + } else { logprintf (FM_LOG_INFO, "environment: not running as superuser; not shedding privileges"); } + logprintf (FM_LOG_INFO, "environment: reopening stdin, stdout, and stderr"); freopen ("/dev/null", "r", stdin); freopen ("/dev/null", "w+", stdout); freopen ("/dev/null", "w+", stderr); + logprintf (FM_LOG_INFO, "environment: stdin, stdout, and stderr reopened"); run_daemon = TRUE; nofork = FALSE; @@ -615,6 +622,7 @@ int main (int argc, char **argv, char ** snprintf (pid_file_path, PATH_MAX - 1, "%s/freem/run/%s.pid", LOCALSTATEDIR, shm_env); + logprintf (FM_LOG_INFO, "environment: opening pid file %s", pid_file_path); pid_fd = open (pid_file_path, O_RDWR | O_CREAT, 0640); errsav = errno; @@ -628,6 +636,7 @@ int main (int argc, char **argv, char ** } sprintf (pidfile_buf, "%ld\n", (long) getpid ()); + logprintf (FM_LOG_INFO, "environment: writing pid file"); write (pid_fd, pidfile_buf, strlen (pidfile_buf)); }