aboutsummaryrefslogtreecommitdiff
path: root/runit/runsv.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Update applet size estimatesDenys Vlasenko2023-07-101-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: code shrink: introduce and use [_]exit_SUCCESS()Denys Vlasenko2022-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta exit_SUCCESS - 7 +7 _exit_SUCCESS - 7 +7 run_pipe 1562 1567 +5 pseudo_exec_argv 399 400 +1 finish 86 87 +1 start_stop_daemon_main 1109 1107 -2 shutdown_on_signal 38 36 -2 runsv_main 1662 1660 -2 redirect 1070 1068 -2 read_line 79 77 -2 pause_and_low_level_reboot 54 52 -2 list_i2c_busses_and_exit 483 481 -2 less_exit 12 10 -2 identify 4123 4121 -2 grep_file 1161 1159 -2 getty_main 1519 1517 -2 fsck_minix_main 2681 2679 -2 free_session 132 130 -2 fdisk_main 4739 4737 -2 clean_up_and_exit 53 51 -2 bsd_select 1566 1564 -2 bb_daemonize_or_rexec 198 196 -2 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 3/17 up/down: 21/-34) Total: -13 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* runsv: code shrink: use single handler function for SIGTERM and SIGCHLDDenys Vlasenko2021-06-051-9/+8
| | | | | | | | | | | | function old new delta s_chld_term - 36 +36 runsv_main 1677 1662 -15 s_child 22 - -22 s_term 29 - -29 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 0/1 up/down: 36/-66) Total: -30 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* runsv: robustify signal handling - SIGTERM to child between vfork and exec ↵Denys Vlasenko2021-06-051-10/+19
| | | | | | | | | | | | | | | | | could mess things up While at it, rename bb_signals_recursive_norestart() to bb_signals_norestart(): "recursive" was implying we are setting SA_NODEFER allowing signal handler to be entered recursively, but we do not do that. function old new delta bb_signals_norestart - 70 +70 startservice 380 394 +14 bb_signals_recursive_norestart 70 - -70 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 1/0 up/down: 84/-70) Total: 14 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tcp/udpsvd: robustify SIGCHLD handlingDenys Vlasenko2021-06-051-1/+4
| | | | | | | | | | | function old new delta if_verbose_print_connection_status - 40 +40 tcpudpsvd_main 1798 1794 -4 connection_status 31 - -31 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/1 up/down: 40/-35) Total: 5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: introduce and use xgettimeofday(), do not truncate 64-bit time_t in ↵Denys Vlasenko2020-12-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | shells function old new delta xgettimeofday - 11 +11 get_local_var_value 280 281 +1 svlogd_main 1323 1322 -1 change_epoch 67 66 -1 timestamp_and_log 461 458 -3 hwclock_main 301 298 -3 fmt_time_bernstein_25 135 132 -3 step_time 331 326 -5 script_main 1207 1202 -5 machtime 34 28 -6 curtime 61 54 -7 ts_main 423 415 -8 nmeter_main 761 751 -10 gettime1900d 67 46 -21 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/12 up/down: 12/-73) Total: -61 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* randomconfig fixesDenys Vlasenko2020-12-291-5/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: introduce and use sleep1()Denys Vlasenko2020-11-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | function old new delta sleep1 - 9 +9 run_shutdown_and_kill_processes 97 95 -2 restore_state_and_exit 116 114 -2 reread_partition_table 67 65 -2 flush_buffer_cache 80 78 -2 chat_main 1302 1300 -2 timeout_main 310 307 -3 telnet_main 1235 1232 -3 stop_handler 86 83 -3 process_action 1078 1075 -3 nbdclient_main 1185 1182 -3 init_main 789 786 -3 getty_main 1541 1538 -3 do_time 410 407 -3 runsv_main 1682 1677 -5 pause_and_low_level_reboot 59 54 -5 inetd_main 1917 1911 -6 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/16 up/down: 9/-50) Total: -41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Remove syscall wrappers around clock_gettime, closes 12091Denys Vlasenko2019-10-241-10/+1
| | | | | | | | | | | | | | | 12091 "Direct use of __NR_clock_gettime is not time64-safe". function old new delta runsv_main 1698 1712 +14 startservice 378 383 +5 get_mono 31 25 -6 date_main 932 926 -6 gettimeofday_ns 17 - -17 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 2/2 up/down: 19/-29) Total: -10 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* runsv: Use 64 prefix syscall if we have toAlistair Francis2019-10-081-0/+7
| | | | | | | | | | | | | | | | | | Some 32-bit architectures no longer have the 32-bit time_t syscalls. Instead they have suffixed syscalls that returns a 64-bit time_t. If the architecture doesn't have the non-suffixed syscall and is using a 64-bit time_t let's use the suffixed syscall instead. This fixes build issues when building for RISC-V 32-bit with 5.1+ kernel headers. If an architecture only supports the suffixed syscalls, but is still using a 32-bit time_t report a compilation error. This avoids us have to deal with converting between 64-bit and 32-bit values. There are currently no architectures where this is the case. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* config: update size informationDenys Vlasenko2018-12-281-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* do not use `a' quoting style in commentsDenys Vlasenko2017-08-021-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* config: deindent all help textsDenys Vlasenko2017-07-211-2/+2
| | | | | | Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Update menuconfig items with approximate applet sizesDenys Vlasenko2017-07-181-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* runsv: update to match version 2.1.2 of runitDenys Vlasenko2017-05-151-37/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport from upstream versions: 2.1.0 Thu, 24 Sep 2009 22:49:33 +0000 * runsv.c: exit with error if [log/]supervise/control exists, but is not a fifo. [Code abstracted into a separate function to make it more compact for BusyBox.] 1.9.0 Mon, 05 May 2008 22:00:13 +0000 * runsv.c: create temporary new status files for log/supervise/ actually in log/supervise/. 1.7.2 Tue, 21 Nov 2006 15:13:47 +0000 * runsv.c: really don't act on commands in state finish; minor. function old new delta open_control - 135 +135 update_status 553 612 +59 custom 223 242 +19 ctrl 426 422 -4 warn_cannot 21 10 -11 runsv_main 1786 1662 -124 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/3 up/down: 213/-139) Total: 74 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: add most of the required setup_common_bufsiz() callsDenys Vlasenko2016-04-211-0/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: make bb_common_bufsiz1 1 kbyte, add capability to use bss tail for itDenys Vlasenko2016-04-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The config item is FEATURE_USE_BSS_TAIL. When it is off (default): function old new delta read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 push 46 44 -2 inetd_main 2136 2134 -2 uevent_main 421 418 -3 addLines 97 92 -5 bb_common_bufsiz1 8193 1024 -7169 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 8/5 up/down: 62/-7181) Total: -7119 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829901 4086 1904 835891 cc133 busybox_unstripped FEATURE_USE_BSS_TAIL=y: read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 inetd_main 2136 2134 -2 bb_common_bufsiz1 8193 - -8193 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 8/1 up/down: 62/-8195) Total: -8133 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829911 4086 880 834877 cbd3d busybox_unstripped FIXME: setup_common_bufsiz() calls are missing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* runit/*: convert to new-style "one file" appletsDenys Vlasenko2015-10-191-1/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: introduce kernel-style BUILD_BUG_ON()Denys Vlasenko2015-10-131-10/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* join some common strings, -400 bytesDenys Vlasenko2015-10-081-2/+2
| | | | | | | | | | | | | | | function old new delta print_intel_cstates 499 511 +12 file_insert 355 364 +9 dpkg_main 2944 2940 -4 ifenslave_main 645 640 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 21/-9) Total: 12 bytes text data bss dec hex filename 937564 932 17676 956172 e970c busybox_old 937164 932 17676 955772 e957c busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: use <poll.h> instead of <sys/poll.h>Thomas Petazzoni2013-10-161-1/+0
| | | | | Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace cleanup. no code changesDenys Vlasenko2013-01-141-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* move remaining help text from include/usage.src.hPere Orga2011-04-111-0/+5
| | | | | Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Move stpcpy replacement function into libbbDan Fandrich2011-02-131-17/+7
| | | | | Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* remove runit/runit_lib.cDenys Vlasenko2010-10-131-3/+3
| | | | | | | | | | | | | | | | | | | function old new delta runsv_main 1770 1786 +16 svstatus_get 176 188 +12 sv_main 1180 1186 +6 runsvdir_main 683 689 +6 processorstart 385 391 +6 control 126 132 +6 logdir_open 1184 1187 +3 lock_exnb 14 - -14 lock_ex 14 - -14 open_write 17 - -17 open_read 17 - -17 ------------------------------------------------------------------------------ (add/remove: 0/5 grow/shrink: 7/0 up/down: 55/-62) Total: -7 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* runit_lib: remove/inline a few more thingsDenys Vlasenko2010-09-051-1/+2
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* *: suppress ~60% of "aliased warnings" on gcc-4.4.1Denys Vlasenko2010-02-041-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: remove a few more cases of argc usage. -89 bytes.Denys Vlasenko2009-11-281-3/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: use {i,u}toa() where appropriateDenys Vlasenko2009-10-061-4/+2
| | | | | | | | | | | function old new delta startservice 377 363 -14 setari_u 54 40 -14 ash_main 1375 1361 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-42) Total: -42 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* runsv: run ./finish with parameters (runit compat)Earl Chew2009-08-021-18/+45
| | | | | | | | | function old new delta startservice 288 377 +89 runsv_main 1763 1783 +20 Signed-off-by: Earl Chew <earl_chew@agilent.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* runsv: rename field in a struct to not collide with other nameDenys Vlasenko2009-07-151-18/+19
| | | | | | no code changes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* stop using non-standard macro, use WEXITSTATUS insteadDenys Vlasenko2009-06-071-2/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* runsv: another tiny optimizationDenis Vlasenko2009-02-261-8/+6
| | | | | | | function old new delta startservice 297 288 -9 ctrl 435 426 -9
* runsv: small optimizationDenis Vlasenko2009-02-261-5/+2
| | | | | | | | *: more paranoia around passing NULL to execl[e] function old new delta custom 240 221 -19
* init: preparatory patch, no code changesDenis Vlasenko2009-01-311-2/+2
|
* *: a bit of code shrinkDenis Vlasenko2008-11-091-2/+3
| | | | | | | | | | | | | | function old new delta stop_handler 41 38 -3 sulogin_main 508 504 -4 got_cont 4 - -4 cont_handler 11 - -11 startservice 309 297 -12 processorstart 423 409 -14 tcpudpsvd_main 1861 1843 -18 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/5 up/down: 0/-66) Total: -66 bytes
* runsvdir: alternative methon of supporting runsvdir-as-init. +66 bytes.Denis Vlasenko2008-11-061-2/+2
| | | | | *: s/int/pid_t where appropriate
* *: rename ATTRIBUTE_XXX to just XXX.Denis Vlasenko2008-07-051-3/+3
|
* whitespace fixes. no code changesDenis Vlasenko2008-06-251-4/+3
|
* - use EXIT_{SUCCESS,FAILURE}. No object-code changesBernhard Reutner-Fischer2008-05-191-1/+1
|
* selinux/*: -Wunused-parameter fixesDenis Vlasenko2008-03-171-5/+8
| | | | | | | | | | runsv: make it NOMMU-capable function old new delta startservice 291 313 +22 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 22/0) Total: 22 bytes
* *: add -Wunused-parameter; fix resulting breakageDenis Vlasenko2008-03-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta procps_scan 1265 1298 +33 aliascmd 278 283 +5 parse_file_cmd 116 120 +4 dname_enc 373 377 +4 setcmd 90 93 +3 execcmd 57 60 +3 count_lines 72 74 +2 process_command_subs 340 339 -1 test_main 409 407 -2 mknod_main 179 177 -2 handle_incoming_and_exit 2653 2651 -2 argstr 1312 1310 -2 shiftcmd 131 128 -3 exitcmd 46 43 -3 dotcmd 297 294 -3 breakcmd 86 83 -3 evalpipe 353 349 -4 evalcommand 1180 1176 -4 evalcmd 109 105 -4 send_tree 374 369 -5 mkfifo_main 82 77 -5 evalsubshell 152 147 -5 typecmd 75 69 -6 letcmd 61 55 -6 add_cmd 1190 1183 -7 main 891 883 -8 ash_main 1415 1407 -8 parse_stream 1377 1367 -10 alloc_procps_scan 55 - -55 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148) Total: -94 bytes text data bss dec hex filename 797195 658 7428 805281 c49a1 busybox_old 797101 658 7428 805187 c4943 busybox_unstripped
* actually add bb_qsort.cDenis Vlasenko2008-03-021-1/+1
| | | | | *: s/Denis/Denys/
* libbb: introduce and use xrename and rename_or_warn.Denis Vlasenko2008-02-171-10/+0
|
* libbb: introduce bb_signals and bb_signals_recursive,Denis Vlasenko2008-02-161-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | which sets same handler for many signals. sig_catch is nuked (bb_signals_recursive is more descriptive name). *: use them as appropriate. function old new delta bb_signals_recursive - 95 +95 bb_signals - 52 +52 run_command 258 273 +15 svlogd_main 1368 1377 +9 runsv_main 1746 1752 +6 runsvdir_main 1643 1646 +3 UNSPEC_print 64 66 +2 time_main 1128 1127 -1 ... resize_main 246 210 -36 sig_catch 63 - -63 set_fatal_sighandler 85 14 -71 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 5/24 up/down: 182/-548) Total: -366 bytes
* *: more readable handling of pipe fds. No code changes.Denis Vlasenko2008-02-161-23/+24
|
* *: tidy up usage of char **environDenis Vlasenko2008-01-281-1/+1
|
* libbb: introduce and use safe_waitpid (loops in EINTR)Denis Vlasenko2008-01-021-3/+2
| | | | | | | | | | | | | | | | | | | | | | *: use more approproate (shorter) versions of wait() function old new delta safe_waitpid - 48 +48 wait_any_nohang - 17 +17 send_tree 365 369 +4 processorstop 432 435 +3 text_yank 110 108 -2 make_human_readable_str 202 200 -2 crond_main 1368 1366 -2 handle_sigchld 49 43 -6 reapchild 166 159 -7 custom 260 250 -10 checkscript 191 177 -14 wait_nohang 17 - -17 wait_pid 43 - -43 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 2/7 up/down: 72/-103) Total: -31 bytes
* add -fvisibility=hidden to CC flags, mark XXX_main functionsDenis Vlasenko2007-10-111-1/+1
| | | | | EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
* introduce and use close_on_exec_on(fd). -50 bytes.Denis Vlasenko2007-09-301-12/+12
|