diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-04-04 18:36:37 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-04-04 18:36:37 +0000 |
commit | 183da4ade108945f94117a633045cfd6f4ff813a (patch) | |
tree | 9f65c953b3c408fe5b9867c16bb958258465b56e | |
parent | 983b51b17bb36e5b77cb160abdfbcf9d25675dd9 (diff) | |
download | busybox-w32-183da4ade108945f94117a633045cfd6f4ff813a.tar.gz busybox-w32-183da4ade108945f94117a633045cfd6f4ff813a.tar.bz2 busybox-w32-183da4ade108945f94117a633045cfd6f4ff813a.zip |
Minor structural change to allow core dumping(or not) from init
-Erik
-rw-r--r-- | Changelog | 2 | ||||
-rw-r--r-- | busybox.def.h | 34 | ||||
-rw-r--r-- | init.c | 10 | ||||
-rw-r--r-- | init/init.c | 10 |
4 files changed, 35 insertions, 21 deletions
@@ -42,6 +42,7 @@ | |||
42 | the same, and prints an error (instead of endlessly looping). | 42 | the same, and prints an error (instead of endlessly looping). |
43 | - mv now attempts to do a rename, and will fall back to doing | 43 | - mv now attempts to do a rename, and will fall back to doing |
44 | a copy only if the rename fails. | 44 | a copy only if the rename fails. |
45 | - Syslogd now supports multiple concurrent connections | ||
45 | * Several fixes from Pavel Roskin <pavel_roskin@geocities.com>: | 46 | * Several fixes from Pavel Roskin <pavel_roskin@geocities.com>: |
46 | - Fixes to sort. Removed "-g", fixed and added "-r" | 47 | - Fixes to sort. Removed "-g", fixed and added "-r" |
47 | - Fixes to the makefile for handling "strip" | 48 | - Fixes to the makefile for handling "strip" |
@@ -56,6 +57,7 @@ | |||
56 | the common error handling saves a few bytes. Thanks to | 57 | the common error handling saves a few bytes. Thanks to |
57 | Bob Tinsley <bob@earthrise.demon.co.uk> for the patch. | 58 | Bob Tinsley <bob@earthrise.demon.co.uk> for the patch. |
58 | * Fix "+" parsing bug in date, from "Merle F. McClelland" <mfm@cts.com>. | 59 | * Fix "+" parsing bug in date, from "Merle F. McClelland" <mfm@cts.com>. |
60 | |||
59 | 61 | ||
60 | 62 | ||
61 | -Erik Andersen | 63 | -Erik Andersen |
diff --git a/busybox.def.h b/busybox.def.h index 53229ce1b..7b6d4e4ef 100644 --- a/busybox.def.h +++ b/busybox.def.h | |||
@@ -122,6 +122,12 @@ | |||
122 | // at the same time... | 122 | // at the same time... |
123 | #define BB_FEATURE_USE_PROCFS | 123 | #define BB_FEATURE_USE_PROCFS |
124 | // | 124 | // |
125 | // Enable full regular expressions. This adds about | ||
126 | // 4k. When this is off, things that would normally | ||
127 | // use regualr expressions (like grep) will just use | ||
128 | // normal strings. | ||
129 | #define BB_FEATURE_FULL_REGULAR_EXPRESSIONS | ||
130 | // | ||
125 | // Use termios to manipulate the screen ('more' is prettier with this on) | 131 | // Use termios to manipulate the screen ('more' is prettier with this on) |
126 | #define BB_FEATURE_USE_TERMIOS | 132 | #define BB_FEATURE_USE_TERMIOS |
127 | // | 133 | // |
@@ -146,6 +152,17 @@ | |||
146 | //Enable init being called as /linuxrc | 152 | //Enable init being called as /linuxrc |
147 | //#define BB_FEATURE_LINUXRC | 153 | //#define BB_FEATURE_LINUXRC |
148 | // | 154 | // |
155 | //Have init enable core dumping for child processed (for debugging only) | ||
156 | //#define BB_FEATURE_INIT_COREDUMPS | ||
157 | // | ||
158 | // Allow init to permenently chroot, and umount the old root fs | ||
159 | // just like an initrd does. Requires a kernel patch by Werner Almesberger. | ||
160 | // ftp://icaftp.epfl.ch/pub/people/almesber/misc/umount-root-*.tar.gz | ||
161 | //#define BB_FEATURE_INIT_CHROOT | ||
162 | // | ||
163 | //Make sure nothing is printed to the console on boot | ||
164 | #define BB_FEATURE_EXTRA_QUIET | ||
165 | // | ||
149 | //Simple tail implementation (2k vs 6k for the full one). Still | 166 | //Simple tail implementation (2k vs 6k for the full one). Still |
150 | //provides 'tail -f' support -- but for only one file at a time. | 167 | //provides 'tail -f' support -- but for only one file at a time. |
151 | #define BB_FEATURE_SIMPLE_TAIL | 168 | #define BB_FEATURE_SIMPLE_TAIL |
@@ -156,7 +173,6 @@ | |||
156 | // Enable support for a real /etc/mtab file instead of /proc/mounts | 173 | // Enable support for a real /etc/mtab file instead of /proc/mounts |
157 | //#define BB_FEATURE_MOUNT_MTAB_SUPPORT | 174 | //#define BB_FEATURE_MOUNT_MTAB_SUPPORT |
158 | // | 175 | // |
159 | // | ||
160 | // Enable support for remounting filesystems | 176 | // Enable support for remounting filesystems |
161 | #define BB_FEATURE_REMOUNT | 177 | #define BB_FEATURE_REMOUNT |
162 | // | 178 | // |
@@ -166,25 +182,9 @@ | |||
166 | //// Enable reverse sort | 182 | //// Enable reverse sort |
167 | //#define BB_FEATURE_SORT_REVERSE | 183 | //#define BB_FEATURE_SORT_REVERSE |
168 | // | 184 | // |
169 | // Allow init to permenently chroot, and umount the old root fs | ||
170 | // just like an initrd does. Requires a kernel patch by Werner Almesberger. | ||
171 | // ftp://icaftp.epfl.ch/pub/people/almesber/misc/umount-root-*.tar.gz | ||
172 | //#define BB_FEATURE_INIT_CHROOT | ||
173 | // | ||
174 | //Make sure nothing is printed to the console on boot | ||
175 | #define BB_FEATURE_EXTRA_QUIET | ||
176 | // | ||
177 | // Enable full regular expressions. This adds about | ||
178 | // 4k. When this is off, things that would normally | ||
179 | // use regualr expressions (like grep) will just use | ||
180 | // normal strings. | ||
181 | #define BB_FEATURE_FULL_REGULAR_EXPRESSIONS | ||
182 | // | ||
183 | // | ||
184 | // Enable command line editing in the shell | 185 | // Enable command line editing in the shell |
185 | #define BB_FEATURE_SH_COMMAND_EDITING | 186 | #define BB_FEATURE_SH_COMMAND_EDITING |
186 | // | 187 | // |
187 | // | ||
188 | //Turn on extra fbset options | 188 | //Turn on extra fbset options |
189 | //#define BB_FEATURE_FBSET_FANCY | 189 | //#define BB_FEATURE_FBSET_FANCY |
190 | // | 190 | // |
@@ -55,13 +55,17 @@ | |||
55 | #include <unistd.h> | 55 | #include <unistd.h> |
56 | 56 | ||
57 | 57 | ||
58 | #if defined BB_FEATURE_INIT_COREDUMPS | ||
58 | /* | 59 | /* |
59 | * When CORE_ENABLE_FLAG_FILE exists, setrlimit is called before | 60 | * When a file named CORE_ENABLE_FLAG_FILE exists, setrlimit is called |
60 | * process is spawned to set corelimit to unlimited. | 61 | * before processes are spawned to set core file size as unlimited. |
62 | * This is for debugging only. Don't use this is production, unless | ||
63 | * you want core dumps lying about.... | ||
61 | */ | 64 | */ |
62 | #define CORE_ENABLE_FLAG_FILE "/.init_enable_core" | 65 | #define CORE_ENABLE_FLAG_FILE "/.init_enable_core" |
63 | #include <sys/resource.h> | 66 | #include <sys/resource.h> |
64 | #include <sys/time.h> | 67 | #include <sys/time.h> |
68 | #endif | ||
65 | 69 | ||
66 | #ifndef KERNEL_VERSION | 70 | #ifndef KERNEL_VERSION |
67 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | 71 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) |
@@ -415,6 +419,7 @@ static pid_t run(char *command, char *terminal, int get_enter) | |||
415 | cmd[i] = NULL; | 419 | cmd[i] = NULL; |
416 | } | 420 | } |
417 | 421 | ||
422 | #if defined BB_FEATURE_INIT_COREDUMPS | ||
418 | { | 423 | { |
419 | struct stat sb; | 424 | struct stat sb; |
420 | if (stat (CORE_ENABLE_FLAG_FILE, &sb) == 0) { | 425 | if (stat (CORE_ENABLE_FLAG_FILE, &sb) == 0) { |
@@ -424,6 +429,7 @@ static pid_t run(char *command, char *terminal, int get_enter) | |||
424 | setrlimit(RLIMIT_CORE, &limit); | 429 | setrlimit(RLIMIT_CORE, &limit); |
425 | } | 430 | } |
426 | } | 431 | } |
432 | #endif | ||
427 | 433 | ||
428 | /* Now run it. The new program will take over this PID, | 434 | /* Now run it. The new program will take over this PID, |
429 | * so nothing further in init.c should be run. */ | 435 | * so nothing further in init.c should be run. */ |
diff --git a/init/init.c b/init/init.c index f327a52af..d61d1c38e 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -55,13 +55,17 @@ | |||
55 | #include <unistd.h> | 55 | #include <unistd.h> |
56 | 56 | ||
57 | 57 | ||
58 | #if defined BB_FEATURE_INIT_COREDUMPS | ||
58 | /* | 59 | /* |
59 | * When CORE_ENABLE_FLAG_FILE exists, setrlimit is called before | 60 | * When a file named CORE_ENABLE_FLAG_FILE exists, setrlimit is called |
60 | * process is spawned to set corelimit to unlimited. | 61 | * before processes are spawned to set core file size as unlimited. |
62 | * This is for debugging only. Don't use this is production, unless | ||
63 | * you want core dumps lying about.... | ||
61 | */ | 64 | */ |
62 | #define CORE_ENABLE_FLAG_FILE "/.init_enable_core" | 65 | #define CORE_ENABLE_FLAG_FILE "/.init_enable_core" |
63 | #include <sys/resource.h> | 66 | #include <sys/resource.h> |
64 | #include <sys/time.h> | 67 | #include <sys/time.h> |
68 | #endif | ||
65 | 69 | ||
66 | #ifndef KERNEL_VERSION | 70 | #ifndef KERNEL_VERSION |
67 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | 71 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) |
@@ -415,6 +419,7 @@ static pid_t run(char *command, char *terminal, int get_enter) | |||
415 | cmd[i] = NULL; | 419 | cmd[i] = NULL; |
416 | } | 420 | } |
417 | 421 | ||
422 | #if defined BB_FEATURE_INIT_COREDUMPS | ||
418 | { | 423 | { |
419 | struct stat sb; | 424 | struct stat sb; |
420 | if (stat (CORE_ENABLE_FLAG_FILE, &sb) == 0) { | 425 | if (stat (CORE_ENABLE_FLAG_FILE, &sb) == 0) { |
@@ -424,6 +429,7 @@ static pid_t run(char *command, char *terminal, int get_enter) | |||
424 | setrlimit(RLIMIT_CORE, &limit); | 429 | setrlimit(RLIMIT_CORE, &limit); |
425 | } | 430 | } |
426 | } | 431 | } |
432 | #endif | ||
427 | 433 | ||
428 | /* Now run it. The new program will take over this PID, | 434 | /* Now run it. The new program will take over this PID, |
429 | * so nothing further in init.c should be run. */ | 435 | * so nothing further in init.c should be run. */ |