Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: kickstart.sh installs netdata to /usr/local on FreeBSD #12430

Closed
ktsaou opened this issue Mar 16, 2022 · 10 comments
Closed

[Bug]: kickstart.sh installs netdata to /usr/local on FreeBSD #12430

ktsaou opened this issue Mar 16, 2022 · 10 comments
Assignees
Labels
area/packaging Packaging and operating systems support bug os/bsd bsd os related issues

Comments

@ktsaou
Copy link
Member

ktsaou commented Mar 16, 2022

Bug description

The kickstart shows this:

# ./kickstart.sh

 --- Using /tmp/netdata-kickstart-XXXXXXXXXX.Yx5esXjV as a temporary directory. --- 
 --- No existing installations of netdata found, assuming this is a fresh install. --- 
 --- Fetching script to detect required packages... --- 
[/tmp/netdata-kickstart-XXXXXXXXXX.Yx5esXjV]# curl --fail -q -sSL --connect-timeout 10 --retry 3 --output /tmp/netdata-kickstart-XXXXXXXXXX.Yx5esXjV/install-required-packages.sh https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/install-required-packages.sh 
 OK 

 --- Running downloaded script to detect required packages... --- 
[/tmp/netdata-kickstart-XXXXXXXXXX.Yx5esXjV]# /usr/local/bin/bash /tmp/netdata-kickstart-XXXXXXXXXX.Yx5esXjV/install-required-packages.sh netdata 
 > FreeBSD Version: 12.3-RELEASE ...
 > Checking for gmake ...

We detected these:
Distribution    : freebsd
Version         : 12.3-RELEASE
Codename        : 
Package Manager : install_pkg
Packages Tree   : freebsd
Detection Method: uname
Default Python v: 3 

Searching for distro_sdk ...
Searching for autoconf_archive ...
Searching for libz_dev ...
Searching for libuuid_dev ...
Searching for libmnl_dev ...
WARNING
package libmnl-dev is not available in this system.

Searching for json_c_dev ...
Searching for libuv ...
Searching for lz4 ...
Searching for openssl ...
Searching for judy ...
Searching for libelf ...
Searching for python3 ...

All required packages are already installed. Now proceed to the next step.

 OK 

[/tmp/netdata-kickstart-XXXXXXXXXX.Yx5esXjV]# curl --fail -q -sSL --connect-timeout 10 --retry 3 --output /tmp/netdata-kickstart-XXXXXXXXXX.Yx5esXjV/sha256sum.txt https://storage.googleapis.com/netdata-nightlies/sha256sums.txt 
 OK 

[/tmp/netdata-kickstart-XXXXXXXXXX.Yx5esXjV]# curl --fail -q -sSL --connect-timeout 10 --retry 3 --output /tmp/netdata-kickstart-XXXXXXXXXX.Yx5esXjV/netdata-latest.tar.gz https://storage.googleapis.com/netdata-nightlies/netdata-latest.tar.gz 
 OK 

[/tmp/netdata-kickstart-XXXXXXXXXX.Yx5esXjV]# tar -xf /tmp/netdata-kickstart-XXXXXXXXXX.Yx5esXjV/netdata-latest.tar.gz -C /tmp/netdata-kickstart-XXXXXXXXXX.Yx5esXjV 
 OK 

 --- Building netdata --- 
[/tmp/netdata-kickstart-XXXXXXXXXX.Yx5esXjV/netdata-v1.33.1-177-gd14059673]# ./netdata-installer.sh --install-no-prefix /usr/local --auto-update --require-cloud 

  ^
  |.-.   .-.   .-.   .-.   .-.   .  netdata  .-.   .-.   .-.   .-.   .-.   .-
  |   '-'   '-'   '-'   '-'   '-'               '-'   '-'   '-'   '-'   '-'   
  +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->

 --- real-time performance monitoring, done right! --- 

  You are about to build and install netdata to your system.

  The build process will use /tmp for
  any temporary files. You can override this by setting $TMPDIR to a
  writable directory where you can execute files.

  It will be installed at these locations:

   - the daemon     at /usr/local/usr/sbin/netdata
   - config files   in /usr/local/etc/netdata
   - web files      in /usr/local/usr/share/netdata
   - plugins        in /usr/local/usr/libexec/netdata
   - cache files    in /usr/local/var/cache/netdata
   - db files       in /usr/local/var/lib/netdata
   - log files      in /usr/local/var/log/netdata
   - pid file       at /usr/local/var/run/netdata.pid
   - logrotate file at /etc/logrotate.d/netdata

  This installer allows you to change the installation path.
  Press Control-C and run the same command with --help for help.


  NOTE:
  Anonymous usage stats will be collected and sent to Netdata.
  To opt-out, pass --disable-telemetry option to the installer or export
  the environment variable DISABLE_TELEMETRY to a non-zero or non-empty value
  (e.g: export DISABLE_TELEMETRY=1).

Press ENTER to build and install netdata to '/usr/local' > 

After it finished:

# find /usr/local -name netdata
/usr/local/etc/netdata
/usr/local/usr/libexec/netdata
/usr/local/usr/lib/netdata
/usr/local/usr/share/netdata
/usr/local/usr/sbin/netdata
/usr/local/var/run/netdata
/usr/local/var/lib/netdata
/usr/local/var/cache/netdata
/usr/local/var/log/netdata

Expected behavior

I am not sure. I would expect either /opt/netdata or install it at /.

Steps to reproduce

Run kickstart.sh on FreeBSD.

Installation method

kickstart.sh

System info

# uname -a; uname -K
FreeBSD freebsd 12.3-RELEASE FreeBSD 12.3-RELEASE r371126 GENERIC  amd64
1203000

Netdata build info

# /usr/local/usr/sbin/netdata -W buildinfo
Version: netdata v1.33.1-177-nightly
Configure options:  '--prefix=/usr/local/usr' '--sysconfdir=/usr/local/etc' '--localstatedir=/usr/local/var' '--libexecdir=/usr/local/usr/libexec' '--libdir=/usr/local/usr/lib' '--with-zlib' '--with-math' '--with-user=netdata' '--enable-cloud' '--disable-dependency-tracking' '--with-bundled-protobuf' '--with-bundled-libJudy' 'CFLAGS=-O2' 'LDFLAGS='
Install type: kickstart-build
Features:
    dbengine:                   YES
    Native HTTPS:               YES
    Netdata Cloud:              YES 
    ACLK Next Generation:       YES
    ACLK-NG New Cloud Protocol: YES
    ACLK Legacy:                NO
    TLS Host Verification:      YES
    Machine Learning:           YES
    Stream Compression:         YES
Libraries:
    protobuf:                YES (bundled)
    jemalloc:                NO
    JSON-C:                  YES
    libcap:                  NO
    libcrypto:               YES
    libm:                    YES
    tcalloc:                 NO
    zlib:                    YES
Plugins:
    apps:                    YES
    cgroup Network Tracking: NO
    CUPS:                    NO
    EBPF:                    NO
    IPMI:                    NO
    NFACCT:                  NO
    perf:                    NO
    slabinfo:                NO
    Xen:                     NO
    Xen VBD Error Tracking:  NO
Exporters:
    AWS Kinesis:             NO
    GCP PubSub:              NO
    MongoDB:                 NO
    Prometheus Remote Write: NO

Additional info

No response

@ktsaou ktsaou added bug needs triage Issues which need to be manually labelled labels Mar 16, 2022
@ilyam8 ilyam8 added the os/bsd bsd os related issues label Mar 16, 2022
@ilyam8
Copy link
Member

ilyam8 commented Mar 16, 2022

Just additional info to the OP:

/usr/local is the default install prefix on FreeBSD when --install is not provided.

confirm_install_prefix() {
if [ -n "${INSTALL_PREFIX}" ] && [ "${NETDATA_ONLY_BUILD}" -ne 1 ]; then
fatal "The \`--install\` option is only supported together with the \`--only-build\` option." F0204
fi
if [ -n "${INSTALL_PREFIX}" ]; then
NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} --install ${INSTALL_PREFIX}"
else
case "${SYSTYPE}" in
Darwin)
INSTALL_PREFIX="/usr/local/netdata"
NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} --install-no-prefix ${INSTALL_PREFIX}"
;;
FreeBSD)
INSTALL_PREFIX="/usr/local"
NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} --install-no-prefix ${INSTALL_PREFIX}"

@ilyam8 ilyam8 added the area/packaging Packaging and operating systems support label Mar 16, 2022
@ktsaou
Copy link
Member Author

ktsaou commented Mar 16, 2022

/usr/local is the default install prefix on FreeBSD when --install is not provided.

Why?

@Ferroin
Copy link
Member

Ferroin commented Mar 16, 2022

/usr/local is the default install prefix on FreeBSD when --install is not provided.

Why?

Because /opt is not a standard install prefix for anything on FreeBSD, and NOTHING should be installing in / directly on FreeBSD (even native packages install under /usr/local, / is only for core OS components).

@Ferroin
Copy link
Member

Ferroin commented Mar 16, 2022

To clarify further, this is expected behavior for normal FreeBSD users, and was specifically requested by them.

@ktsaou
Copy link
Member Author

ktsaou commented Mar 16, 2022

To clarify further, this is expected behavior for normal FreeBSD users, and was specifically requested by them.

ok, great! The way we install it is it right? Like /usr/local/usr/sbin/netdata ?

@MikeJakubik
Copy link

This is the correct location based on FreeBSD standards, either use the port or this script, but not both. Please don't pollute heir with Linux dirs like /opt.

https://www.freebsd.org/cgi/man.cgi?hier(7)

@ilyam8 ilyam8 added wontfix and removed needs triage Issues which need to be manually labelled labels Mar 17, 2022
@ilyam8
Copy link
Member

ilyam8 commented Mar 17, 2022

Closing the issue because using /usr/local as install prefix is the correct way. Thanks @MikeJakubik and @Ferroin.

@ilyam8 ilyam8 closed this as completed Mar 17, 2022
@Ferroin
Copy link
Member

Ferroin commented Mar 17, 2022

Reopening, because if we’re dumping things in /usr/local/usr/sbin then that is blatantly wrong, but for different reasons from why the issue was originally opened...

@Ferroin Ferroin reopened this Mar 17, 2022
@ilyam8 ilyam8 removed the wontfix label Mar 17, 2022
@Ferroin
Copy link
Member

Ferroin commented May 17, 2022

@netdata/agent @cpipilas This one will need changes in the build system to fix. More specifically, when installing under a prefix, we should not be installing things into ${PREFIX}/usr/, and any directories we would put under there should be directly under ${PREFIX}/ instead.

@Ferroin
Copy link
Member

Ferroin commented Jun 28, 2022

Closing this in favor of #13242, which more concretely explains the specific issue that this was being kept open for.

@Ferroin Ferroin closed this as completed Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/packaging Packaging and operating systems support bug os/bsd bsd os related issues
Projects
None yet
Development

No branches or pull requests

4 participants