add to stellarium daemon debug port @10001

This commit is contained in:
2020-03-02 08:28:53 +03:00
parent bd09ecef90
commit 33185e174a
11 changed files with 226 additions and 109 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.8.2, 2020-02-25T17:15:24. -->
<!-- Written by QtCreator 4.8.2, 2020-02-27T16:44:16. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

View File

@@ -38,7 +38,6 @@ static glob_pars G;
// DEFAULTS
// default global parameters
static glob_pars const Gdefault = {
.pidfile = DEFAULT_PIDFILE,
.port = DEFAULT_PORT,
.host = DEFAULT_HOST,
};
@@ -50,7 +49,6 @@ static glob_pars const Gdefault = {
static myoption cmdlnopts[] = {
// common options
{"help", NO_ARGS, NULL, 'h', arg_int, APTR(&help), _("show this help")},
{"pidfile", NEED_ARG, NULL, 'p', arg_string, APTR(&G.pidfile), _("pidfile (default: " DEFAULT_PIDFILE ")")},
{"port", NEED_ARG, NULL, 'P', arg_string, APTR(&G.port), _("port to connect (default: " DEFAULT_PORT ")")},
{"host", NEED_ARG, NULL, 'H', arg_string, APTR(&G.host), _("host to connect (default: " DEFAULT_HOST ")")},
{"ra", NEED_ARG, NULL, 'r', arg_string, APTR(&G.ra), _("target RA: HH:MM:SS.SS")},

View File

@@ -25,7 +25,6 @@
* here are some typedef's for global data
*/
typedef struct{
char *pidfile; // name of PID file
char *port; // port to connect
char *host; // hostname
char *ra; // RA in string form

View File

@@ -36,9 +36,6 @@ void signals(int sig){
signal(sig, SIG_IGN);
DBG("Get signal %d, quit.\n", sig);
}
WARNX("Exit with status %d", sig);
if(GP->pidfile) // remove unnesessary PID file
unlink(GP->pidfile);
restore_console();
exit(sig);
}
@@ -51,20 +48,24 @@ int main(int argc, char *argv[]){
initial_setup();
char *self = strdup(argv[0]);
GP = parse_args(argc, argv);
DBG("here");
if(GP->rest_pars_num){
printf("%d extra options:\n", GP->rest_pars_num);
for(int i = 0; i < GP->rest_pars_num; ++i)
printf("%s\n", GP->rest_pars[i]);
}
DBG("here");
if((GP->ra && !GP->dec) || (!GP->ra && GP->dec))
ERRX("You should point both coordinates");
check4running(self, GP->pidfile);
DBG("here");
free(self);
DBG("here");
signal(SIGTERM, signals); // kill (-15) - quit
signal(SIGHUP, SIG_IGN); // hup - ignore
signal(SIGINT, signals); // ctrl+C - quit
signal(SIGQUIT, signals); // ctrl+\ - quit
signal(SIGTSTP, SIG_IGN); // ignore ctrl+Z
DBG("here");
setup_con();
/*
if(GP->rest_pars_num){