Skip to content
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
12 changes: 9 additions & 3 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
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
systemctl try-restart choria-broker.service choria-server.service
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
12 changes: 9 additions & 3 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
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