initctl: primarily check for /var/log/syslog, fallback to messages

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-02-11 22:32:12 +01:00
parent 56eb2c6b21
commit 72a0ba6a55
+2 -2
View File
@@ -115,13 +115,13 @@ static int toggle_debug(char *arg)
static int do_log(char *svc)
{
char cmd[128];
char *logfile = "/var/log/messages";
char *logfile = "/var/log/syslog";
if (!svc || !svc[0])
svc = "finit";
if (!fexist(logfile))
logfile = "/var/log/syslog";
logfile = "/var/log/messages";
snprintf(cmd, sizeof(cmd), "cat %s | grep %s | tail -10", logfile, svc);