Bug 193711 - killproc usage with a signal level is NON-obvious
killproc usage with a signal level is NON-obvious
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
5
All Linux
medium Severity low
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-31 15:13 EDT by Sharif Nassar
Modified: 2014-03-16 22:59 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-06-05 18:56:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Sharif Nassar 2006-05-31 15:13:53 EDT
Description of problem:

I have an application that takes a USR2 signal, and does fancy things with it.
I added a 'reload' feature to the init script in /etc/init.d for this service.
It would invoke:  killproc $prog USR2
This would end up sending:  kill USR2 $pid
This is bad, because it sends a TERM signal to the process, and not USR2

I've modified my script, so it now says: killproc $prog -USR2
This seems wrong to me somehow.

Can we fix the function definition to be clear as to what it expects.
The usage for killproc indicates a signal should be provided, but not that the
hyphen is necessary...

Version-Release number of selected component (if applicable):

This is observed in initscripts 8.31.1-1 in FC5, and whatever initscripts are in
RHEL4

How reproducible:

. /etc/init.d/functions
killproc $prog USR2
  
Actual results:

Sends TERM to prog

Expected results:

Sends USR2 to prog

Additional info:

I notice that kill has a -s flag, which could be used in this case, but that
would break scripts that have been modified as mine have.
Comment 1 Miloslav Trmač 2006-06-05 18:56:12 EDT
The killproc init script function is specified in the LSB.  It would be possible
to change the function for non-LSB scripts, but that would only add to the
confusion; therefore I think the best option is to keep the current interface.

I did change the killproc usage message to include the hyphen, though.
Thanks for your report.

Note You need to log in before you can comment on or make changes to this bug.