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

(#2204) container images typically don't have systemd, this should allow the choria package to be installed on those images. #2203

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 12 additions & 6 deletions packager/templates/debian/generic/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ action="$1"
if [ "$action" = configure ]; then
old_version="$2"

if [ -z "$old_version" ]; then
systemctl enable choria-server.service
else
systemctl try-restart choria-broker.service choria-server.service
fi
fi
if command -v systemctl 2>&1 >/dev/null
then
if [ -z "$old_version" ]; then
systemctl enable choria-server.service
else
systemctl try-restart choria-broker.service choria-server.service
fi
else
echo "systemctl could not be found, skipping service start."
exit 0
fi
fi
8 changes: 7 additions & 1 deletion packager/templates/debian/generic/postrm
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/bin/sh

systemctl daemon-reload
if command -v systemctl 2>&1 >/dev/null
then
systemctl daemon-reload
else
echo "systemctl could not be found, skipping daemon reload."
exit 0
fi
14 changes: 10 additions & 4 deletions packager/templates/debian/generic/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

action="$1"

if [ "$action" = remove ]; then
systemctl --no-reload disable choria-server.service choria-broker.service
systemctl stop choria-server.service choria-broker.service
fi
if command -v systemctl 2>&1 >/dev/null
then
if [ "$action" = remove ]; then
systemctl --no-reload disable choria-server.service choria-broker.service
systemctl stop choria-server.service choria-broker.service
fi
else
echo "systemctl could not be found, skipping service disable & remove."
exit 0
fi