SliTaz SliTaz Forum

You are not logged in.

#1 2013-07-01 02:31:47

Darjeeling
Member
Registered: 2012-02-06
Posts: 210

Problem with the busybox version of wget

I have written a short script which checks whether a new hosts file is available. If it is, the new hosts file is downloaded and copied to /etc. The script is automatically executed on each boot-up out of local.sh.

The script works well but my worry is that the boot procedure might hang forever if the server doesn't respond because the busybox version of wget doesn't seem to have a timeout parameter or a number-of-tries parameter. Does anyone have an idea what can be done about this?

Offline

#2 2013-07-01 03:33:05

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Problem with the busybox version of wget

Hi, Darjeeling,

busybox version of wget doesn't seem to have a timeout parameter

No. This feature is 2 years old in the busybox. See commit from busybox developer introducing this. See 'wget --help' output in the terminal:

[c]tux@slitaz:~$ wget --help

Command line: wget --help

BusyBox v1.18.4 (2012-03-14 03:32:25 CET) multi-call binary.

Usage: wget [-c|--continue] [-s|--spider] [-q|--quiet] [-O|--output-document FILE]
    [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]
    [--no-check-certificate] [-U|--user-agent AGENT][-T SEC]  URL

Retrieve files via HTTP or FTP

Options:
    -s    Spider mode - only check file existence
    -c    Continue retrieval of aborted transfer
    -q    Quiet
    -P DIR    Save to DIR (default .)
    -T SEC    Network read timeout is SEC seconds    <--- Here
    -O FILE    Save to FILE ('-' for stdout)
    -U STR    Use STR for User-Agent header
    -Y    Use proxy ('on' or 'off')[/c]

Offline

#3 2013-07-01 10:17:00

Darjeeling
Member
Registered: 2012-02-06
Posts: 210

Re: Problem with the busybox version of wget

Thanks for your reply, Aleksej. I'm still using Slitaz 3.0, which comes with BusyBox v1.12.0, and it's strange that it didn't even occur to me to look whether there was a later version in Slitaz 4.0. Stupid me. I think the disadvantages of continuing with Slitaz 3.0 are becoming too numerous and the time has finally come to upgrade to Slitaz 4.0. I'll be more than a year late to the party. But better late than never ...

Offline

#4 2013-07-01 10:53:59

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Problem with the busybox version of wget

Not stupid smile

It's always a problem to me to switch to new release. I need to leave my handy environment and to start all the things from scratch...

Maybe, all you need is just download new busybox from pkgs.slitaz.org and install it. And you need one more system to roll busybox back in the case if you'll broke your 3.0 installation.

Offline

#5 2013-07-01 14:11:26

Darjeeling
Member
Registered: 2012-02-06
Posts: 210

Re: Problem with the busybox version of wget

> Maybe, all you need is just download new busybox

> from pkgs.slitaz.org and install it.

I tried this and got some funny warning messages that I didn't like ...

grep: bad regex '^/usr/bin/[$': Unmatched [ or [^

grep: bad regex '^/usr/bin/[$': Unmatched [ or [^

grep: bad regex '^/usr/bin/[[$': Unmatched [ or [^

grep: bad regex '^/usr/bin/[[$': Unmatched [ or [^

Keep installed GNU utilities ?

Although I have added, removed and changed tons of things since I first tried out the original Slitaz 3.0 Live CD, I think it's best if I keep my hands off the kernel, busybox, gtk, core libraries and stuff like this.

> It's always a problem to me to switch to new release.

Same here. I'm so used to the customized Slitaz 3.0 Live CD I've been working on over the past 3 years that I can't imagine ever going back to a 'properly installed' Gnu/Linux distro. What began as a temporary fix when our hard drive died has evolved into the super stable, super fast, secure and very comfortable operating system that we've been using every day since 2010. And the best thing about it is that it survives even the most outrageous experiments without any penalty because I'm always just a re-boot away from a pristine os. Not bad, hu?! Of course there's a lack of flexibility, which is a bit of a disadvantage. But I can live with this. I've got persistence for important files and folders, and during boot-up the system copies certain files from the hard drive to make changes a little easier. If a new CD should become necessary, there's a long script that does the job in 16-17 minutes including burning and reboot, which is good enough for me.

In a few days I'll have a bit of time to myself. Hopefully I will be able to make all of this work on top of Slitaz 4.0.

Offline

#6 2013-07-01 15:18:51

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: Problem with the busybox version of wget

I'd say just install 4's grep and 3's coreutils-conditions and wget packages because Busybox isn't creating the symlinks it's using in 4.

Offline

#7 2013-07-05 16:03:19

Darjeeling
Member
Registered: 2012-02-06
Posts: 210

Re: Problem with the busybox version of wget

Sorry for the late reply, Trixar. I was busy elsewhere. Last night I have tried out what you suggested and found that the full version of wget (v1.12) works well in Slitaz 3. It does exactly what one would expect with regards to the number of tries and the timeout. I tested it on the favicon of one of the many websites that for inexplicable reasons cannot be accessed here in France (http://www.enjoythemusic.com/favicon.ico). I hope the busybox version of wget will behave just the same when I have upgraded to Slitaz 4.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.019 seconds, 7 queries executed - Memory usage: 1.55 MiB (Peak: 1.77 MiB) ]