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

Give user option to exit post-install early in order to avoid issue with systemd on some container images. #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions build-linux/deb/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ if [ "$1" = "configure" ]; then

pycompile -p pdagent

# If you install pdagent in a container without systemd,
# but remnants of systemd exist even though they won't
# be used, like with ubuntu, the install will fail.
# Particularly annoying when building Docker images.
# Setting PDAGENT_SKIP_SERVICE_START=yes gives user the
# option to not start service after install to avoid
# this problem.
if [[ -z "${PDAGENT_SKIP_SERVICE_START}" ]]; then
exit 0
fi

if which systemctl >/dev/null; then
install_systemd
else
Expand Down
11 changes: 11 additions & 0 deletions build-linux/rpm/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ chmod -R a+r $INSTALL_PATH/root_certs
# Compile module .py to .pyc
python -m compileall -q -f "$INSTALL_PATH/"

# If you install pdagent in a container without systemd,
# but remnants of systemd exist even though they won't
# be used, like with ubuntu, the install will fail.
# Particularly annoying when building Docker images.
# Setting PDAGENT_SKIP_SERVICE_START=yes gives user the
# option to not start service after install to avoid
# this problem.
if [[ -z "${PDAGENT_SKIP_SERVICE_START}" ]]; then
exit 0
fi

if which systemctl >/dev/null; then
install_systemd
else
Expand Down