make.sh: SIGKILL and SIGSTOP cannot be trapped

Message ID 761d02cc-e6cb-d6b4-426f-00ebaa993f83@ipfire.org
State Accepted
Commit db9ba592ca4b6d3fe2ae7e1c9a9057aacb25fe22
Headers
Series make.sh: SIGKILL and SIGSTOP cannot be trapped |

Commit Message

Peter Müller Feb. 16, 2022, 5:24 p.m. UTC
  There is no sense in instructing "trap" to catch signals it cannot trap
whatsoever.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 make.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Michael Tremer Feb. 16, 2022, 5:25 p.m. UTC | #1
Hello,

Is this a cosmetic change or does this fix a real world problem?

-Michael

> On 16 Feb 2022, at 17:24, Peter Müller <peter.mueller@ipfire.org> wrote:
> 
> There is no sense in instructing "trap" to catch signals it cannot trap
> whatsoever.
> 
> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
> ---
> make.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/make.sh b/make.sh
> index 4dd068e4b..c06b4ec38 100755
> --- a/make.sh
> +++ b/make.sh
> @@ -437,7 +437,7 @@ prepareenv() {
> 	fi
> 
> 	# Trap on emergency exit
> -	trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGKILL SIGSTOP SIGQUIT
> +	trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGQUIT
> 
> 	# Checking if running as root user
> 	if [ $(id -u) -ne 0 ]; then
> -- 
> 2.34.1
  
Peter Müller Feb. 16, 2022, 5:27 p.m. UTC | #2
Hello Michael,

rather cosmetic. shellcheck complains about this, and I was wondering why
a SIGSTOP'ed build caused my workstation to malfunction until a reboot the
other way.

The current "trap" command just arises false expectations... :-)

Thanks, and best regards,
Peter Müller

> Hello,
> 
> Is this a cosmetic change or does this fix a real world problem?
> 
> -Michael
> 
>> On 16 Feb 2022, at 17:24, Peter Müller <peter.mueller@ipfire.org> wrote:
>>
>> There is no sense in instructing "trap" to catch signals it cannot trap
>> whatsoever.
>>
>> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
>> ---
>> make.sh | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/make.sh b/make.sh
>> index 4dd068e4b..c06b4ec38 100755
>> --- a/make.sh
>> +++ b/make.sh
>> @@ -437,7 +437,7 @@ prepareenv() {
>> 	fi
>>
>> 	# Trap on emergency exit
>> -	trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGKILL SIGSTOP SIGQUIT
>> +	trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGQUIT
>>
>> 	# Checking if running as root user
>> 	if [ $(id -u) -ne 0 ]; then
>> -- 
>> 2.34.1
>
  
Michael Tremer Feb. 16, 2022, 5:29 p.m. UTC | #3
Okay. Thank you for the explanation.

Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>

> On 16 Feb 2022, at 17:27, Peter Müller <peter.mueller@ipfire.org> wrote:
> 
> Hello Michael,
> 
> rather cosmetic. shellcheck complains about this, and I was wondering why
> a SIGSTOP'ed build caused my workstation to malfunction until a reboot the
> other way.
> 
> The current "trap" command just arises false expectations... :-)
> 
> Thanks, and best regards,
> Peter Müller
> 
>> Hello,
>> 
>> Is this a cosmetic change or does this fix a real world problem?
>> 
>> -Michael
>> 
>>> On 16 Feb 2022, at 17:24, Peter Müller <peter.mueller@ipfire.org> wrote:
>>> 
>>> There is no sense in instructing "trap" to catch signals it cannot trap
>>> whatsoever.
>>> 
>>> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
>>> ---
>>> make.sh | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/make.sh b/make.sh
>>> index 4dd068e4b..c06b4ec38 100755
>>> --- a/make.sh
>>> +++ b/make.sh
>>> @@ -437,7 +437,7 @@ prepareenv() {
>>> 	fi
>>> 
>>> 	# Trap on emergency exit
>>> -	trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGKILL SIGSTOP SIGQUIT
>>> +	trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGQUIT
>>> 
>>> 	# Checking if running as root user
>>> 	if [ $(id -u) -ne 0 ]; then
>>> -- 
>>> 2.34.1
>>
  

Patch

diff --git a/make.sh b/make.sh
index 4dd068e4b..c06b4ec38 100755
--- a/make.sh
+++ b/make.sh
@@ -437,7 +437,7 @@  prepareenv() {
 	fi
 
 	# Trap on emergency exit
-	trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGKILL SIGSTOP SIGQUIT
+	trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGQUIT
 
 	# Checking if running as root user
 	if [ $(id -u) -ne 0 ]; then