Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue on small systems which use tail from busybox #7

Open
ThomasD13 opened this issue Sep 22, 2022 · 3 comments
Open

Issue on small systems which use tail from busybox #7

ThomasD13 opened this issue Sep 22, 2022 · 3 comments

Comments

@ThomasD13
Copy link

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

@folkertvanheusden
Copy link
Owner

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

@ThomasD13
Copy link
Author

ThomasD13 commented Sep 26, 2022

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

@folkertvanheusden
Copy link
Owner

"linux" is set by the preprocessor I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants