[BusyBox] Re: [uClibc] minit and msvc

Allan Clark allanc at chickenandporn.com
Thu Feb 12 23:33:55 UTC 2004


Peter S. Mazinger wrote:

>On Thu, 12 Feb 2004, Allan Clark wrote:
>  
>
>>Peter S. Mazinger wrote:
>>    
>>
>>>from the commandline, but if I use a simple shell script as
>>    
>>
>>>/etc/minit/ctrlaltdel/run, like:
>>>
>>>#!/bin/sh
>>>
>>>/bin/msvc -d dropbear (or /etc/minit/dropbear), and press 
>>><CTRL>-<ALT>-<DEL>, this hangs. I see the run script and msvc -d 
>>>dropbear in the process list. The service is not important that has to be 
>>>stopped, it happens also on getty/mingetty/syslogd/klogd.
>>>
>>>The shell used does not matter, I have tried bash/busybox ash/busybox msh.
>>>      
>>>
>>[...]
>>
>>Is it worth investigating whether your "msvc -d dropbear" is waiting for 
>>a response from minit, while minit is waiting for the script to complete 
>>before it services more requests (including the script's request)?
>>    
>>
>
>Well, then I'll ask it the other way. How should I stop respawning 
>services if msvc can't be used?
>  
>
If you're into hacking minit, you could cause msvc to be really a method 
of dropping a "stop dropbear" command into a named pipe; this way, the 
pipe can be read from with a blocking read, or minit could respond to 
signals (SIGCHLD, etc) as they arrive.  New additions to the named pipe 
(ie msvc commands) while responding to an event (either a named-pipe 
command or a signal, such as C-A-D) get buffered by the OS until minit 
is ready to read again.  I'm sure there would be a limit to the number 
of "commands" one could queue in this pipe, but it's probably 
greater-than-zero.

You could also do something yourself: make a pipe-reader that executes 
msvc commands, blocking read on the pipe, and instead of executing msvc 
commands, drop text commands into the pipe.  minit can start/run this 
daemon for you :)  This would allow you to do a functional test -- test 
whether I'm speaking from crackpipe dreams -- before touching minit code 
and proposing a patch.

>A "hacked" solution would be to list all of these, remember them, remove 
>the respawn file from their config-dir, kill the service, and readd 
>respawn
>  
>
Yeah, or make the OS queue up the "remembering" for you.

Mileage may vary on different descendents of Unix(-like) OSes...

Allan



More information about the busybox mailing list