--- freem/src/fmadm.c 2025/04/03 01:41:02 1.29 +++ freem/src/fmadm.c 2025/04/04 19:43:18 1.31 @@ -1,5 +1,5 @@ /* - * $Id: fmadm.c,v 1.29 2025/04/03 01:41:02 snw Exp $ + * $Id: fmadm.c,v 1.31 2025/04/04 19:43:18 snw Exp $ * FreeM Administration Tool * * @@ -24,6 +24,12 @@ * along with FreeM. If not, see . * * $Log: fmadm.c,v $ + * Revision 1.31 2025/04/04 19:43:18 snw + * Switch to using environment catalog to determine user and group for environment, and remove -u and -g flags from freem + * + * Revision 1.30 2025/04/03 20:48:14 snw + * Improve daemon error diagnostics and bump to 0.63.0-rc3 + * * Revision 1.29 2025/04/03 01:41:02 snw * New features frozen; prepare 0.63.0-rc1 * @@ -1210,7 +1216,7 @@ int fm_validate_environment (char *env) return FALSE; } -int fm_start_environment (char *env, char *e_user, char *e_grp) +int fm_start_environment (char *env) { char basecmd[255]; char cmd[4096]; @@ -1226,9 +1232,9 @@ int fm_start_environment (char *env, cha #endif #if !defined(__OS2__) - snprintf (cmd, 4095, "%s -d -e %s -u %s -g %s", basecmd, env, e_user, e_grp); + snprintf (cmd, 4095, "%s -d -e %s", basecmd, env); #else - sprintf (cmd, 4095, "%s -d -k -e %s -u %s -g %s", basecmd, env, e_user, e_grp); + sprintf (cmd, 4095, "%s -d -k -e %s", basecmd, env); #endif system (cmd); @@ -1305,7 +1311,9 @@ int fm_daemonctl (short action, short ob char *savptr; int result; long epid; + int retval; + retval = 0; switch (action) { case ACT_START: @@ -1384,7 +1392,7 @@ int fm_daemonctl (short action, short ob switch (action) { case ACT_START: - result = fm_start_environment (cur_env, e_user, e_grp); + result = fm_start_environment (cur_env); if (result == TRUE) { fprintf (stderr, "[OK]\n"); } @@ -1400,21 +1408,24 @@ int fm_daemonctl (short action, short ob } else { fprintf (stderr, "[FAIL]\n"); + retval++; } break; case ACT_RESTART: if (fm_stop_environment (cur_env) == TRUE) { - result = fm_start_environment (cur_env, e_user, e_grp); + result = fm_start_environment (cur_env); if (result == TRUE) { fprintf (stderr, "[OK]\n"); } else { fprintf (stderr, "[FAIL]\n"); + retval++; } } else { fprintf (stderr, "[FAIL]\n"); + retval++; } break; @@ -1435,7 +1446,7 @@ int fm_daemonctl (short action, short ob } while ((cur_env = strtok_r (NULL, ",", &savptr)) != NULL); free (envlist); - exit (0); + exit (retval); } /* fm_daemonctl() */