Skip to content

Commit

Permalink
Print journal of service if installation fails
Browse files Browse the repository at this point in the history
When a service fails to start the maintainerscript would only print a
help, not full log. This is annoying when testing in CI as there's no
way to do that and even in case of local tests it's just one more step.

This change adds a check that would print the log for service packages.
Although it won't show anything if the failure happened before starting,
this is OK, it's just debug info.
  • Loading branch information
Kixunil committed Jan 3, 2024
1 parent 6f6c9ab commit abb4eb7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/package_clean_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ package_type="${package_type["$package"]}"
# to init them at the beginning of each run due to purge being at the end.
preload_config
echo "Installing package $package" >&2
sudo apt-get install -y "$package"
if ! sudo apt-get install -y "$package";
then
if [ "$package_type" = "service" ];
then
journalctl -eu $package
fi
exit 1
fi
echo "Checking package $package" >&2
check "$package" "$package_type" "after_install"
echo "Reinstalling package $package" >&2
Expand Down

0 comments on commit abb4eb7

Please sign in to comment.