NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

powerd script failure



I was using a simple script which I wrote long ago to let sleep my
machine by power button through powerd(9), but recently I decided to
use the standard /etc/powerd/scripts/sleep_button script.

So I copied sleep_button script file to power_button and pressed power
button, and found that it fails weird way.  The machine suspends, but
when resuming, default network route is not set.  After tracking the
behavior by sprinkling debug messages, I found /etc/rc.d/networks is
failing after this line:
                echo -n 'Configuring network interfaces:'
In fact, the script exits with exit code 141 upon any use of "echo -n"
in the script.  Simple "echo" doesn't have problem, but "echo -n"
fails.  And if I replace "echo -n" with "/bin/echo -n", script works
without problem.

Since /etc/rc.d/network works without problem when cold-booting the
machine or when called from command line, I guess it has something to
do with the environment setting specific to powerd(8).  It occured
5.99.55 and persisted after upgrade to 6.0_BETA (by build.sh
install=/, so something I did wrong might be left as is from older
system).

I haven't investigated further since the script works now for me,
though I don't know the root cause.  Any clues?  I'll file a pr if I'm
not missing something obvious.


                                                FUKUMOTO Atsushi
                                                fukumoto%imasy.or.jp@localhost


Home | Main Index | Thread Index | Old Index