diff --git a/app/victoria-metrics/Makefile b/app/victoria-metrics/Makefile index cf763dee1..746f7ad2d 100644 --- a/app/victoria-metrics/Makefile +++ b/app/victoria-metrics/Makefile @@ -39,11 +39,11 @@ victoria-metrics-pure-prod: APP_NAME=victoria-metrics APP_SUFFIX='-pure' DOCKER_OPTS='--env CGO_ENABLED=0' $(MAKE) app-via-docker ### Packaging as DEB - amd64 -victoria-metrics-package-deb: victoria-metrics +victoria-metrics-package-deb: victoria-metrics-prod ./package/package_deb.sh amd64 ### Packaging as DEB - arm64 -victoria-metrics-package-deb-arm64: victoria-metrics-arm64 +victoria-metrics-package-deb-arm64: victoria-metrics-arm64-prod ./package/package_deb.sh arm64 ### Packaging as DEB - all @@ -52,11 +52,11 @@ victoria-metrics-package-deb-all: \ victoria-metrics-package-deb-arm64 ### Packaging as RPM - amd64 -victoria-metrics-package-rpm: victoria-metrics +victoria-metrics-package-rpm: victoria-metrics-prod ./package/package_rpm.sh amd64 ### Packaging as RPM - arm64 -victoria-metrics-package-rpm-arm64: victoria-metrics-arm64 +victoria-metrics-package-rpm-arm64: victoria-metrics-arm64-prod ./package/package_rpm.sh arm64 ### Packaging as RPM - all diff --git a/package/package_deb.sh b/package/package_deb.sh index 545a082c9..34e8fe46b 100755 --- a/package/package_deb.sh +++ b/package/package_deb.sh @@ -9,10 +9,10 @@ fi # Map to Debian architecture if [[ "$ARCH" == "amd64" ]]; then DEB_ARCH=amd64 - EXENAME_SRC="victoria-metrics" + EXENAME_SRC="victoria-metrics-prod" elif [[ "$ARCH" == "arm64" ]]; then DEB_ARCH=arm64 - EXENAME_SRC="victoria-metrics-arm64" + EXENAME_SRC="victoria-metrics-arm64-prod" else echo "*** Unknown arch $ARCH" exit 1 @@ -20,7 +20,7 @@ fi PACKDIR="./package" TEMPDIR="${PACKDIR}/temp-deb-${DEB_ARCH}" -EXENAME_DST="victoria-metrics" +EXENAME_DST="victoria-metrics-prod" # Pull in version info @@ -33,7 +33,7 @@ BUILD=`cat ${PACKDIR}/VAR_BUILD | perl -ne 'chomp and print'` mkdir -p "${TEMPDIR}" && echo "*** Created : ${TEMPDIR}" -mkdir -p "${TEMPDIR}/usr/sbin/" +mkdir -p "${TEMPDIR}/usr/local/bin/" mkdir -p "${TEMPDIR}/lib/systemd/system/" echo "*** Version : ${VERSION}-${BUILD}" @@ -45,7 +45,7 @@ echo "*** Out .deb : ${OUT_DEB}" # Copy the binary -cp "./bin/${EXENAME_SRC}" "${TEMPDIR}/usr/sbin/${EXENAME_DST}" +cp "./bin/${EXENAME_SRC}" "${TEMPDIR}/usr/local/bin/${EXENAME_DST}" # Copy supporting files diff --git a/package/package_rpm.sh b/package/package_rpm.sh index 89e21536f..5b62e3af6 100755 --- a/package/package_rpm.sh +++ b/package/package_rpm.sh @@ -15,10 +15,10 @@ fi # Map to Debian architecture if [[ "$ARCH" == "amd64" ]]; then RPM_ARCH=x86_64 - EXENAME_SRC="victoria-metrics" + EXENAME_SRC="victoria-metrics-prod" elif [[ "$ARCH" == "arm64" ]]; then RPM_ARCH=aarch64 - EXENAME_SRC="victoria-metrics-arm64" + EXENAME_SRC="victoria-metrics-arm64-prod" else echo "*** Unknown arch $ARCH" exit 1 @@ -26,7 +26,7 @@ fi PACKDIR="./package" TEMPDIR="${PACKDIR}/temp-rpm-${RPM_ARCH}" -EXENAME_DST="victoria-metrics" +EXENAME_DST="victoria-metrics-prod" # Pull in version info @@ -62,14 +62,14 @@ Requires: libc VictoriaMetrics is fast, cost-effective and scalable time series database. It can be used as a long-term remote storage for Prometheus. %files -%attr(0744, root, root) /usr/sbin/* +%attr(0744, root, root) /usr/local/bin/* %attr(0644, root, root) /lib/systemd/system/* %prep -mkdir -p \$RPM_BUILD_ROOT/usr/sbin/ +mkdir -p \$RPM_BUILD_ROOT/usr/local/bin/ mkdir -p \$RPM_BUILD_ROOT/lib/systemd/system/ -cp ${PWD}/bin/${EXENAME_SRC} \$RPM_BUILD_ROOT/usr/sbin/ +cp ${PWD}/bin/${EXENAME_SRC} \$RPM_BUILD_ROOT/usr/local/bin/${EXENAME_DST} cp ${PWD}/package/victoria-metrics.service \$RPM_BUILD_ROOT/lib/systemd/system/ %post diff --git a/package/victoria-metrics.service b/package/victoria-metrics.service index 7a740a0a2..2769399aa 100644 --- a/package/victoria-metrics.service +++ b/package/victoria-metrics.service @@ -8,7 +8,7 @@ StartLimitBurst=5 StartLimitInterval=0 Restart=on-failure RestartSec=1 -ExecStart=/usr/local/bin/victoriametrics -storageDataPath=/var/lib/victoria-metrics-data +ExecStart=/usr/local/bin/victoria-metrics-prod -storageDataPath=/var/lib/victoria-metrics-data ExecStop=/bin/kill -s SIGTERM $MAINPID LimitNOFILE=65536 LimitNPROC=32000