Closed MadhavJivrajani closed 3 years ago
Do these have to be implemented in separate functions (such as sendHup
, sendInt
) or a general function to send a given signal to a process?
Separate functions can be implemented to send individual signals, but only a single exposed interface for the signal-sending should preferably be available. We could have codes for each type of signal as consts and a map
from these consts as keys and values as functions. Maybe we could get the function from the map
and then call it, handle errors from it, etc.
I can try this. syscall already has aliases for all kinds of signals, which can be passed directly to Signal(). Do you think it's a good idea to forego gopsutil entirely for this functionality to maintain a uniform implementation?
Yep! That would be ideal. Go for it!
Quick update, I've started work on this. gopsutil
has a SendSignal
method that takes an arbitrary signal as defined by syscall
and sends it to a process. I'm planning to use it for further work on this
Is your feature request related to a problem? Please describe.
gopsutil
provides support for 4 different types of signals that can be sent to a process, signals other than these 4 need to be implemented such asSIGABRT
. A list of signals can be obtained by runningkill -l
Describe the solution you'd like Maybe the implementation of sending signals could be done using the
Signal()
function.