Skip to content

Conversation

@yubiuser
Copy link
Member

Description

Tweaks three commands

  • detect the architecture using arch. Not all distros use dpkg
  • killall requires the -s|--signal flag for any signal execpt SIGTERM
  • only delete files that exist

Motivation and Context

Makes the image more portable. Mountain is coming.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Signed-off-by: Christian König <[email protected]>
@yubiuser yubiuser requested review from a team and PromoFaux May 11, 2023 20:16
Signed-off-by: Christian König <[email protected]>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@PromoFaux
Copy link
Member

  • killall requires the -s|--signal flag for any signal execpt SIGTERM

Where did you read this?

From here: https://linux.die.net/man/1/killall

Signals can be specified either by name (e.g. -HUP or -SIGHUP ) or by number (e.g. -1) or by option -s.

@PromoFaux
Copy link
Member

Where did you read this?

@yubiuser

@yubiuser
Copy link
Member Author

I didn't check the man pages, just killall --help.
I just added this change because at some point dealing with alpine based image it was complaining about killall -9 xxxx saying something about unknown argument.

But the alpine man page for killall also says

DESCRIPTION
       killall sends a signal to all processes running any of the specified
       commands.  If no signal name is specified, SIGTERM is sent.

       Signals can be specified either by name (e.g.  -HUP or -SIGHUP) or by
       number (e.g.  -1) or by option -s.

@rdwebdesign
Copy link
Member

Searching the Alpine packages, this is the package for killall:
https://pkgs.alpinelinux.org/package/v3.18/main/aarch64/psmisc

This page links to the source code (apparently the same used by Debian).

The source code shows numbers are also accepted as arguments:
https://gitlab.com/psmisc/psmisc/-/blob/master/src/killall.c#L1041-1048

@PromoFaux PromoFaux merged commit d8e3dbc into pi-hole:dev May 28, 2023
@yubiuser yubiuser deleted the tweaks branch May 28, 2023 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants