From d6efe85a578e701302e5e5308d1d46aa8030bc87 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 9 Feb 2015 00:57:21 +0100 Subject: [PATCH] Silence launch of inetd services. Signed-off-by: Joachim Nilsson --- helpers.h | 1 + svc.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/helpers.h b/helpers.h index 3d1f639b..ab2fe468 100644 --- a/helpers.h +++ b/helpers.h @@ -36,6 +36,7 @@ } #define FLOG_DEBUG(fmt, args...) DO_LOG(LOG_DEBUG, fmt, ##args) +#define FLOG_INFO(fmt, args...) DO_LOG(LOG_INFO, fmt, ##args) #define FLOG_WARN(fmt, args...) DO_LOG(LOG_WARNING, fmt, ##args) #define FLOG_ERROR(fmt, args...) DO_LOG(LOG_CRIT, fmt, ##args) #define FLOG_PERROR(fmt, args...) DO_LOG(LOG_CRIT, fmt ". Error %d: %s", ##args, errno, strerror(errno)) diff --git a/svc.c b/svc.c index ab048d2b..7d936d0b 100644 --- a/svc.c +++ b/svc.c @@ -521,9 +521,10 @@ int svc_start(svc_t *svc) _d("New client socket %d accepted for inetd service %d/tcp", sd, svc->port); } - } - if (SVC_CMD_SERVICE != svc->type) + FLOG_INFO("Starting inetd service %s ...", svc->service); + } + else if (SVC_CMD_SERVICE != svc->type) print_desc("", svc->desc); else if (!respawn) print_desc("Starting ", svc->desc); @@ -594,10 +595,11 @@ int svc_start(svc_t *svc) } svc->pid = pid; - if (SVC_CMD_INETD == svc->type && svc->sock_type == SOCK_STREAM) - close(sd); - - if (SVC_CMD_RUN == svc->type) + if (SVC_CMD_INETD == svc->type) { + if (svc->sock_type == SOCK_STREAM) + close(sd); + } + else if (SVC_CMD_RUN == svc->type) print_result(WEXITSTATUS(complete(svc->cmd, pid))); else if (!respawn) print_result(svc->pid > 1 ? 0 : 1);