1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 02:03:13 +02:00

core: fix zombie processes remaining after the end of forked processes (closes #1994)

The clean of processes with waitpid() is now delayed after the kill(), so that
there are no more zombies.

In addition, this can be done manually if needed with `/sys waitpid`.
This commit is contained in:
Sébastien Helleu
2023-10-10 19:23:43 +02:00
parent 408901d772
commit 02a05f63d5
23 changed files with 156 additions and 190 deletions
+1
View File
@@ -51,6 +51,7 @@ New features::
Bug fixes::
* core: fix zombie processes after fork (hook process or connect) (issue #1994)
* core: fix generation of TOTP on Big Endian systems (issue #2021)
* core: fix cursor position after `/plugin list -i` or `/plugin list -il`
* core: display focus hashtable for debug even if no key is matching
+4 -2
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2023-09-06 19:13+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2728,7 +2728,9 @@ msgid ""
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
#, fuzzy
+23 -155
View File
@@ -26,7 +26,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2023-10-05 08:04+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
@@ -74,12 +74,10 @@ msgstr ""
"Die Systemzeit ist nicht korrekt (%+ld Sekunden), reinitialisiere alle Uhren"
#, c-format
#| msgid "curl error %d (%s) (URL: \"%s\")\n"
msgid "%sURL transfer error: %s (URL: \"%s\")"
msgstr "%sURL Transferfehler: %s (URL: \"%s\")"
#, c-format
#| msgid "End of command '%s', timeout reached (%.1fs)"
msgid "End of URL transfer '%s', timeout reached (%.1fs)"
msgstr "Ende der URL-Übertragung „%s“, Zeitüberschreitung erreicht (%.1fs)"
@@ -1059,16 +1057,12 @@ msgid "WeeChat session saved (files *.upgrade)"
msgstr "WeeChat Sitzung gesichert (Dateien *.upgrade)"
#, c-format
#| msgid ""
#| "%sCan't upgrade: there is one or more background process (hook type "
#| "'process' or 'connect')"
msgid ""
"%sCan't upgrade: there is one or more background process/thread running "
"(hook type: process, connect or url)"
msgstr ""
"%sAktualisierung nicht möglich: Es laufen ein oder mehrere"
" Hintergrundprozesse/-threads"
"(Hook-Typ: 'process', 'connect' oder 'url')"
"%sAktualisierung nicht möglich: Es laufen ein oder mehrere "
"Hintergrundprozesse/-threads(Hook-Typ: 'process', 'connect' oder 'url')"
#, c-format
msgid "%sCan't upgrade: WeeChat binary \"%s\" does not exist"
@@ -1680,11 +1674,6 @@ msgid "debug functions"
msgstr "Debug-Funktionen"
#. TRANSLATORS: only text between angle brackets (eg: "<name>") must be translated
#| msgid ""
#| "list || set <plugin> <level> || dump|hooks [<plugin>] || buffer|certs|"
#| "color|dirs|infolists|libs|memory|tags|term|windows || callbacks "
#| "<duration>[<unit>] || mouse|cursor [verbose] || hdata [free] || time "
#| "<command> || unicode <string>"
msgid ""
"list || set <plugin> <level> || dump|hooks [<plugin>] || buffer|certs|color|"
"dirs|infolists|libs|memory|tags|term|url|windows || callbacks "
@@ -1696,50 +1685,6 @@ msgstr ""
"<duration>[<unit>] || mouse|cursor [verbose] || hdata [free] || time "
"<command> || unicode <string>"
#| msgid ""
#| " list: list plugins with debug levels\n"
#| " set: set debug level for plugin\n"
#| " plugin: name of plugin (\"core\" for WeeChat core)\n"
#| " level: debug level for plugin (0 = disable debug)\n"
#| " dump: save memory dump in WeeChat log file (same dump is written "
#| "when WeeChat crashes)\n"
#| " hooks: display infos about hooks (with a plugin: display detailed "
#| "info about hooks created by the plugin)\n"
#| " buffer: dump buffer content with hexadecimal values in WeeChat log "
#| "file\n"
#| "callbacks: write hook and bar item callbacks that took more than "
#| "\"duration\" in the WeeChat log file (0 = disable), where optional unit "
#| "is one of:\n"
#| " us: microseconds (default)\n"
#| " ms: milliseconds\n"
#| " s: seconds\n"
#| " m: minutes\n"
#| " h: hours\n"
#| " certs: display number of loaded trusted certificate authorities\n"
#| " color: display infos about current color pairs\n"
#| " cursor: toggle debug for cursor mode\n"
#| " dirs: display directories\n"
#| " hdata: display infos about hdata (with free: remove all hdata in "
#| "memory)\n"
#| "infolists: display infos about infolists\n"
#| " key: enable keyboard and mouse debug: display raw codes, expanded "
#| "key name and associated command ('q' to quit this mode)\n"
#| " libs: display infos about external libraries used\n"
#| " memory: display infos about memory usage\n"
#| " mouse: toggle debug for mouse\n"
#| " tags: display tags for lines\n"
#| " term: display infos about terminal\n"
#| " windows: display windows tree\n"
#| " time: measure time to execute a command or to send text to the "
#| "current buffer\n"
#| " unicode: display information about string and unicode chars (evaluated, "
#| "see /help eval)\n"
#| "\n"
#| "Examples:\n"
#| " /debug set irc 1\n"
#| " /debug mouse verbose\n"
#| " /debug time /filter toggle\n"
#| " /debug unicode ${chars:${\\u26C0}-${\\u26CF}}"
msgid ""
" list: list plugins with debug levels\n"
" set: set debug level for plugin\n"
@@ -1820,8 +1765,8 @@ msgstr ""
" mouse: schaltet den debug-Modus für den Maus-Modus ein/aus\n"
" tags: zeigt für jede einzelne Zeile die dazugehörigen Schlagwörter an\n"
" term: zeigt Informationen über das Terminal an\n"
" url: zeigt Debug-Informationen für hook_url Aufrufe an (Ausgabe als"
" Hashtable)\n"
" url: zeigt Debug-Informationen für hook_url Aufrufe an (Ausgabe als "
"Hashtable)\n"
" windows: zeigt die Fensterstruktur an\n"
" time: misst die Zeit um einen Befehl auszuführen oder um einen Text in "
"den aktuellen Buffer zu senden\n"
@@ -3575,13 +3520,23 @@ msgstr ""
msgid "system actions"
msgstr "Systemaktionen"
#, fuzzy
#| msgid ""
#| " get: display system info\n"
#| " rlimit: display resource limits (see /help weechat.startup.sys_rlimit "
#| "and \"man getrlimit\")\n"
#| " rusage: display resource usage (see \"man getrusage\")\n"
#| "suspend: suspend WeeChat and go back to the shell, by sending signal "
#| "SIGTSTP to the WeeChat process"
msgid ""
" get: display system info\n"
" rlimit: display resource limits (see /help weechat.startup.sys_rlimit and "
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
" get: Systeminformationen anzeigen\n"
" rlimit: Ressourcengrenzen anzeigen (siehe /help weechat.startup.sys_rlimit "
@@ -6454,16 +6409,13 @@ msgid "not enough memory"
msgstr "nicht genügend Speicher"
#, c-format
#| msgid "%sFilter \"%s\" not found"
msgid "file \"%s\" not found"
msgstr "Datei \"%s\", nicht gefunden"
#, c-format
#| msgid "%sCannot create file \"%s\""
msgid "can not write file \"%s\""
msgstr "Datei \"%s\" kann nicht erstellt werden"
#| msgid "fork error"
msgid "transfer error"
msgstr "Übertragungsfehler"
@@ -7006,87 +6958,6 @@ msgstr ""
msgid "bar item with list of buffers"
msgstr "Bar-Item mit der Liste von Buffern"
#| msgid ""
#| " enable: enable buflist\n"
#| "disable: disable buflist\n"
#| " toggle: toggle buflist\n"
#| " bar: add the \"buflist\" bar\n"
#| "refresh: force the refresh of the bar items (buflist, buflist2 buflist3, "
#| "buflist4 and buflist5)\n"
#| "\n"
#| "The lines with buffers are displayed using string evaluation (see /help "
#| "eval for the format), with these options:\n"
#| " - buflist.look.display_conditions: conditions to display a buffer in "
#| "the list\n"
#| " - buflist.format.buffer: format for a buffer which is not current "
#| "buffer\n"
#| " - buflist.format.buffer_current: format for the current buffer\n"
#| "\n"
#| "The following variables can be used in these options:\n"
#| " - bar item data (see hdata \"bar_item\" in API doc for a complete "
#| "list), for example:\n"
#| " - ${bar_item.name}\n"
#| " - window data, where the bar item is displayed (there's no window in "
#| "root bars, see hdata \"window\" in API doc for a complete list), for "
#| "example:\n"
#| " - ${window.number}\n"
#| " - ${window.buffer.full_name}\n"
#| " - buffer data (see hdata \"buffer\" in API doc for a complete list), "
#| "for example:\n"
#| " - ${buffer.number}\n"
#| " - ${buffer.name}\n"
#| " - ${buffer.full_name}\n"
#| " - ${buffer.short_name}\n"
#| " - ${buffer.nicklist_nicks_count}\n"
#| " - irc_server: IRC server data, defined only on an IRC buffer (see hdata "
#| "\"irc_server\" in API doc)\n"
#| " - irc_channel: IRC channel data, defined only on an IRC channel buffer "
#| "(see hdata \"irc_channel\" in API doc)\n"
#| " - extra variables added by buflist for convenience:\n"
#| " - ${format_buffer}: the evaluated value of option buflist.format."
#| "buffer; this can be used in option buflist.format.buffer_current to just "
#| "change the background color for example\n"
#| " - ${current_buffer}: a boolean (\"0\" or \"1\"), \"1\" if this is the "
#| "current buffer; it can be used in a condition: ${if:"
#| "${current_buffer}?...:...}\n"
#| " - ${merged}: a boolean (\"0\" or \"1\"), \"1\" if the buffer is "
#| "merged with at least another buffer; it can be used in a condition: ${if:"
#| "${merged}?...:...}\n"
#| " - ${format_number}: indented number with separator (evaluation of "
#| "option buflist.format.number)\n"
#| " - ${number}: indented number, for example \" 1\" if there are between "
#| "10 and 99 buffers; for merged buffers, this variable is set with number "
#| "for the first buffer and spaces for the next buffers with same number\n"
#| " - ${number2}: indented number, for example \" 1\" if there are "
#| "between 10 and 99 buffers\n"
#| " - ${number_displayed}: \"1\" if the number is displayed, otherwise "
#| "\"0\"\n"
#| " - ${indent}: indentation for name (channel, private and list buffers "
#| "are indented) (evaluation of option buflist.format.indent)\n"
#| " - ${format_nick_prefix}: colored nick prefix for a channel "
#| "(evaluation of option buflist.format.nick_prefix)\n"
#| " - ${color_nick_prefix}: color of nick prefix for a channel (set only "
#| "if the option buflist.look.nick_prefix is enabled)\n"
#| " - ${nick_prefix}: nick prefix for a channel (set only if the option "
#| "buflist.look.nick_prefix is enabled)\n"
#| " - ${format_name}: formatted name (evaluation of option buflist.format."
#| "name)\n"
#| " - ${name}: the short name (if set), with a fallback on the name\n"
#| " - ${color_hotlist}: the color depending on the highest hotlist level "
#| "for the buffer (evaluation of option buflist.format.hotlist_xxx where xxx "
#| "is the level)\n"
#| " - ${format_hotlist}: the formatted hotlist (evaluation of option "
#| "buflist.format.hotlist)\n"
#| " - ${hotlist}: the raw hotlist\n"
#| " - ${hotlist_priority}: \"none\", \"low\", \"message\", \"private\" or "
#| "\"highlight\"\n"
#| " - ${hotlist_priority_number}: -1 = none, 0 = low, 1 = message, 2 = "
#| "private, 3 = highlight\n"
#| " - ${format_lag}: the lag for an IRC server buffer, empty if there's "
#| "no lag (evaluation of option buflist.format.lag)\n"
#| " - ${format_tls_version}: indicator of TLS version for a server "
#| "buffer, empty for channels (evaluation of option buflist.format."
#| "tls_version)"
msgid ""
" enable: enable buflist\n"
"disable: disable buflist\n"
@@ -7170,9 +7041,9 @@ msgstr ""
"disable: buflist deaktivieren\n"
" toggle: buflist umschalten\n"
" bar: fügt eine \"buflist\" Bar hinzu\n"
"refresh: erzwingt die Aktualisierung einiger Bar-Items (wenn kein Element"
" angegeben ist, werden alle Bar-Items aktualisiert, entsprechend der Option"
" buflist.look.use_items)\n"
"refresh: erzwingt die Aktualisierung einiger Bar-Items (wenn kein Element "
"angegeben ist, werden alle Bar-Items aktualisiert, entsprechend der Option "
"buflist.look.use_items)\n"
"\n"
"Jede Zeile die einen Buffer anzeigt, wird mittels Zeichenketten-Evaluation "
"dargestellt (siehe /help eval für das Format), dazu werden folgende Optionen "
@@ -7251,7 +7122,6 @@ msgstr ""
" - ${format_tls_version}: Indikator der TLS Version für den Serverbuffer, "
"Channels bleiben unberührt (evaluiert aus Option buflist.format.tls_version)"
#| msgid "list of bar items"
msgid "buflist bar items"
msgstr "Buflist Bar-Items"
@@ -13836,8 +13706,8 @@ msgstr ""
msgid ""
"%s%s: zstd compression is not available, logger files will not be compressed"
msgstr ""
"%s%s: zstd Komprimierung ist nicht verfügbar, Logger-Dateien werden nicht"
" komprimiert"
"%s%s: zstd Komprimierung ist nicht verfügbar, Logger-Dateien werden nicht "
"komprimiert"
msgid ""
"logging level for this buffer (0 = logging disabled, 1 = a few messages "
@@ -16820,8 +16690,7 @@ msgstr "verwaltet Trigger, das Schweizer Armeemesser für WeeChat"
msgid ""
"list [-o|-ol|-i|-il] || listfull || listdefault || add|addoff|addreplace "
"<name> <hook> "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<"
"return_code>\" [\"<post_action>\"]]]]]] "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<return_code>\" [\"<post_action>\"]]]]]] "
"|| addinput [<hook>] || input|output|recreate <name> || set <name> <option> "
"<value> || rename|copy <name> <new_name> || enable|disable|toggle [<name>|-"
"all [<name>...]] || restart <name>|-all [<name>...] || show <name> || del "
@@ -16830,8 +16699,7 @@ msgid ""
msgstr ""
"list [-o|-ol|-i|-il] || listfull || listdefault || add|addoff|addreplace "
"<name> <hook> "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<"
"return_code>\" [\"<post_action>\"]]]]]] "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<return_code>\" [\"<post_action>\"]]]]]] "
"|| addinput [<hook>] || input|output|recreate <name> || set <name> <option> "
"<value> || rename|copy <name> <new_name> || enable|disable|toggle [<name>|-"
"all [<name>...]] || restart <name>|-all [<name>...] || show <name> || del "
+4 -2
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2023-09-06 19:13+0200\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3287,7 +3287,9 @@ msgid ""
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
#, fuzzy
+8 -4
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"PO-Revision-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2023-10-10 19:22+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -3449,14 +3449,18 @@ msgid ""
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
" get : afficher des informations système\n"
" rlimit : afficher les limites de ressource (voir /help weechat.startup."
"sys_rlimit et \"man getrlimit\")\n"
" rusage : afficher l'utilisation des ressources (voir \"man getrusage\")\n"
"suspend : suspendre WeeChat et retourner au shell, en envoyant le signal "
"SIGTSTP au processus WeeChat"
"SIGTSTP au processus WeeChat\n"
"waitpid : prendre connaissance des processus fils qui sont terminés (pour "
"éviter les processus \"zombies\")"
msgid "toggle value of a config option"
msgstr "basculer la valeur d'une option de configuration"
+4 -2
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2023-09-06 19:13+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2447,7 +2447,9 @@ msgid ""
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
#, fuzzy
+4 -2
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2023-09-06 19:13+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2887,7 +2887,9 @@ msgid ""
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
#, fuzzy
+4 -2
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2023-09-06 19:13+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -3441,7 +3441,9 @@ msgid ""
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
#, fuzzy
+4 -2
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2023-09-06 19:13+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
@@ -3914,7 +3914,9 @@ msgid ""
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
msgid "toggle value of a config option"
+4 -2
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2023-09-06 19:13+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@@ -3409,7 +3409,9 @@ msgid ""
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
#, fuzzy
+4 -2
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2023-09-06 19:13+0200\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2952,7 +2952,9 @@ msgid ""
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
#, fuzzy
+4 -2
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2023-09-06 19:13+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2471,7 +2471,9 @@ msgid ""
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
#, fuzzy
+12 -2
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2023-09-06 19:13+0200\n"
"Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3440,13 +3440,23 @@ msgstr ""
msgid "system actions"
msgstr "системске акције"
#, fuzzy
#| msgid ""
#| " get: display system info\n"
#| " rlimit: display resource limits (see /help weechat.startup.sys_rlimit "
#| "and \"man getrlimit\")\n"
#| " rusage: display resource usage (see \"man getrusage\")\n"
#| "suspend: suspend WeeChat and go back to the shell, by sending signal "
#| "SIGTSTP to the WeeChat process"
msgid ""
" get: display system info\n"
" rlimit: display resource limits (see /help weechat.startup.sys_rlimit and "
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
" get: приказује информације о систему\n"
" rlimit: приказује границе ресурса (погледајте /help weechat.startup."
+4 -2
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2023-09-06 19:13+0200\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3525,7 +3525,9 @@ msgid ""
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
msgid "toggle value of a config option"
+4 -2
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-10-01 16:11+0200\n"
"POT-Creation-Date: 2023-10-10 19:22+0200\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2279,7 +2279,9 @@ msgid ""
"\"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP "
"to the WeeChat process"
"to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent \"zombie\" "
"processes)"
msgstr ""
msgid "toggle value of a config option"
+1 -1
View File
@@ -270,7 +270,7 @@ hook_connect_free_data (struct t_hook *hook)
if (HOOK_CONNECT(hook, child_pid) > 0)
{
kill (HOOK_CONNECT(hook, child_pid), SIGKILL);
waitpid (HOOK_CONNECT(hook, child_pid), NULL, 0);
hook_schedule_clean_children ();
HOOK_CONNECT(hook, child_pid) = 0;
}
if (HOOK_CONNECT(hook, child_read) != -1)
+1 -2
View File
@@ -603,7 +603,6 @@ hook_process_timer_cb (const void *pointer, void *data, int remaining_calls)
((float)HOOK_PROCESS(hook_process, timeout)) / 1000);
}
kill (HOOK_PROCESS(hook_process, child_pid), SIGKILL);
usleep (1000);
unhook (hook_process);
}
else
@@ -863,7 +862,7 @@ hook_process_free_data (struct t_hook *hook)
if (HOOK_PROCESS(hook, child_pid) > 0)
{
kill (HOOK_PROCESS(hook, child_pid), SIGKILL);
waitpid (HOOK_PROCESS(hook, child_pid), NULL, 0);
hook_schedule_clean_children ();
HOOK_PROCESS(hook, child_pid) = 0;
}
if (HOOK_PROCESS(hook, child_read[HOOK_PROCESS_STDIN]) != -1)
+13 -3
View File
@@ -6795,6 +6795,12 @@ COMMAND_CALLBACK(sys)
return WEECHAT_RC_OK;
}
if (string_strcmp (argv[1], "waitpid") == 0)
{
sys_waitpid ();
return WEECHAT_RC_OK;
}
COMMAND_ERROR;
}
@@ -9273,15 +9279,19 @@ command_init ()
NULL, "sys",
N_("system actions"),
"get rlimit|rusage"
" || suspend",
" || suspend"
" || waitpid",
N_(" get: display system info\n"
" rlimit: display resource limits "
"(see /help weechat.startup.sys_rlimit and \"man getrlimit\")\n"
" rusage: display resource usage (see \"man getrusage\")\n"
"suspend: suspend WeeChat and go back to the shell, by sending "
"signal SIGTSTP to the WeeChat process"),
"signal SIGTSTP to the WeeChat process\n"
"waitpid: acknowledge the end of children processes (to prevent "
"\"zombie\" processes)"),
"get rlimit|rusage"
" || suspend",
" || suspend"
" || waitpid",
&command_sys, NULL, NULL);
hook_command (
NULL, "toggle",
+30
View File
@@ -38,6 +38,7 @@
#include "wee-log.h"
#include "wee-signal.h"
#include "wee-string.h"
#include "wee-sys.h"
#include "wee-util.h"
#include "../gui/gui-chat.h"
#include "../plugins/plugin.h"
@@ -627,6 +628,35 @@ hook_set (struct t_hook *hook, const char *property, const char *value)
}
}
/*
* Callback used to clean all children (forked processes) by acknowledging
* their end.
*/
int
hook_timer_clean_children_cb (const void *pointer, void *data,
int remaining_calls)
{
/* make C compiler happy */
(void) pointer;
(void) data;
(void) remaining_calls;
sys_waitpid ();
return WEECHAT_RC_OK;
}
/*
* Schedule a cleanup timer to clean children (forked processes).
*/
void
hook_schedule_clean_children ()
{
hook_timer (NULL, 100, 0, 1, &hook_timer_clean_children_cb, NULL, NULL);
}
/*
* Unhooks something.
*/
+1
View File
@@ -146,6 +146,7 @@ extern void hook_callback_end (struct t_hook *hook,
extern char *hook_get_description (struct t_hook *hook);
extern void hook_set (struct t_hook *hook, const char *property,
const char *value);
extern void hook_schedule_clean_children ();
extern void unhook (struct t_hook *hook);
extern void unhook_all_plugin (struct t_weechat_plugin *plugin,
const char *subplugin);
+19
View File
@@ -32,6 +32,7 @@
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
#include <sys/wait.h>
#include "weechat.h"
#include "wee-config.h"
@@ -341,3 +342,21 @@ sys_display_rusage ()
"getrusage");
#endif /* HAVE_SYS_RESOURCE_H */
}
/*
* Calls waitpid() to acknowledge the end of forked processes, thus preventing
* them to become zombies.
*/
void
sys_waitpid ()
{
int i;
/* acknowledge the end of up to 42 forked processes */
i = 0;
while ((i < 42) && (waitpid (-1, NULL, WNOHANG) > 0))
{
i++;
}
}
+1
View File
@@ -31,5 +31,6 @@ struct t_rlimit_resource
extern void sys_setrlimit ();
extern void sys_display_rlimit ();
extern void sys_display_rusage ();
extern void sys_waitpid ();
#endif /* WEECHAT_SYS_H */
+2 -1
View File
@@ -483,7 +483,8 @@ xfer_network_child_kill (struct t_xfer *xfer)
if (xfer->child_pid > 0)
{
kill (xfer->child_pid, SIGKILL);
waitpid (xfer->child_pid, NULL, 0);
weechat_command (weechat_buffer_search_main (),
"/mute /wait 100ms /sys waitpid");
xfer->child_pid = 0;
}