#killpg() doesn't work

34 messages · Page 1 of 1 (latest)

jolly timberBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

rocky flint
#

from 5 to 5.4

safe berry
#

i forget to change the signum from SIGKILL to SIGTERM but it doesn't matter
What do you mean by that? Are you trying to capture SIGKILL? Cause if yes, then that actually does matter big time.

The SIGKILL signal is used to cause immediate program termination. It cannot be handled or ignored, and is therefore always fatal. It is also not possible to block this signal.

This signal is usually generated only by explicit request. Since it cannot be handled, you should generate it only as a last resort, after first trying a less drastic method such as C-c or SIGTERM. If a process does not respond to any other termination signals, sending it a SIGKILL signal will almost always cause it to go away.

In fact, if SIGKILL fails to terminate a process, that by itself constitutes an operating system bug which you should report.
Source: https://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html

rocky flint
safe berry
#

What do you mean by "signum"?
I only know that word from a mathematical context where it's 1 for positive numbers and -1 for negative numbers

#

Do you mean "signal"?

rocky flint
#

signum is SIGNAL NUMBER

#

the macro for the signal

safe berry
#

I mean I can't really help you cause I can't read the assignment. Idk what language that is, but I'm not capable of it

rocky flint
#

it's c

safe berry
#

That is C?

rocky flint
#

i literally write it

#

it's the excersie

#

the zip containt the source code

#

i can translate ità

#

is not a problem

safe berry
#

Just saying, at least for me I won't bother reading your source code if I can't understand the context

rocky flint
safe berry
#

Are you trying to send the SIGTERM manually or automatically?

#

Also do you even ever register a signal handler for anything but SIGALARM?

#

And does it need to be killpg(grpid, SIGUSR1); or kill(grpid, SIGUSR1);?

rocky flint
safe berry
rocky flint
#

in master

#

Anyway the problem persist in run_simulation, when i send the signals with killpg to children processes

rocky flint
#

or you can use make gdb and try it

jolly timberBOT
#

This question is being automatically marked as stale.
If your question has been answered, run !solved.
If your question is not answered feel free to bump the post or re-ask.
Take a look at !howto ask for tips on improving your question.