aboutsummaryrefslogtreecommitdiff
path: root/init/init.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* usage bb_dev_nullvodz2005-10-121-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11846 69ca8d6d-28ef-0310-b511-8ec308f3f277
* don't out \r to syslogvodz2005-09-291-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11692 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Why have a separate CONFIG_INIT_SWAPON when we already have CONFIG_SWAPONOFF?landley2005-08-301-64/+14
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11291 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Bug system entry #1 says that when busybox doesn't have swapoff,landley2005-08-301-3/+1
| | | | | | | init shouldn't call swapoff. git-svn-id: svn://busybox.net/trunk/busybox@11290 69ca8d6d-28ef-0310-b511-8ec308f3f277
* applying patch from bug 24:pgf2005-08-011-0/+7
| | | | | | | | 0000024 03-16-05 patch: allow init to set controlling tty git-svn-id: svn://busybox.net/trunk/busybox@11007 69ca8d6d-28ef-0310-b511-8ec308f3f277
* move var decls around a little to help gcc make smaller codevapier2005-07-061-8/+8
| | | | git-svn-id: svn://busybox.net/trunk/busybox@10723 69ca8d6d-28ef-0310-b511-8ec308f3f277
* 2005-07-04 Shaun Jackman <sjackman@gmail.com>vapier2005-07-061-3/+2
| | | | | | | | | * init/init.c: Do not include sys/mount.h. (message): Use O_NONBLOCK instead of O_NDELAY. (console_init): Ditto. git-svn-id: svn://busybox.net/trunk/busybox@10722 69ca8d6d-28ef-0310-b511-8ec308f3f277
* 2005-07-05 Shaun Jackman <sjackman@gmail.com>vapier2005-07-061-0/+6
| | | | | | | | | * init/Config.in (CONFIG_FEATURE_INIT_SWAPON): New option. * init/init.c (check_memory): Disable the swapon feature unless CONFIG_FEATURE_INIT_SWAPON is defined. git-svn-id: svn://busybox.net/trunk/busybox@10721 69ca8d6d-28ef-0310-b511-8ec308f3f277
* rename log var to log_console so we dont override internal gcc/glibc log funcvapier2005-07-051-5/+5
| | | | git-svn-id: svn://busybox.net/trunk/busybox@10716 69ca8d6d-28ef-0310-b511-8ec308f3f277
* jfb2 writes in Bug 119:vapier2005-04-161-0/+4
| | | | | | | | | | | | | | | The init applet will restart (re-exec) itsself when it receives a SIGHUP. However, just before it enters its main loop, it resets SIGHUP to either re-load the inittab (or ignore it if no inittab is used). Thus preventing the re-exec option from being triggerable. This patch adds a signal handler for SIGQUIT for init that always causes init to re-exec itsself (along with killing anything else that might be still running). git-svn-id: svn://busybox.net/trunk/busybox@10120 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Hiroshi Ito writes:andersen2004-10-081-5/+31
| | | | | | | | | | | | | | | | | | | | | | | Hello, all. Busybox init does not handle removed inittab entry correctly. # I'm sorry about my poor english, but you can find # what I would like to say from patch, isn't it? even if you apply this path, when yoy try to change a command line option in inittab, you have to do following steps. 1. remove old line from initrd 2. send HUP signal to init 3. kill old proces which is invoked from init. 4. append new line to inittab 5. send HUP signal to init, again patch is against current CVS + last patch witch I send it last. git-svn-id: svn://busybox.net/trunk/busybox@9327 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Hiroshi Ito writes:andersen2004-10-081-4/+5
| | | | | | | | | | "kill -HUP 1" reloads inittab, and when I append one line to inittab and send HUP signal two times, It will starts 2 process. patch against current CVS is attached. git-svn-id: svn://busybox.net/trunk/busybox@9326 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Do not use vfork, as init is not vfork safe. Do not allowandersen2004-08-161-4/+2
| | | | | | | askfirst when mmuless. git-svn-id: svn://busybox.net/trunk/busybox@9102 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Bastian Blank:andersen2004-06-221-1/+3
| | | | | | | | | | | | | | On Sat, Jun 19, 2004 at 10:57:37PM +0200, Bastian Blank wrote: > The following patch changes klogd to use openlog/syslog themself > instead of calling syslog_msg which always calls the triple > openlog/syslog/closelog. Updated patch: get rid of syslog_msg entirely. Request from Erik Andersen. Bastian git-svn-id: svn://busybox.net/trunk/busybox@8913 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Silly meandersen2004-04-121-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8741 69ca8d6d-28ef-0310-b511-8ec308f3f277
* As reported by Quy Tonthat, init has problems with inittab's thatandersen2004-04-121-8/+1
| | | | | | | | contain only actions sysinit/wait/once. It does not clean up zombies in that case. git-svn-id: svn://busybox.net/trunk/busybox@8740 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Jamie Guinan writes:andersen2004-04-121-3/+3
| | | | | | | | | | | | | | It looks like latest uClibc defines ARCH_HAS_MMU, but a few busybox files test UCLIBC_HAS_MMU, resulting in vfork() getting called instead of fork(), etc. Patch below. Only tested for lash. Cheers, -Jamie git-svn-id: svn://busybox.net/trunk/busybox@8738 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Remove trailing whitespace. Update copyright to include 2004.andersen2004-03-151-16/+16
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8630 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch by Guillaume Morinbug12003-09-261-5/+13
| | | | | | | | Fix two race conditions, as described at. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=212764 git-svn-id: svn://busybox.net/trunk/busybox@7567 69ca8d6d-28ef-0310-b511-8ec308f3f277
* comparison was always false due to limited range of data types.andersen2003-09-151-1/+1
| | | | | | | | Carefully cast to unsigned long long prior to multiply to get the expected result. git-svn-id: svn://busybox.net/trunk/busybox@7523 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Update definition of struct serial_struct, per linux-2.6.0-test5,andersen2003-09-111-14/+19
| | | | | | | | | to avoid stack corruption problems on some 64bit architectures when sizeof(void*) != sizeof(int). Thanks to Atsushi Nemoto for finding this problem. git-svn-id: svn://busybox.net/trunk/busybox@7464 69ca8d6d-28ef-0310-b511-8ec308f3f277
* more crond+crontab integrating with loginutil libbb functions and deletedbug12003-09-031-8/+0
| | | | | | | | patch from Thomas Gleixner to init. Viodz last_patch_108 git-svn-id: svn://busybox.net/trunk/busybox@7377 69ca8d6d-28ef-0310-b511-8ec308f3f277
* move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as onebug12003-09-021-10/+8
| | | | | | | | constant. Vodz last_patch_107 git-svn-id: svn://busybox.net/trunk/busybox@7365 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix overflow for machines greater than 4GB, return unsigned int to avoidbug12003-08-261-5/+6
| | | | | | | a cast and for greater accuracy. git-svn-id: svn://busybox.net/trunk/busybox@7260 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Yang Xiaopeng writes:andersen2003-07-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | >I'm sure that no user process use old root now, but when run "umount >/old_root", it says: > umount: /old_root: Device or resource busy > >I have tried to remount /proc within the new root *after* chroot, but >get the same result. > > I found the problem, I said that no user process use old root when run my scripts, but I'm wrong, actually there is a '3' fd open the file "/old_root/dev/console". By adding debug message in init/init.c, I found the problem: when init restart(in exec_signal()), before open the new terminal device, there is still a file opened(I don't know which file it is), so the terminal device(stdin) get fd '1', and the first dup(0)(stdout) return '2', the second(stderr) return '3'. I attach a simple patch to solve this problem. git-svn-id: svn://busybox.net/trunk/busybox@7128 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Thomas Gleixner to reap any zombie processes that areandersen2003-07-261-0/+8
| | | | | | | reparented to init... git-svn-id: svn://busybox.net/trunk/busybox@7106 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Andrew Flegg:andersen2003-07-221-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | Here's a pretty crude patch to reload /etc/inittab when init receives a SIGHUP. The mailing list archives weren't entirely clear on whether or not it should already happen, but didn't appear to be. The patch: * Adds a new function, reload_signal() which just calls parse_inittab() and run_actions(RESPAWN) * Before entering the while (1) loop set up SIGHUP to call reload_signal() * Modify new_init_action to skip the action if the same command already exists on the same terminal This last bit means that changing already running entries is a bit hairy as you can end up with, for example, two shells running on the same virtual console. However, for solely adding/removing entries this patch seems to work quite well. git-svn-id: svn://busybox.net/trunk/busybox@7092 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Remove remaining libc5 support codeandersen2003-07-221-7/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@7090 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Update a bunch of docs. Run a script to update my email addr.andersen2003-07-141-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@7061 69ca8d6d-28ef-0310-b511-8ec308f3f277
* oopsandersen2003-07-051-0/+3
| | | | git-svn-id: svn://busybox.net/trunk/busybox@7042 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Daniel writes:andersen2003-07-051-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've found a problem with job control when the init process is restarted. If the system boots for the first time, I get job control on a serial terminal - no problems. However, when I restart init by issuing "init -q", then the shell no longer has job control. I traced this a problem in console_init in the file init.c. What was happening after the restart is that the first compare if (ioctl(0, TIOCGSERIAL, &sr) == 0) { ... } else if (ioctl(0, VT_GETSTATE, &vt) == 0) { ... } else { ... // assume /dev/console } returned error and subsequently the code assumes /dev/console as the console, which does not support job control. Checking the errno after the first call showed that the system was complaining about the file descriptor. This is probably because the previous init process had closed all its file descriptors which the new init process had inherited. git-svn-id: svn://busybox.net/trunk/busybox@7041 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Apply last_patch93 from vodz:andersen2003-06-271-14/+6
| | | | | | | | | | | | | | | | andersen@busybox.net wrote: >Message: 4 >Modified Files: > init.c >Log Message: >Remove code for unsupported kernel versions Hmm. Current init.c have check >= 2.2.0 kernel one time too. Ok. Last patch removed this point and move common init code to new file for /init dir git-svn-id: svn://busybox.net/trunk/busybox@7008 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Remove bdflush garbage, which is only relevant to unsupportedandersen2003-06-271-11/+0
| | | | | | | kernel versions git-svn-id: svn://busybox.net/trunk/busybox@6988 69ca8d6d-28ef-0310-b511-8ec308f3f277
* There have been many reports of init failing to reboot and/or failing to haltandersen2003-04-241-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | over the years. Well I finally took the time to track this down. It turns out that inside linux/kernel/sys.c the kernel will call machine_halt(); do_exit(0); when halting, or will call machine_power_off(); do_exit(0); during a reboot. Unlike sysv init, we call reboot from within the init process, so if the call to machine_halt() or machine_power_off() returns, the call to do_exit(0) will cause the kernel to panic. Which is a very bad thing to happen. So I just added this little patch to fork and call the reboot syscall from within the forked child process, thereby neatly avoiding the problem. But IMHO, both calls to do_exit(0) within linux/kernel/sys.c are bugs and should be fixed. -Erik git-svn-id: svn://busybox.net/trunk/busybox@6808 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Major coreutils update.mjn32003-03-191-13/+13
| | | | git-svn-id: svn://busybox.net/trunk/busybox@6751 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix a silly compile error, thanks to a patch from Wen-chien Jesse Sungandersen2003-01-231-2/+4
| | | | git-svn-id: svn://busybox.net/trunk/busybox@6434 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Correct some init issues, update email address, last_patch78 by Vladimirbug12003-01-131-175/+158
| | | | | | | N. Oleynik git-svn-id: svn://busybox.net/trunk/busybox@6323 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Odd. I never brought this forward from bb.stable. Should handleandersen2002-12-171-1/+3
| | | | | | | | reaping child processes better. -Erik git-svn-id: svn://busybox.net/trunk/busybox@6223 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use error_msg instead of fprintf(stderrbug12002-11-281-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@6044 69ca8d6d-28ef-0310-b511-8ec308f3f277
* I committed the fflush in the wrong spot. I should go to bedandersen2002-10-221-1/+1
| | | | | | | | earlier so I don't screw up such easy stuff. -Erik git-svn-id: svn://busybox.net/trunk/busybox@5687 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Be absurdly careful about flushing stdout.andersen2002-10-221-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@5683 69ca8d6d-28ef-0310-b511-8ec308f3f277
* After thinking about it, I think this patch from Matt Kraai is probably theandersen2002-10-121-13/+3
| | | | | | | | | | | best way to go. Sysvinit does not provide a controlling tty since it doesn't even try to open ttys for apps. We do. So we should _try_ to provide a controlling tty if possible, but we needn't freak out if it doesn't work. This way we won't need to use openvt or similar, we'll just have init do the Right Thing(tm). git-svn-id: svn://busybox.net/trunk/busybox@5642 69ca8d6d-28ef-0310-b511-8ec308f3f277
* last_patch61 from vodz:andersen2002-10-101-4/+3
| | | | | | | | | | | | New complex patch for decrease size devel version. Requires previous patch. Also removed small problems from dutmp and tar applets. Also includes vodz' last_patch61_2: Last patch correcting comment for #endif and more integrated with libbb (very reduce size if used "cat" applet also). Requires last_patch61 for modutils/config.in. git-svn-id: svn://busybox.net/trunk/busybox@5640 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Set the close-on-exec flag, just to be safandersen2002-09-301-0/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@5607 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Ignoring SIGCHLD causes a race leading to the occasional hang of initandersen2002-09-251-1/+0
| | | | | | | | | when init will wait() on itself in waitfor() when the child exits before init is scheduled to run. Letting init hang is very seriously bad. -Erik git-svn-id: svn://busybox.net/trunk/busybox@5592 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Let people run SHUTDOWN actions prior to killing everythingandersen2002-09-161-3/+5
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@5500 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Thomas Gleixner <tglx@linutronix.de> to doandersen2002-09-121-0/+1
| | | | | | | automatic child reaping to avoid zombies git-svn-id: svn://busybox.net/trunk/busybox@5483 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Eliminate use of obsolete sys_errlist[]andersen2002-08-261-1/+1
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@5395 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Run through indent, fix commentsbug12002-08-221-126/+139
| | | | git-svn-id: svn://busybox.net/trunk/busybox@5340 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Kill a silly warningandersen2002-07-291-0/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@5114 69ca8d6d-28ef-0310-b511-8ec308f3f277