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 # one line per entry
# each entry is explicitely denied access (blacklisted) # each entry is explicitely denied access (blacklisted)

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

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

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

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

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

Loading…
Cancel
Save

Powered by TurnKey Linux.