Bug 193711 - killproc usage with a signal level is NON-obvious
Summary: killproc usage with a signal level is NON-obvious
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 5
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-05-31 19:13 UTC by Sharif Nassar
Modified: 2014-03-17 02:59 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-06-05 22:56:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Sharif Nassar 2006-05-31 19:13:53 UTC
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 22:56:12 UTC
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.