tempo
tempo copied to clipboard
Illegal number message on Ubuntu install with tempo #1461
When installing on a fresh 20.04.1-Ubuntu instance I see the following message:
root@winning-albacore:~# sudo dpkg -i tempo_1.5.0_linux_amd64.deb && sudo apt install -f
Selecting previously unselected package tempo.
(Reading database ... 23452 files and directories currently installed.)
Preparing to unpack tempo_1.5.0_linux_amd64.deb ...
Unpacking tempo (1.5.0) ...
Setting up tempo (1.5.0) ...
Post Install of a clean install
/var/lib/dpkg/info/tempo.postinst: 21: [: Illegal number: 247 (247.3-7)
Reload the service unit from disk
Unmask the service
Set the preset flag for the service unit
Set the enabled flag for the service unit
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
root@winning-albacore:~# uname -a
Linux winning-albacore 5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 GNU/Linux
The packages are new as of this release I believe, so a little hiccup is expected I suppose. Can we see the full content of /var/lib/dpkg/info/tempo.postinst please?
yes no problem !
root@winning-albacore:~# cat /var/lib/dpkg/info/tempo.postinst
#!/bin/sh
# Based on https://nfpm.goreleaser.com/tips/
if ! command -V systemctl >/dev/null 2>&1; then
echo "Could not find systemd. Skipping system installation." && exit 0
else
systemd_version=$(systemctl --version | head -1 | sed 's/systemd //g')
fi
cleanInstall() {
printf "\033[32m Post Install of a clean install\033[0m\n"
# Create the user
if ! id tempo > /dev/null 2>&1 ; then
adduser --system --shell /bin/false "tempo"
fi
# rhel/centos7 cannot use ExecStartPre=+ to specify the pre start should be run as root
# even if you want your service to run as non root.
if [ "${systemd_version}" -lt 231 ]; then
printf "\033[31m systemd version %s is less then 231, fixing the service file \033[0m\n" "${systemd_version}"
sed -i "s/=+/=/g" /etc/systemd/system/tempo.service
fi
printf "\033[32m Reload the service unit from disk\033[0m\n"
systemctl daemon-reload ||:
printf "\033[32m Unmask the service\033[0m\n"
systemctl unmask tempo ||:
printf "\033[32m Set the preset flag for the service unit\033[0m\n"
systemctl preset tempo ||:
printf "\033[32m Set the enabled flag for the service unit\033[0m\n"
systemctl enable tempo ||:
systemctl restart tempo ||:
}
upgrade() {
:
# printf "\033[32m Post Install of an upgrade\033[0m\n"
}
action="$1"
if [ "$1" = "configure" ] && [ -z "$2" ]; then
# Alpine linux does not pass args, and deb passes $1=configure
action="install"
elif [ "$1" = "configure" ] && [ -n "$2" ]; then
# deb passes $1=configure $2=<current version>
action="upgrade"
fi
case "${action}" in
"1" | "install")
cleanInstall
;;
"2" | "upgrade")
upgrade
;;
*)
# $1 == version being installed
printf "\033[32m Alpine\033[0m"
cleanInstall
;;
esac
And the output of systemctl --version please.
done !
systemd 247 (247.3-7)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified
@julienduchesne heads up :point_up:
systemctl --version | head -1 | awk '{print $2}' maybe, though I'm not sure if awk is common enough.
This issue has been automatically marked as stale because it has not had any activity in the past 60 days. The next time this stale check runs, the stale label will be removed if there is new activity. The issue will be closed after 15 days if there is no new activity. Please apply keepalive label to exempt this Issue.