remvoe and create a pid file on start-up

pull/1/head
Tom Early 6 years ago
parent 9f03c816df
commit ce3b20f6fa

@ -1,5 +1,5 @@
##############################################################################
# XLXD blacklist file
# XLXD/XRFD blacklist file
#
# one line per entry
# each entry is explicitely denied access (blacklisted)

@ -1,13 +1,13 @@
##############################################################################
# XLXD interlink file
# XLXD/XRFD interlink file
#
# one line per entry
# each entry specifies a remote XLX or XRF to peer with
# format:
# <XLX callsign> <ip> <list of modules shared>
# <XLX callsign> <ip> <list of modules shared> # for XLXD only!
# <XRF callsign> <ip> <local module><remote module>
# example:
# XLX270 158.64.26.132 ACD
# XLX270 158.64.26.132 ACD # for XLXD only!
# XRF270 158.64.26.132 BB
#
# note: the remote XLX must list this XLX in its interlink file

@ -1,5 +1,5 @@
#########################################################################################
# XLXD terminal option file
# XLXD/XRFD terminal option file
#
# one line per entry
# each entry specifies a terminal option

@ -1,5 +1,5 @@
##############################################################################
# XLXD whitelist file
# XLXD/XRFD whitelist file
#
# one line per entry
# each entry is explicitely authorised (whitelisted)

@ -72,7 +72,6 @@ WriteMemFile () {
[ -z ${g3support+x} ] || echo "g3support=$g3support" >> $file
[ -z ${dbsupport+x} ] || echo "dbsupport=$dbsupport" >> $file
echo "===========${file}============="
cat $file
}
WriteSRCHFile () {

@ -46,6 +46,10 @@ int main()
std::cerr << "Malformed reflector callsign: '" << cs << "', aborting!" << std::endl;
return EXIT_FAILURE;
}
// remove pidfile
remove(PIDFILE_PATH);
// splash
std::cout << "Starting " << cs << " " << VERSION_MAJOR << "." << VERSION_MINOR << "." << VERSION_REVISION << std::endl << std::endl;
@ -85,6 +89,11 @@ int main()
return EXIT_FAILURE;
#endif
// write new pid file
std::ofstream ofs(PIDFILE_PATH, std::ofstream::out);
ofs << getpid() << std::endl;
ofs.close();
pause(); // wait for any signal
g_Reflector.Stop();

@ -197,6 +197,7 @@
#define INTERLINKLIST_PATH "/usr/local/etc/xrfd.interlink"
#define TERMINALOPTIONS_PATH "/usr/local/etc/xrfd.terminal"
#define DEBUGDUMP_PATH "/var/log/xrfd.debug"
#define PIDFILE_PATH "/var/run/xrfd.pid"
#else
#define XML_PATH "/var/log/xlxd.xml"
#define WHITELIST_PATH "/usr/local/etc/xlxd.whitelist"
@ -204,6 +205,7 @@
#define INTERLINKLIST_PATH "/usr/local/etc/xlxd.interlink"
#define TERMINALOPTIONS_PATH "/usr/local/etc/xlxd.terminal"
#define DEBUGDUMP_PATH "/var/log/xlxd.debug"
#define PIDFILE_PATH "/var/run/xlxd.pid"
#endif
////////////////////////////////////////////////////////////////////////////////////////

Loading…
Cancel
Save

Powered by TurnKey Linux.