multitail icon indicating copy to clipboard operation
multitail copied to clipboard

Issue on small systems which use tail from busybox

Open ThomasD13 opened this issue 2 years ago • 3 comments

Hi guys,

I ported/created package for ARM Aarch64 v8, and would like to use it on slim linux systems which only have busybox. (embedded devices)

The issue here is, that tail from busybox does not know the --follow=name argument. Indeed it uses -f/-F for that.

I fixed this issue for me (quick & dirty) by patching this:

Date: Thu, 22 Sep 2022 10:14:09 +0200
Subject: [PATCH] Replaced tail argument --follow=name to -f, since the tail
 from busybox does not support --follow=name

---
 exec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/exec.c b/exec.c
index 9cc2de7..ae18aed 100644
--- a/exec.c
+++ b/exec.c
@@ -83,7 +83,7 @@ int start_tail(char *filename, char retry_open, char follow_filename, int initia
                if (follow_filename)
                {
 #if defined(linux) || defined(__CYGWIN__) || defined(__GNU__)
-                       pars[npars++] = "--follow=name";
+                       pars[npars++] = "-f";
 #elif defined(__OpenBSD__)
                        pars[npars++] = "-f";
 #else
@@ -99,7 +99,7 @@ int start_tail(char *filename, char retry_open, char follow_filename, int initia
                {
 #if !defined(linux) && !defined(__CYGWIN__) && !defined(__GNU__)
                        if (follow_filename && gnu_tail)
-                               pars[npars++] = "--follow=name";
+                               pars[npars++] = "-f";
 #endif
 
                        /* check the posix compliance level */

I think a cleaner solution would be to add a #if-else case for busybox case here. But I wanted to share this patch with you anyway, maybe you want to implement something similar.

Greetings

ThomasD13 avatar Sep 22 '22 08:09 ThomasD13

Thank you but I vaguely remember I used --follow=name for a reason. So a busybox specific fix would be preferred.

folkertvanheusden avatar Sep 22 '22 10:09 folkertvanheusden

I can open an MR with a specific "busybox" fix, when I get time for this. Just asking for curiosity: Where does the definition "linux" got set?

Best regards, Thomas

ThomasD13 avatar Sep 26 '22 06:09 ThomasD13

"linux" is set by the preprocessor I think

folkertvanheusden avatar Dec 17 '23 15:12 folkertvanheusden