On Thursday 15 July 2004 17:14, Donald Teed wrote:
There is no shutdown command in busybox. I don't
know if
a statically compiled one from some other Linux would
do the same job. I doubt it would match the needs
of the busybox/isolinux environment.
Our notebooks have 512 MB of RAM on board, and one
curious feature of udpcast imaging is that the udpcast sender
is disconnected when there is still about 5 GB of disk
to be written on the client/receiver. It continues
writing from highly compressed zeros in RAM.
I joked with the production manager that if I got shutdown
to work, they could pack up the notebooks as soon as the
server disconnected and have them finish writing
from memory to disk while packed up on the shelf.
That could save about 5 minutes from the 30 minute job of
writing a 40 GB drive.
The postinstall script udpreceiver.post is only executed once
udpreceiver has completed, so this can indeed be done.
So, if you just put the following inside, it should work:
#!/bin/sh
sync
sync
echo 5 >/proc/acpi/sleep
The syncs should not even be necessary, as udpreceiver already writes
the file in synchronous mode (O_SYNC flag).
[This is, as long as the echo 5 >/proc/acpi/sleep works. I tried that
on my desktop, but unfortunately it didn't do anything at all. Maybe
on a laptop, it does indeed shut down the machine, or put it to sleep]
I guess my concern is for any few seconds of timing
that
might be required for the disk cache to finish writing.
O_SYNC mode and the sync commands should take care of that.
I recall there was a Windows there was a patch to
deal
with allowing for the larger disk cache to do this on
Windows shutdown. I don't know if "sleep 5" would do
the same or it needs 10, 15 or whatever.
--Donald Teed
Or do a sync, followed by the sleep, and another sync to be really
sure.
Alain