Commit 4f31d913 authored by rswindell's avatar rswindell
Browse files

Automatically recycle whenever the startup file (e.g. sbbs.ini) is modified.

parent abe2367b
......@@ -4950,6 +4950,7 @@ void DLLCALL ftp_server(void* arg)
/* Setup recycle/shutdown semaphore file lists */
shutdown_semfiles=semfile_list_init(scfg.ctrl_dir,"shutdown","ftp");
recycle_semfiles=semfile_list_init(scfg.ctrl_dir,"recycle","ftp");
semfile_list_add(&recycle_semfiles,startup->ini_fname);
SAFEPRINTF(path,"%sftpsrvr.rec",scfg.ctrl_dir); /* legacy */
semfile_list_add(&recycle_semfiles,path);
if(!initialized) {
......
/* ftpsrvr.h */
/* Synchronet FTP server */
/* $Id$ */
......@@ -87,6 +85,7 @@ typedef struct {
char answer_sound[128];
char hangup_sound[128];
char hack_sound[128];
char ini_fname[128];
/* Misc */
char host_name[128];
......
......@@ -5395,6 +5395,7 @@ void DLLCALL mail_server(void* arg)
/* Setup recycle/shutdown semaphore file lists */
shutdown_semfiles=semfile_list_init(scfg.ctrl_dir,"shutdown","mail");
recycle_semfiles=semfile_list_init(scfg.ctrl_dir,"recycle","mail");
semfile_list_add(&recycle_semfiles,startup->ini_fname);
SAFEPRINTF(path,"%smailsrvr.rec",scfg.ctrl_dir); /* legacy */
semfile_list_add(&recycle_semfiles,path);
semfile_list_add(&recycle_semfiles,mailproc_ini);
......
/* mailsrvr.h */
/* Synchronet Mail (SMTP/POP3/SendMail) server */
/* $Id$ */
......@@ -91,6 +89,7 @@ typedef struct {
/* Paths */
char ctrl_dir[128];
char temp_dir[128];
char ini_fname[128];
/* Strings */
char dns_server[128];
......
......@@ -4940,6 +4940,7 @@ NO_SSH:
/* Setup recycle/shutdown semaphore file lists */
shutdown_semfiles=semfile_list_init(scfg.ctrl_dir,"shutdown","telnet");
recycle_semfiles=semfile_list_init(scfg.ctrl_dir,"recycle","telnet");
semfile_list_add(&recycle_semfiles,startup->ini_fname);
SAFEPRINTF(str,"%stelnet.rec",scfg.ctrl_dir); /* legacy */
semfile_list_add(&recycle_semfiles,str);
SAFEPRINTF(str,"%stext.dat",scfg.ctrl_dir);
......
......@@ -392,7 +392,7 @@ static void read_ini(sbbs_ntsvc_t* svc)
}
/* We call this function to set defaults, even if there's no .ini file */
sbbs_read_ini(fp
sbbs_read_ini(fp, ini_file
,NULL /* global_startup */
,NULL ,bbs_startup
,NULL ,ftp_startup
......@@ -1285,7 +1285,7 @@ int main(int argc, char** argv)
}
/* We call this function to set defaults, even if there's no .ini file */
sbbs_read_ini(fp
sbbs_read_ini(fp, ini_file
,NULL /* global_startup */
,&bbs.autostart ,NULL
,&ftp.autostart ,NULL
......
......@@ -258,6 +258,7 @@ static void get_ini_globals(str_list_t list, global_startup_t* global)
void sbbs_read_ini(
FILE* fp
,const char* ini_fname
,global_startup_t* global
,BOOL* run_bbs
,bbs_startup_t* bbs
......@@ -297,6 +298,14 @@ void sbbs_read_ini(
if(services!=NULL) SAFECOPY(services->ctrl_dir,global->ctrl_dir);
}
if(ini_fname!=NULL && ini_fname[0]) {
if(bbs!=NULL) SAFECOPY(bbs->ini_fname, ini_fname);
if(ftp!=NULL) SAFECOPY(ftp->ini_fname, ini_fname);
if(web!=NULL) SAFECOPY(web->ini_fname, ini_fname);
if(mail!=NULL) SAFECOPY(mail->ini_fname, ini_fname);
if(services!=NULL) SAFECOPY(services->ini_fname, ini_fname);
}
global_interfaces = strListCombine(global->interfaces, NULL, 16384, ",");
/***********************************************************************/
......
/* sbbs_ini.h */
/* Synchronet initialization (.ini) file routines */
/* $Id$ */
......@@ -8,7 +6,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -58,6 +56,7 @@ void sbbs_get_ini_fname(
void sbbs_read_ini(
FILE* fp
,const char* ini_fname
,global_startup_t* global
,BOOL* run_bbs
,bbs_startup_t* bbs_startup
......
......@@ -7,7 +7,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* CopyrightRob Swindell - http://www.synchro.net/copyright.html *
* Copyright Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -998,6 +998,7 @@ static void read_startup_ini(BOOL recycle
/* We call this function to set defaults, even if there's no .ini file */
sbbs_read_ini(fp,
ini_file,
NULL, /* global_startup */
&run_bbs, bbs,
&run_ftp, ftp,
......
......@@ -1893,6 +1893,7 @@ void DLLCALL services_thread(void* arg)
/* Setup recycle/shutdown semaphore file lists */
shutdown_semfiles=semfile_list_init(scfg.ctrl_dir,"shutdown","services");
recycle_semfiles=semfile_list_init(scfg.ctrl_dir,"recycle","services");
semfile_list_add(&recycle_semfiles,startup->ini_fname);
SAFEPRINTF(path,"%sservices.rec",scfg.ctrl_dir); /* legacy */
semfile_list_add(&recycle_semfiles,path);
semfile_list_add(&recycle_semfiles,services_ini);
......
/* services.h */
/* Synchronet main/telnet server thread startup structure */
/* $Id$ */
......@@ -70,6 +68,7 @@ typedef struct {
char temp_dir[128];
char answer_sound[128];
char hangup_sound[128];
char ini_fname[128];
/* Misc */
char host_name[128];
......
......@@ -129,6 +129,7 @@ typedef struct {
char temp_dir[128];
char answer_sound[128];
char hangup_sound[128];
char ini_fname[128];
/* Miscellaneous */
char xtrn_term_ansi[32]; /* external ANSI terminal type (e.g. "ansi-bbs") */
......
......@@ -6819,6 +6819,7 @@ void DLLCALL web_server(void* arg)
/* Setup recycle/shutdown semaphore file lists */
shutdown_semfiles=semfile_list_init(scfg.ctrl_dir,"shutdown","web");
recycle_semfiles=semfile_list_init(scfg.ctrl_dir,"recycle","web");
semfile_list_add(&recycle_semfiles,startup->ini_fname);
SAFEPRINTF(path,"%swebsrvr.rec",scfg.ctrl_dir); /* legacy */
semfile_list_add(&recycle_semfiles,path);
semfile_list_add(&recycle_semfiles,mime_types_ini);
......
/* websrvr.h */
/* Synchronet Web Server */
/* $Id$ */
......@@ -77,7 +75,7 @@ typedef struct {
/* Paths */
char ssjs_ext[16]; /* Server-Side JavaScript file extension */
char js_ext[16]; /* Embedded JavaScript file extension */
char js_ext[16]; /* Embedded JavaScript file extension */
char** cgi_ext; /* CGI Extensions */
char cgi_dir[128]; /* relative to root_dir (all files executable) */
char ctrl_dir[128];
......@@ -89,6 +87,7 @@ typedef struct {
char answer_sound[128];
char hangup_sound[128];
char hack_sound[128];
char ini_fname[128];
/* Misc */
char host_name[128];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment