rc does not need SIGCHLD handler. Also, always return 0 in /etc/rc as non zero for default may freeze system.
This commit is contained in:
parent
3c7c1736b7
commit
89ac4eee26
10
etc.BSD/rc
10
etc.BSD/rc
@ -11,4 +11,12 @@
|
||||
|
||||
RUNLEVEL="1" /sbin/rc sysinit || exit 1
|
||||
RUNLEVEL="1" /sbin/rc boot || exit 1
|
||||
/sbin/rc default || exit 1
|
||||
PREVLEVEL="1" /sbin/rc default
|
||||
|
||||
# If we return non zero after starting rc then 2 things may happen
|
||||
# 1) We get the message "init: can't get /dev/console for controlling terminal"
|
||||
# every few seconds
|
||||
# 2) We get no error and console freezes.
|
||||
# This is probably a bug somewhere in rc, but until that is fixed we have to
|
||||
# return 0.
|
||||
exit 0
|
||||
|
16
src/rc.c
16
src/rc.c
@ -458,26 +458,11 @@ static void wait_for_services ()
|
||||
|
||||
static void handle_signal (int sig)
|
||||
{
|
||||
pid_t pid;
|
||||
int status;
|
||||
int serrno = errno;
|
||||
char signame[10] = { '\0' };
|
||||
|
||||
switch (sig)
|
||||
{
|
||||
case SIGCHLD:
|
||||
do
|
||||
{
|
||||
pid = waitpid (-1, &status, WNOHANG);
|
||||
if (pid < 0)
|
||||
{
|
||||
if (errno && errno != ECHILD)
|
||||
eerror ("waitpid: %s", strerror (errno));
|
||||
return;
|
||||
}
|
||||
} while (! WIFEXITED (status) && ! WIFSIGNALED (status));
|
||||
break;
|
||||
|
||||
case SIGINT:
|
||||
if (! signame[0])
|
||||
snprintf (signame, sizeof (signame), "SIGINT");
|
||||
@ -557,7 +542,6 @@ int main (int argc, char **argv)
|
||||
signal (SIGINT, handle_signal);
|
||||
signal (SIGQUIT, handle_signal);
|
||||
signal (SIGTERM, handle_signal);
|
||||
signal (SIGCHLD, handle_signal);
|
||||
|
||||
/* Ensure our environment is pure
|
||||
Also, add our configuration to it */
|
||||
|
Loading…
Reference in New Issue
Block a user