3
votes
2answers
50 views

Why is my trap not printing any log message?

What I'm doing is, trap 'rm -f /path/of/file/fileName.running; echo "TRAPPED & READY";' 1 2 9 15 >> trap.log I didn't get anything in log & the file which should have been deleted ...
1
vote
0answers
26 views

Trap not trapping SIGTSTP

I have a script that keeps displaying the login prompt: #!/bin/bash trap '' 2 20 while true; do login done This is part of a bigger project so please don't tell me to just use the system login ...
5
votes
1answer
39 views

Ctrl-C is ignored by pppd when put in a shell script

I'm trying to connect to GPRS network through a serial port connected GSM modem. When I call /usr/sbin/pppd call <peer_name> from the command line, it correctly receives and handles Ctrl+C from ...
1
vote
1answer
25 views

How do I obtain the kill signal / message / reason within a script?

I am using the following trap: trap OnExit EXIT And in my OnExit function I would like to capture all the info I can on what happened so I can write it to a log file. Id like to know who, why, how, ...
2
votes
2answers
122 views

Bash script to signal a concurrently running instance (same script) about a condition and increment counter

Background Here's what I want to achieve. I have a (potentially) long-running process. Now I have locking in place just fine and all is generally in order. However, since this is a scheduled job, ...
4
votes
3answers
1k views

Preventing propagation of SIGINT to Parent Process

Considering a scenario where a Parent program (could be a C++ program or a Shell Script) executes a Child shell script, when we hit Control+C (or whatever character is configured to be the INTR ...
6
votes
2answers
206 views

Decode Flags for Kill Command

I am new to Shell Scripting. I saw this Command on a Book for Linux shell Scripting $ kill -HUP 1234 >killout.txt 2>killerr.txt I know what the command does, but i am not able to understand ...
6
votes
3answers
2k views

What's the difference between Ctrl-Z and kill -STOP?

When I run a command (make on a large project) from the shell, I can type Ctrl-Z to stop the process and return to the shell. Subsequently, I can run fg to continue the process. I'm trying to write a ...
2
votes
2answers
725 views

Why can't I kill a timeout called from a Bash script with a keystroke?

[Edit: This looks similar to some other questions asking how to kill all spawned processes – the answers all seem to be to use pkill. So the core of my question may be: Is there a way to propagate ...
3
votes
3answers
889 views

Killing other user processes

There are certain user environments in which we have to login during certain performance testing and and kill all the process running in that environment. The environment names are like rswrk01, … up ...