char ctdl_usrpic_dir[PATH_MAX]="userpics";
char ctdl_bbsbase_dir[PATH_MAX]="";
char ctdl_etc_dir[PATH_MAX]="";
+char ctdl_autoetc_dir[PATH_MAX]="";
/* attention! this may be non volatile on some oses */
char ctdl_run_dir[PATH_MAX]="";
char ctdl_spool_dir[PATH_MAX]="network";
#endif
StripSlashes(ctdl_sbin_dir, 1);
StripSlashes(ctdl_bin_dir, 1);
+
+#ifndef HAVE_AUTO_ETC_DIR
+ basedir=ctdldir;
+#else
+ basedir=AUTO_ETC_DIR;
+#endif
+ COMPUTE_DIRECTORY(ctdl_autoetc_dir);
+ StripSlashes(ctdl_autoetc_dir, 1);
+
#ifndef HAVE_ETC_DIR
basedir=ctdldir;
#else
snprintf(file_arcq,
sizeof file_arcq,
"%srefcount_adjustments.dat",
- ctdl_etc_dir);
+ ctdl_autoetc_dir);
StripSlashes(file_arcq, 0);
snprintf(file_citadel_control,
sizeof file_citadel_control,
"%scitadel.control",
- ctdl_etc_dir
+ ctdl_autoetc_dir
);
StripSlashes(file_citadel_control, 0);
snprintf(file_citadel_config,
sizeof file_citadel_config,
"%scitadel.config",
- ctdl_etc_dir);
+ ctdl_autoetc_dir);
StripSlashes(file_citadel_config, 0);
snprintf(file_citadel_rc,
sizeof file_citadel_rc,
extern char ctdl_message_dir[PATH_MAX];
extern char ctdl_usrpic_dir[PATH_MAX];
extern char ctdl_etc_dir[PATH_MAX];
+extern char ctdl_autoetc_dir[PATH_MAX];
extern char ctdl_run_dir[PATH_MAX];
extern char ctdl_spool_dir[PATH_MAX];
extern char ctdl_netout_dir[PATH_MAX];
]
)
+dnl Checks for the Configdir
+AC_ARG_WITH(autosysconfdir,
+ [ --with-autosysconfdir directory to store the automaticaly maintained configs under],
+ [ if test "x$withval" != "xno" ; then
+ AC_DEFINE(HAVE_AUTO_ETC_DIR, [], [should we search our automatic config in an alternate place?])
+ AC_DEFINE_UNQUOTED(AUTO_ETC_DIR, "$withval", [where to search our automatic config files])
+ MAKE_AUTO_ETC_DIR=$withval
+ AC_SUBST(MAKE_AUTO_ETC_DIR)
+ fi
+ ]
+)
+
dnl Checks for where to put our utilities
AC_ARG_WITH(utility-bindir,
[ --with-utility-bindir directory where to find helper binaries],
if (control_fp != NULL) {
lock_control();
fchown(fileno(control_fp), config.c_ctdluid, -1);
+ fchmod(fileno(control_fp),
+ S_IRUSR|S_IWUSR);
}
}
if (control_fp == NULL) {
if (control_fp != NULL) {
lock_control();
fchown(fileno(control_fp), config.c_ctdluid, -1);
+ fchmod(fileno(control_fp),
+ S_IRUSR|S_IWUSR);
memset(&CitControl, 0, sizeof(struct CitControl));
fwrite(&CitControl, sizeof(struct CitControl),
1, control_fp);
fread(&CitControl, sizeof(struct CitControl), 1, control_fp);
already_have_control = 1;
chown(file_citadel_control, config.c_ctdluid, (-1));
+
}
/*
#This is not debian conformant, and uniq to the citadel.org debs.
export ALTER_ETC_SERVICES=yes
#
+ if test -S /var/run/citadel/citadel.socket; then
+ /usr/sbin/sendcommand "DOWN"
+ fi
+ while test -S /var/run/citadel/citadel.socket; do
+ sleep 1
+ done
+ if test ! -f /var/lib/citadel/data/citadel.control -a -f /etc/citadel/citadel.control; then
+ mv /etc/citadel/citadel.control /var/lib/citadel/data/
+ mv /etc/citadel/citadel.config /var/lib/citadel/data/
+ fi
+
echo -n "applying your settings.... "
/usr/lib/citadel-server/setup -q
echo "done"
--with-staticdatadir=/etc/citadel/ \
--with-ssldir=/etc/ssl/citadel/ \
--with-utility-bindir=/usr/lib/citadel-server/ \
+ --with-autosysconfdir=/var/lib/citadel/data/ \
--with-pam \
--with-db \
--with-zlib \