rename to qnapd
This commit is contained in:
parent
20d44982da
commit
eea740593b
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
build
|
build
|
||||||
qnaplcd
|
qnapd
|
||||||
|
4
Makefile
4
Makefile
@ -7,9 +7,9 @@ PID_DIR = /var/run
|
|||||||
# ############################
|
# ############################
|
||||||
|
|
||||||
SRC = $(wildcard *.c)
|
SRC = $(wildcard *.c)
|
||||||
TARGET = qnaplcd
|
TARGET = qnapd
|
||||||
BUILD_DIR = build
|
BUILD_DIR = build
|
||||||
CFLAGS = -O2 -g -pipe -Wall -Wno-unused-result
|
CFLAGS = -O2 -g -pipe -Wall -Wno-unused-result -DPROGNAME='"$(TARGET)"'
|
||||||
CFLAGS += -MMD -MF $(BUILD_DIR)/$(*D)/$(*F).d
|
CFLAGS += -MMD -MF $(BUILD_DIR)/$(*D)/$(*F).d
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|
||||||
|
@ -35,11 +35,11 @@
|
|||||||
#include "signals.h"
|
#include "signals.h"
|
||||||
|
|
||||||
#define LCD_DEVICE "/dev/ttyS0"
|
#define LCD_DEVICE "/dev/ttyS0"
|
||||||
#define LCD_TIMEOUT 10
|
#define LCD_TIMEOUT 15
|
||||||
|
|
||||||
#define DEFAULT_CONFIG "qnaplcd.conf"
|
#define DEFAULT_CONFIG PROGNAME".conf"
|
||||||
#define DEFAULT_LOGFILE "qnaplcd.log"
|
#define DEFAULT_LOGFILE PROGNAME".log"
|
||||||
#define DEFAULT_PIDFILE "qnaplcd.pid"
|
#define DEFAULT_PIDFILE PROGNAME".pid"
|
||||||
|
|
||||||
static struct option opts[] = {
|
static struct option opts[] = {
|
||||||
{"config", 1, 0, 'c'},
|
{"config", 1, 0, 'c'},
|
||||||
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h': /* help */
|
case 'h': /* help */
|
||||||
printf("Usage: qnaplcd [options]\n"
|
printf("Usage: "PROGNAME" [options]\n"
|
||||||
"Options: \n"
|
"Options: \n"
|
||||||
" --config -c configfile use this configfile\n"
|
" --config -c configfile use this configfile\n"
|
||||||
" --debug -d do not fork and log to stderr\n"
|
" --debug -d do not fork and log to stderr\n"
|
||||||
@ -158,7 +158,7 @@ int main(int argc, char *argv[])
|
|||||||
/* check pidfile */
|
/* check pidfile */
|
||||||
const char *pidfile = config_get_string("global", "pidfile", DEFAULT_PIDFILE);
|
const char *pidfile = config_get_string("global", "pidfile", DEFAULT_PIDFILE);
|
||||||
if (pidfile_check(pidfile, 1) != 0) {
|
if (pidfile_check(pidfile, 1) != 0) {
|
||||||
log_print(LOG_ERROR, "qnaplcd already running");
|
log_print(LOG_ERROR, PROGNAME" already running");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ int main(int argc, char *argv[])
|
|||||||
signal_init();
|
signal_init();
|
||||||
signal_add_callback(SIGHUP, trigger_restart, (void *)&restart_var);
|
signal_add_callback(SIGHUP, trigger_restart, (void *)&restart_var);
|
||||||
|
|
||||||
log_print(LOG_EVERYTIME, "qnaplcd started (pid:%d)", getpid());
|
log_print(LOG_EVERYTIME, PROGNAME" started (pid:%d)", getpid());
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
struct lcddev *dev = lcd_init(LCD_DEVICE, &button_callback, NULL);
|
struct lcddev *dev = lcd_init(LCD_DEVICE, &button_callback, NULL);
|
||||||
@ -204,7 +204,7 @@ int main(int argc, char *argv[])
|
|||||||
if (!debug && log_init(logfile) < 0)
|
if (!debug && log_init(logfile) < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
log_print(LOG_EVERYTIME, "bcastfwd restarted (pid:%d) ", getpid());
|
log_print(LOG_EVERYTIME, PROGNAME" restarted (pid:%d) ", getpid());
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
0
qnapd.conf
Normal file
0
qnapd.conf
Normal file
Loading…
Reference in New Issue
Block a user