[BusyBox] awk problem with freeswan

Denis Vlasenko vda at port.imtp.ilyichevsk.odessa.ua
Mon Jul 12 15:24:17 UTC 2004


> > > Right now I'm using gawk in my little "busybox as part of a development
> > > environment" distro.  (Which I'm almost ready to use on a server,
> > > except that it doesn't have an ftp client, an ssh client, a shutdown
> > > command...) Several ./configure and build scripts rely fairly heavily
> > > on awk, and they all go "boing" with the busybox version...
> >
> > Why do you need 'shutdown'?
>
> Because "shutdown" is the command I've been using ever since the days of
> Sun and AIX boxes, because existing scripts use it, and because half the
> "reboot" and "halt" commands I've seen bypass init instead of signaling
> init to do it so init can shut down the daemons and such properly?
>
> Apparently, shutdown is not part of SuSv3, but neither are "reboot" or
> "halt". For that matter, neither is "init".  According to SuS, compliant
> machines emerge fully running from zeus's forehead and never reboot ever.
>
> > You can shut system down with simple
> > shell scripts and one tiny helper which executes reset or poweroff
> > syscall.
>
> Yes.  And the existing scripts call the "shutdown" command, as do I.  I
> could write a small C program to call reboot(0x01234567) or
> reboot(0x4321fedc) as needed, or send the appropriate signals to PID 1, or
> diddle with the strange socket that sysvinit wants to create and be
> controlled through.  But I don't want to.
>
> Yes, I probably will make a wrapper script for shutdown ala the one that
> calls yacc and lex.  (I wasn't calling for the need to shoehorn "ssh" into
> busybox either.  I'm just saying that the system I have is missing pieces. 
> Going "ha, you don't need that" is unhelpful.  I don't _need_ the whole
> system, I could just go read a book...)  On the other hand, considering
> that the way reboot and halt are supposed to work varies depending on
> whether or not you've compiled in "init", and that adding shutdown isn't
> actually much code considering the functionality's already there (and it's
> something you could tell the configuration not to compile...)

Ah, I see it now. We have a misunderstanding here.

I do not say that you shouldn't have 'shutdown','halt' commands etc.
I say that those commands can be perfectly written in sh. You
do not need to write busybox applet for that.

busybox needs to have only a tiny 'hardshutdown' applet which
does the only thing not doable from sh: call shutdown syscall.

In 'shutdown' script, after you are done with killing processes and
unmounting filesystems, etc, you just call bb's hardshutdown.

I will attach my in-house version of these scripts.
Note that they are hardwired to be in /app/shutdown-0.0.6
directory, grep for that string and modify as you need.

Install:
symlink /app/shutdown-0.0.6/sbin/* into /sbin.
Usage:
shutdown  -- kill/umount and do nothing forever
shutdown -r -- kill/umount adn execute reboot syscall
shutdown -h -- kill/umount adn execute halt syscall
	(this is typically the same as shutdown without options,
	maybe other arches drop in firmware monitor ot something
	like that on halt, but not x86)
shutdown -p -- kill/umount adn execute poweroff syscall
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shutdown-0.0.6.tar.gz
Type: application/x-tgz
Size: 7919 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20040712/ea261c3e/attachment.bin 


More information about the busybox mailing list