version 1.38, 2025/04/15 02:24:43
|
version 1.41, 2025/04/25 20:08:19
|
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.41 2025/04/25 20:08:19 snw |
|
* Work on improving routine importer |
|
* |
|
* Revision 1.40 2025/04/15 18:19:40 snw |
|
* Further attempts to fix FreeBSD |
|
* |
|
* Revision 1.39 2025/04/15 16:49:36 snw |
|
* Make use of logprintf throughout codebase |
|
* |
* Revision 1.38 2025/04/15 02:24:43 snw |
* Revision 1.38 2025/04/15 02:24:43 snw |
* Improve FreeM logging capabilities |
* Improve FreeM logging capabilities |
* |
* |
Line 144
|
Line 153
|
#include "transact.h" |
#include "transact.h" |
#include "namespace.h" |
#include "namespace.h" |
#include "fs.h" |
#include "fs.h" |
|
#include "log.h" |
|
|
#ifdef HAVE_LIBREADLINE |
#ifdef HAVE_LIBREADLINE |
# if defined(HAVE_READLINE_READLINE_H) |
# if defined(HAVE_READLINE_READLINE_H) |
Line 204 extern char env_config_file[4096];
|
Line 214 extern char env_config_file[4096];
|
extern char env_user[255]; |
extern char env_user[255]; |
extern char env_group[255]; |
extern char env_group[255]; |
extern char env_enabled[10]; |
extern char env_enabled[10]; |
|
extern char shm_env[255]; |
|
|
int fm_shell(void); |
int fm_shell(void); |
void fm_checkperms(void); |
void fm_checkperms(void); |
Line 387 int main (int argc, char **argv)
|
Line 398 int main (int argc, char **argv)
|
|
|
snprintf (env_config_file, sizeof (env_config_file) - 1, "%s/freem/env.conf", SYSCONFDIR); |
snprintf (env_config_file, sizeof (env_config_file) - 1, "%s/freem/env.conf", SYSCONFDIR); |
|
|
/* |
|
printf ("action = '%s' object = '%s' environment = '%s' namespace = '%s' config_file = '%s' base_arg = '%d' next argument = '%s'\n", action, obj_str, fma_environment, fma_namespace, config_file, base_arg, argv[base_arg]); |
//printf ("action = '%s' object = '%s' environment = '%s' namespace = '%s' config_file = '%s' base_arg = '%d' next argument = '%s'\n", action, obj_str, fma_environment, fma_namespace, config_file, base_arg, argv[base_arg]); |
exit(1); |
//exit(1); |
*/ |
|
|
strncpy (shm_env, fma_environment, sizeof (shm_env) - 1); |
|
init_log (); |
|
|
/* override for fmadm configure and daemon stuff */ |
/* override for fmadm configure and daemon stuff */ |
if (got_action) { |
if (got_action) { |
Line 570 act_switch:
|
Line 583 act_switch:
|
|
|
|
|
case ACT_IMPORT: |
case ACT_IMPORT: |
|
//printf ("opts[0] = %s\n", opts[0]); |
fmadm_exit (fm_import (obj, optc, opts)); |
fmadm_exit (fm_import (obj, optc, opts)); |
|
|
|
|
Line 1796 void fm_configure (void)
|
Line 1810 void fm_configure (void)
|
|
|
snprintf (buf, sizeof (buf) - 1, "env_path=%s/freem/%s", LOCALSTATEDIR, fma_environment); |
snprintf (buf, sizeof (buf) - 1, "env_path=%s/freem/%s", LOCALSTATEDIR, fma_environment); |
fm_write (fp, buf); |
fm_write (fp, buf); |
|
|
|
snprintf (buf, sizeof (buf) - 1, "log_threshold_file=info"); |
|
fm_write (fp, buf); |
|
|
|
snprintf (buf, sizeof (buf) - 1, "log_threshold_syslog=info"); |
|
fm_write (fp, buf); |
|
|
|
snprintf (buf, sizeof (buf) - 1, "log_threshold_stderr=warning"); |
|
fm_write (fp, buf); |
|
|
fclose (fp); |
fclose (fp); |
fprintf (stderr, "[OK]\n"); |
fprintf (stderr, "[OK]\n"); |
Line 1806 void fm_configure (void)
|
Line 1829 void fm_configure (void)
|
update_conf (env_config_file, fma_environment, "user", env_user); |
update_conf (env_config_file, fma_environment, "user", env_user); |
update_conf (env_config_file, fma_environment, "group", env_group); |
update_conf (env_config_file, fma_environment, "group", env_group); |
update_conf (env_config_file, fma_environment, "enabled", env_enabled); |
update_conf (env_config_file, fma_environment, "enabled", env_enabled); |
|
update_conf (env_config_file, fma_environment, "log_threshold_file", "info"); |
|
update_conf (env_config_file, fma_environment, "log_threshold_syslog", "info"); |
|
update_conf (env_config_file, fma_environment, "log_threshold_stderr", "warning"); |
} |
} |
|
|
if (reconfigure == FALSE) { |
if (reconfigure == FALSE) { |