version 1.29, 2025/04/03 01:41:02
|
version 1.31, 2025/04/04 19:43:18
|
Line 24
|
Line 24
|
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* |
* |
* $Log$ |
* $Log$ |
|
* 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 |
* Revision 1.29 2025/04/03 01:41:02 snw |
* New features frozen; prepare 0.63.0-rc1 |
* New features frozen; prepare 0.63.0-rc1 |
* |
* |
Line 1210 int fm_validate_environment (char *env)
|
Line 1216 int fm_validate_environment (char *env)
|
return FALSE; |
return FALSE; |
} |
} |
|
|
int fm_start_environment (char *env, char *e_user, char *e_grp) |
int fm_start_environment (char *env) |
{ |
{ |
char basecmd[255]; |
char basecmd[255]; |
char cmd[4096]; |
char cmd[4096]; |
Line 1226 int fm_start_environment (char *env, cha
|
Line 1232 int fm_start_environment (char *env, cha
|
#endif |
#endif |
|
|
#if !defined(__OS2__) |
#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 |
#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 |
#endif |
|
|
system (cmd); |
system (cmd); |
Line 1305 int fm_daemonctl (short action, short ob
|
Line 1311 int fm_daemonctl (short action, short ob
|
char *savptr; |
char *savptr; |
int result; |
int result; |
long epid; |
long epid; |
|
int retval; |
|
|
|
retval = 0; |
|
|
switch (action) { |
switch (action) { |
case ACT_START: |
case ACT_START: |
Line 1384 int fm_daemonctl (short action, short ob
|
Line 1392 int fm_daemonctl (short action, short ob
|
switch (action) { |
switch (action) { |
|
|
case ACT_START: |
case ACT_START: |
result = fm_start_environment (cur_env, e_user, e_grp); |
result = fm_start_environment (cur_env); |
if (result == TRUE) { |
if (result == TRUE) { |
fprintf (stderr, "[OK]\n"); |
fprintf (stderr, "[OK]\n"); |
} |
} |
Line 1400 int fm_daemonctl (short action, short ob
|
Line 1408 int fm_daemonctl (short action, short ob
|
} |
} |
else { |
else { |
fprintf (stderr, "[FAIL]\n"); |
fprintf (stderr, "[FAIL]\n"); |
|
retval++; |
} |
} |
break; |
break; |
|
|
case ACT_RESTART: |
case ACT_RESTART: |
if (fm_stop_environment (cur_env) == TRUE) { |
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) { |
if (result == TRUE) { |
fprintf (stderr, "[OK]\n"); |
fprintf (stderr, "[OK]\n"); |
} |
} |
else { |
else { |
fprintf (stderr, "[FAIL]\n"); |
fprintf (stderr, "[FAIL]\n"); |
|
retval++; |
} |
} |
} |
} |
else { |
else { |
fprintf (stderr, "[FAIL]\n"); |
fprintf (stderr, "[FAIL]\n"); |
|
retval++; |
} |
} |
|
|
break; |
break; |
Line 1435 int fm_daemonctl (short action, short ob
|
Line 1446 int fm_daemonctl (short action, short ob
|
} while ((cur_env = strtok_r (NULL, ",", &savptr)) != NULL); |
} while ((cur_env = strtok_r (NULL, ",", &savptr)) != NULL); |
|
|
free (envlist); |
free (envlist); |
exit (0); |
exit (retval); |
|
|
} /* fm_daemonctl() */ |
} /* fm_daemonctl() */ |
|
|