The behaviour introduced by commit 31c765081d ("watchdog: stop
watchdog first on startup") causes warnings in the kernel log when the
nowayout feature is enabled:
[ 16.212184] watchdog: watchdog0: nowayout prevents watchdog being stopped!
[ 16.212196] watchdog: watchdog0: watchdog did not stop!
The latter may also appear by itself in case the watchdog is of the
type that cannot be stopped once started (e.g. the common
always-running gpio_wdt kind).
These warnings can be somewhat ominous and distracting, so allow
configuring whether to use this open-write-close-open sequence rather
than just open. Also saves a bit of .text when disabled:
function old new delta
shutdown_on_signal 31 58 +27
watchdog_main 339 306 -33
shutdown_watchdog 34 - -34
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 27/-67) Total: -40 bytes
Make it default n:
- It's a workaround for one specific type of watchdog (and
that seems to be a defect in the kernel driver)
- Even when not enabled in busybox config, it can easily be
implemented outside busybox
- Code size
- Commit 31c765081d should be considered a regression for all the
boards that now end up with KERN_CRIT warnings in dmesg.
- The author of that commit said "This use case is evidently rare, so
if it is indeed causing problems for other people I'd OK then I
understand whatever needs to be done." in the v1 thread.
Cc: Matt Spinler <mspinler@linux.vnet.ibm.com>
Cc: deweloper@wp.pl
Cc: tito <farmatito@tiscali.it>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
PLATFORM_LINUX is a hidden configuration option which is disabled by
default and enabled at over a hundred locations for features that are
deemed to be Linux specific.
The only effect of PLATFORM_LINUX is to control compilation of
libbb/match_fstype.c. This file is only needed by mount and umount.
Remove all references to PLATFORM_LINUX and compile match_fstype.c
if mount or umount is enabled.
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Some watchdog implementations may do things other than issue
a reboot on a watchdog timeout. In this case, there's the
possibility of restarting this program from the state of
the watchdog device not being properly stopped (done by writing
a 'V' and closing the device). Since it wasn't stopped, the
driver may not be able to restart the watchdog when this program
reopens it and starts pinging it.
To fix this, the code will always first issue the stop when it
starts up.
function old new delta
shutdown_on_signal - 32 +32
watchdog_main 268 298 +30
shutdown_watchdog - 25 +25
watchdog_shutdown 41 - -41
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 1/0 up/down: 87/-41) Total: 46 bytes
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
We set a default path for the directory where pidfiles are create
when FEATURE_PIDFILE is selected. The default has no effect on
applets which must specify a pidfile path on the command line to
run, and it can be overridden by applets which optionally allow
the user to specify the pidfile path.
We also add pidfile write/remove support for klogd, ntpd and watchdog.
For syslogd, we add a missing remove_pidfile() for better cleanup
on daemon exit.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
While at it, make ESC sequences more readable; and removed check for
isatty(stdin) in reset. Code shrink:
text data bss dec hex filename
884771 936 17216 902923 dc70b busybox_old
884723 936 17216 902875 dc6db busybox_unstripped
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This change retains "or later" state! No licensing _changes_ here,
only form is adjusted (article, space between "GPL" and "v2" and so on).
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
It is impossible to formulate sane ABI based on
size of ulong because it can be 32-bit or 64-bit.
Basically it means that you cannot portably use
more that 32 option chars in one call anyway...
Make it explicit.
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes... General cleanup pass. What I've
been doing for the last couple days.
And it conflicts! I've removed httpd.c from this checkin due to somebody else
touching that file. It builds for me. I have to catch a bus. (Now you know
why I'm looking forward to Mercurial.)