tempo icon indicating copy to clipboard operation
tempo copied to clipboard

Illegal number message on Ubuntu install with tempo #1461

Open clement-cli opened this issue 3 years ago • 7 comments
trafficstars

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

clement-cli avatar Aug 25 '22 14:08 clement-cli

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?

zalegrala avatar Aug 25 '22 14:08 zalegrala

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

ghost avatar Aug 25 '22 14:08 ghost

And the output of systemctl --version please.

zalegrala avatar Aug 25 '22 14:08 zalegrala

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

ghost avatar Aug 25 '22 14:08 ghost

@julienduchesne heads up :point_up:

joe-elliott avatar Aug 25 '22 15:08 joe-elliott

systemctl --version | head -1 | awk '{print $2}' maybe, though I'm not sure if awk is common enough.

zalegrala avatar Aug 26 '22 14:08 zalegrala

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.

github-actions[bot] avatar Nov 11 '22 00:11 github-actions[bot]