mirror of
https://github.com/troglobit/finit.git
synced 2026-11-08 16:11:10 +00:00
initctl: primarily check for /var/log/syslog, fallback to messages
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
56eb2c6b21
commit
72a0ba6a55
1 file changed
+2
-2
+2
-2
@@ -115,13 +115,13 @@ static int toggle_debug(char *arg)
|
|||||||
static int do_log(char *svc)
|
static int do_log(char *svc)
|
||||||
{
|
{
|
||||||
char cmd[128];
|
char cmd[128];
|
||||||
char *logfile = "/var/log/messages";
|
char *logfile = "/var/log/syslog";
|
||||||
|
|
||||||
if (!svc || !svc[0])
|
if (!svc || !svc[0])
|
||||||
svc = "finit";
|
svc = "finit";
|
||||||
|
|
||||||
if (!fexist(logfile))
|
if (!fexist(logfile))
|
||||||
logfile = "/var/log/syslog";
|
logfile = "/var/log/messages";
|
||||||
|
|
||||||
snprintf(cmd, sizeof(cmd), "cat %s | grep %s | tail -10", logfile, svc);
|
snprintf(cmd, sizeof(cmd), "cat %s | grep %s | tail -10", logfile, svc);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user