Browse Source

Merge pull request #10667 from ysc3839/ttyd

ttyd: log to syslog
lilik-openwrt-22.03
Hannu Nyman 5 years ago
committed by GitHub
parent
commit
3ca455e79e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions
  1. +1
    -1
      utils/ttyd/Makefile
  2. +20
    -0
      utils/ttyd/patches/100-log-to-syslog.patch

+ 1
- 1
utils/ttyd/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ttyd
PKG_VERSION:=1.5.2
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/tsl0922/ttyd/tar.gz/$(PKG_VERSION)?


+ 20
- 0
utils/ttyd/patches/100-log-to-syslog.patch View File

@ -0,0 +1,20 @@
--- a/src/server.c
+++ b/src/server.c
@@ -6,6 +6,7 @@
#include <getopt.h>
#include <signal.h>
#include <sys/stat.h>
+#include <syslog.h>
#include <libwebsockets.h>
#include <json.h>
@@ -418,7 +419,8 @@ main(int argc, char **argv) {
return -1;
}
- lws_set_log_level(debug_level, NULL);
+ openlog("ttyd", LOG_NDELAY | LOG_PID, LOG_DAEMON);
+ lws_set_log_level(debug_level, lwsl_emit_syslog);
#if LWS_LIBRARY_VERSION_MAJOR >= 2
char server_hdr[128] = "";

Loading…
Cancel
Save