Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove shared memory files before killing the FTL process #796

Merged
merged 1 commit into from Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions s6/debian-root/etc/cont-init.d/20-start.sh
Expand Up @@ -2,7 +2,7 @@
set -e

bashCmd='bash -e'
if [ "${PH_VERBOSE:-0}" -gt 0 ] ; then
if [ "${PH_VERBOSE:-0}" -gt 0 ] ; then
set -x ;
bashCmd='bash -e -x'
fi
Expand All @@ -11,8 +11,8 @@ fi

$bashCmd /start.sh
# Gotta go fast, no time for gravity
if [ -n "$PYTEST" ]; then
sed -i 's/^gravity_spinup$/#gravity_spinup # DISABLED FOR PYTEST/g' "$(which gravity.sh)"
if [ -n "$PYTEST" ]; then
sed -i 's/^gravity_spinup$/#gravity_spinup # DISABLED FOR PYTEST/g' "$(which gravity.sh)"
fi
if [ -z "$SKIPGRAVITYONBOOT" ]; then
gravity.sh
Expand All @@ -21,6 +21,6 @@ else
fi

# Kill dnsmasq because s6 won't like it if it's running when s6 services start
kill -9 $(pgrep pihole-FTL) || true
kill -9 $(pgrep pihole-FTL) || true # TODO: REVISIT THIS SO AS TO NOT kill -9

pihole -v
2 changes: 1 addition & 1 deletion s6/debian-root/etc/services.d/pihole-FTL/finish
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bash

s6-echo "Stopping pihole-FTL"
kill -9 $(pgrep pihole-FTL)
kill -9 $(pgrep pihole-FTL) # TODO: REVISIT THIS SO AS TO NOT kill -9
3 changes: 3 additions & 0 deletions s6/debian-root/etc/services.d/pihole-FTL/run
@@ -1,6 +1,9 @@
#!/usr/bin/with-contenv bash

s6-echo "Starting pihole-FTL ($FTL_CMD) as ${DNSMASQ_USER}"
# Remove possible leftovers from previous pihole-FTL processes
rm -f /dev/shm/FTL-* 2> /dev/null
rm /run/pihole/FTL.sock 2> /dev/null
s6-setuidgid ${DNSMASQ_USER} pihole-FTL $FTL_CMD >/dev/null 2>&1

# Notes on above:
Expand Down