File tree Expand file tree Collapse file tree 3 files changed +35
-8
lines changed
Expand file tree Collapse file tree 3 files changed +35
-8
lines changed Original file line number Diff line number Diff line change 334334 <term ><option >-s</option ></term >
335335 <term ><option >--signal=</option ></term >
336336
337- <listitem ><para >When used with <command >kill-session</command >
338- or <command >kill-user</command >, choose which signal to send
339- to selected processes. Must be one of the well known signal
340- specifiers, such as <constant >SIGTERM</constant >,
341- <constant >SIGINT</constant > or <constant >SIGSTOP</constant >.
342- If omitted, defaults to
343- <constant >SIGTERM</constant >.</para ></listitem >
337+ <listitem ><para >When used with <command >kill-session</command > or <command >kill-user</command >,
338+ choose which signal to send to selected processes. Must be one of the well known signal specifiers,
339+ such as <constant >SIGTERM</constant >, <constant >SIGINT</constant > or <constant >SIGSTOP</constant >.
340+ If omitted, defaults to <constant >SIGTERM</constant >.</para >
341+
342+ <para >The special value <literal >help</literal > will list the known values and the program will exit
343+ immediately, and the special value <literal >list</literal > will list known values along with the
344+ numerical signal numbers and the program will exit immediately.</para ></listitem >
344345 </varlistentry >
345346
346347 <varlistentry >
Original file line number Diff line number Diff line change 7373 <option >SIGTERM</option >.</para >
7474
7575 <para >The special value <literal >help</literal > will list the known values and the program will exit
76- immediately.</para >
76+ immediately, and the special value <literal >list</literal > will list known values along with the
77+ numerical signal numbers and the program will exit immediately.</para >
7778 </listitem >
7879 </varlistentry >
7980</variablelist >
Original file line number Diff line number Diff line change 11/* SPDX-License-Identifier: LGPL-2.1-or-later */
22
3+ #include "format-table.h"
34#include "parse-argument.h"
45#include "signal-util.h"
6+ #include "stdio-util.h"
57#include "string-table.h"
68#include "string-util.h"
79
@@ -16,6 +18,29 @@ int parse_signal_argument(const char *s, int *ret) {
1618 return 0 ;
1719 }
1820
21+ if (streq (s , "list" )) {
22+ _cleanup_ (table_unrefp ) Table * table = NULL ;
23+
24+ table = table_new ("signal" , "name" );
25+ if (!table )
26+ return log_oom ();
27+
28+ for (int i = 1 ; i < _NSIG ; i ++ ) {
29+ r = table_add_many (
30+ table ,
31+ TABLE_INT , i ,
32+ TABLE_SIGNAL , i );
33+ if (r < 0 )
34+ return table_log_add_error (r );
35+ }
36+
37+ r = table_print (table , NULL );
38+ if (r < 0 )
39+ return table_log_print_error (r );
40+
41+ return 0 ;
42+ }
43+
1944 r = signal_from_string (s );
2045 if (r < 0 )
2146 return log_error_errno (r , "Failed to parse signal string \"%s\"." , s );
You can’t perform that action at this time.
0 commit comments