Tag Info

New answers tagged

0

Depends on what and how you build it. While trapping may be an interesting option, I imagine some environments may cause it to not work as expected. On Rails for instance, rescuing Interrupt, as well as rescuing Exception (Which Interrupt extends) will cause the program to behave "abnormally" on Interrupt signals. On Java, catching Throwable wields similar ...


1

With a perl script, it's as easy as: #!/usr/bin/perl use strict; use warnings; $SIG{'INT'} = "IGNORE"; #do stuff. I'd suggest though, rather than a script - have you consider an 'at' job? echo "sudo apt-get upgrade >> /tmp/upgrade.log" | at now Which will kick it off as task within the scheduler.


0

Set the run level to 1 (single-user / minimal mode) with: init 1ortelinit 1 More info: Red Hat Debian


0

Why don't you run your program as a background job, so there is no terminal to issue the ctrl + c interrupt. Then the only way to kill the process is by issuing sudo kill PID which would require root privileges. But if the person has root privileges than you are just out of luck in my opinion... If they have root and want to end the process they will...


1

Set the INT signal to be ignored: trap '' INT This will cause SIGINT, which is what Ctrl-C sends, to do nothing to your script. The user experience consequences of doing this are a bit unclear to me; this could be annoying if the script gets stuck in a operation that takes a long time to complete. It may be best to warn the user that the script should ...


0

Ctrl+C kills the shell as well as the FreeFem subprocess, because the SIGINT signal is sent to the whole foreground process group. Since the shell is not interactive, the subprocess runs in the same process group. See Why is SIGINT not propagated to childs process when sent to it's parent process? and What is the purpose of abstractions, session, session ...


0

Within the parent script trap the kill signal and have it kill all the children. For example, #!/bin/bash # kill the parent and children together trap "kill 0" EXIT # create all the children for n in $(seq 1 100) do ( echo "begin $n"; sleep 60; echo "end $n" ) & done # wait for the children to complete wait


0

Inside the Hurd FAQ you can find some information about this case: ?? What is the login shell? {MB} The Hurd has the concept of a not-logged in user. This user has neither user ids nor groups ids. This stems from the fact that the Hurd supports uid and gid sets and one possibility is, of course, the empty set. Rather than deny access in ...



Top 50 recent answers are included