Review of freshly installed Fedora 27 KDE Plasma Desktop

After the tutorial of Install Fedora 27 KDE Plasma Desktop this tutorial is mainly to see what to expect from a freshly installed Fedora 27 KDE Plasma Desktop – the look and feel of the new KDE GUI (version 5.12 of KDE Plasma).
The idea of this tutorial is just to see what to expect from Fedora 27 KDE Plasmathe look and feel of the GUI, the default installed programs and their look and how to do some basic steps with them, it is included also screenshots of the KDE settings program. Here you’ll find more than 160 screenshots and not so many text we do not want to turn this review of many text and version information and 3 meaningless screenshot, which you cannot see anything for the user interface, which these days is the primary goal of a Desktop system. You can expect more of this kind reviews in the future…

SCREENSHOT 1) Select and boot Fedora 27 KDE Plasma Desktop from our installed operating systems in grub menu

main menu
Fedora 27 KDE Plasma Desktop in the grub menu

Keep on reading!

Install Fedora 27 LXDE Desktop

This tutorial will show you the simple steps of installing a modern Linux Distribution like Fedora 27 LXDE for the user graphical interface. LXDE stands for Lightweight X11 Desktop Environment and it has comparatively low resource requirements. This GUI is good for using with older hardware. First we present the basic steps for installing the Operating system in addition to your present operating systems (here we have two: Windows 10 and Ubuntu 17) and then you can see some screenshots of the installed system and the look and feel of it. We have another tutorials showing more screenshots of the installed and working Fedora 27 LXDE (Gnome and KDE plasma) – so you can decide which of them to try first – coming soon. All of the installation setups are very similar for all GUIs of Fedora 27 it loads a live edition of the version of Fedora 27 you install and then the setup is launched by the user, the setup almost identical in all editions, but we do not want to give you a tutorials with “spaghetti” and unstructured flow of steps to follow.

We used the following ISO for the installation process:

https://download.fedoraproject.org/pub/fedora/linux/releases/27/Spins/x86_64/iso/Fedora-LXDE-Live-x86_64-27-1.6.iso

It is a LIVE image so you can try it before installing. The easiest way is just to download the image and burn it to a DVD disk and then follow the installation below:

STEP 1) The system is resetting

main menu
The system is resetting

Keep on reading!

Install Fedora 27 KDE Plasma Desktop

This tutorial will show you the simple steps of installing a modern Linux Distribution like Fedora 27 KDE Plasma Desktop for the user graphical interface. First we present the basic steps for installing the Operating system in addition to your present operating systems (here we have two: Windows 10 and Ubuntu 17) and then you can see some screenshots of the installed system and the look and feel of it. We have another tutorials showing more screenshots of the installed and working Fedora 27 KDE Plasma Desktop (Gnome and KDE plasma) – so you can decide which of them to try first – coming soon.
All of the installation setups are very similar for all GUIs of Fedora 27 it loads a live edition of the version of Fedora 27 you install and then the setup is launched by the user, the setup almost identical in all edition, but we do not want to give you a tutorials with “spaghetti” and unstructured flow of steps to follow.

We used the following ISO for the installation process:

https://download.fedoraproject.org/pub/fedora/linux/releases/27/Spins/x86_64/iso/Fedora-KDE-Live-x86_64-27-1.6.iso

It is a LIVE image so you can try it before installing. The easiest way is just to download the image and burn it to a DVD disk and then follow the installation below:

The first 3 steps show how to enable the DVD-ROM to be first bootable device. If you’ve done it you can skip these steps.

STEP 1) Select your DVD-ROM device to boot (or USB device the installation stick) UEFI: DVD to install Fedora 27 KDE Plasma Desktop

main menu
Select DVD-ROM to boot from it in your BIOS
Keep on reading!

Install Fedora Workstation 27 (Gnome GUI)

This tutorial will show you the simple steps of installing a modern Linux Distribution like Fedora 27 Workstation with Gnome for the user graphical interface. First we present the basic steps for installing the Operating system in addition to your present operating systems (here we have two: Windows 10 and Ubuntu 17) and then you can see some screenshots of the installed system and the look and feel of it. We have another tutorials showing more screenshots of the installed and working Fedora 27 (Gnome and KDE plasma) – so you can decide which of them to try first – coming soon.

We used the following ISO for the installation process:

https://download.fedoraproject.org/pub/fedora/linux/releases/27/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-27-1.6.iso

It is a LIVE image so you can try it before installing. The easiest way is just to download the image and burn it to a DVD disk and then follow the installation below:

STEP 1) Boot your machine from the CD or USB (whatever you made for the installation device)

main menu
Booting the machine

Keep on reading!

Install netdata monitoring in CentOS 7

netdata became a great tool for admins to monitor in real time their servers!
At first it was just an additional not mandatory tool to check what’s going on with the servers for the last hour or so, but it evolved to really handy and informative monitoring server tracking every seconds what is going on with the server and server’s most used services like database, web, application service.
Today in version 1.9 (this installation howto is for netdata 1.9) it could track activity at least of this services:

apache          hddtemp          postgres
beanstalk       haproxy          rabbitmq
ceph            isc_dhcpd        retroshare
bind_rndc       ipfs             redis
couchdb         memcached        sensors
chrony          mdstat           samba
cpufreq         mongodb          squid
dns_query_time  nginx            springboot
dnsdist         mysql            smartd_log
elasticsearch   nsd              tomcat
dovecot         nginx_plus       web_log
exim            ovpn_status_log  varnish
example         ntpd             fronius
freeradius      postfix          named
fail2ban        phpfpm           snmp
go_expvar       powerdns         stiebeleltron

And some of these plugins support multiple programs and services, for example web_log supports the access/error logs of the major web servers at the moment.

The installation is really simple netdata includes a script to facilitate the installation process.
Here are the minimal steps to install this great software:

STEP 1) Install dependencies, because will pull it from the official repository we also need git command

yum install -y git gcc make autoconf automake pkgconfig zlib-devel libuuid-devel curl nodejs freeipmi freeipmi-devel elfutils-libelf cmake openssl-devel libuv-devel

As you can see there is a nodejs packet, which depends on additional repository (you could skip this, just the modules, which depends on nodejs won’t work, as if now only the plugins using nodejs are located in “/etc/netdata/node.d/” and they are not so many).

yum -y install epel-release
yum -y install nodejs

STEP 2) Clone the netdata repository

cd
git clone https://github.com/firehol/netdata

STEP 3) Instal netdata

cd netdata
CFLAGS="-march=native -O2 -msse3 -fomit-frame-pointer -pipe" ./netdata-installer.sh --install /usr/local/netdata

Install the netdata software in a separate directory and if you clean the system, just delete this directory. The example above uses

/usr/local/netdata

all files will be installed there.
As you can see the installation output the path of your files

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

STEP 4) USE firewall and open the port 19999 of your server to check e able to load the monitoring page

firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="<YOURIP>" port protocol="tcp" port="19999" accept"
firewall-cmd --add-rich-rule="rule family="ipv4" source address="<YOURIP>" port protocol="tcp" port="19999" accept"

Because firewalld is the default firewall under CentOS 7 we used it ot show you how to let your IP access netdata web – replace with your current trusted IP.

* The installation process creates start/stop unit files for systemd and tells you how to update it (even you can run it automatically in a cron job)

To stop netdata run:
  systemctl stop netdata
To start netdata run:
  systemctl start netdata
 
Uninstall script generated: ./netdata-uninstaller.sh
Update script generated   : ./netdata-updater.sh
 
netdata-updater.sh can work from cron. It will trigger an email from cron
only if it fails (it does not print anything when it can update netdata).
Run this to automatically check and install netdata updates once per day:
 
sudo ln -s /root/netdata/netdata-updater.sh /etc/cron.daily/netdata-updater

* Here is the output of an installation help menu – it also hints the dependencies it may need:

[root@srv.local netdata]# ./netdata-installer.sh --help

  ^
  |.-.   .-.   .-.   .-.   .-.   .  netdata                          .-.   .-
  |   '-'   '-'   '-'   '-'   '-'   installer command line options  '   '-'  
  +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->


./netdata-installer.sh <installer options>

Valid <installer options> are:

   --install /PATH/TO/INSTALL

        If you give: --install /opt
        netdata will be installed in /opt/netdata

   --dont-start-it

        Do not (re)start netdata.
        Just install it.

   --dont-wait

        Do not wait for the user to press ENTER.
        Start immediately building it.

   --auto-update | -u

        Install netdata-updater to cron,
        to update netdata automatically once per day
        (can only be done for installations from git)

   --enable-plugin-freeipmi
   --disable-plugin-freeipmi

        Enable/disable the FreeIPMI plugin.
        Default: enable it when libipmimonitoring is available.

   --enable-plugin-nfacct
   --disable-plugin-nfacct

        Enable/disable the nfacct plugin.
        Default: enable it when libmnl and libnetfilter_acct are available.

   --enable-lto
   --disable-lto

        Enable/disable Link-Time-Optimization
        Default: enabled

   --zlib-is-really-here
   --libs-are-really-here

        If you get errors about missing zlib,
        or libuuid but you know it is available,
        you have a broken pkg-config.
        Use this option to allow it continue
        without checking pkg-config.

Netdata will by default be compiled with gcc optimization -O2
If you need to pass different CFLAGS, use something like this:

  CFLAGS="<gcc options>" ./netdata-installer.sh <installer options>

For the installer to complete successfully, you will need
these packages installed:

   gcc make autoconf automake pkg-config zlib1g-dev (or zlib-devel)
   uuid-dev (or libuuid-devel)

For the plugins, you will at least need:

   curl, bash v4+, python v2 or v3, node.js

* netdata in action

main menu
All real-time monitoring plugins, System Overview opened

main menu
Memory details

main menu
PHP-FPM local details

* And here is the output of an installation process:

[root@lsrv3 netdata]# CFLAGS="-march=native -O2 -msse3 -fomit-frame-pointer -pipe" ./netdata-installer.sh --install /usr/local/netdata

  ^
  |.-.   .-.   .-.   .-.   .  netdata                                        
  |   '-'   '-'   '-'   '-'   real-time performance monitoring, done right!  
  +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->


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

  It will be installed at these locations:

   - the daemon     at /usr/local/netdata/netdata/usr/sbin/netdata
   - config files   in /usr/local/netdata/netdata/etc/netdata
   - web files      in /usr/local/netdata/netdata/usr/share/netdata
   - plugins        in /usr/local/netdata/netdata/usr/libexec/netdata
   - cache files    in /usr/local/netdata/netdata/var/cache/netdata
   - db files       in /usr/local/netdata/netdata/var/lib/netdata
   - log files      in /usr/local/netdata/netdata/var/log/netdata
   - pid file       at /usr/local/netdata/netdata/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.

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

 --- Run autotools to configure the build environment --- 
[/root/netdata]# ./autogen.sh 
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
 OK   

[/root/netdata]# ./configure --prefix=/usr/local/netdata/netdata/usr --sysconfdir=/usr/local/netdata/netdata/etc --localstatedir=/usr/local/netdata/netdata/var --with-zlib --with-math --with-user=netdata CFLAGS=-march=native\ -O2\ -msse3\ -fomit-frame-pointer\ -pipe 
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for __attribute__((returns_nonnull))... no
checking for __attribute__((malloc))... yes
checking for __attribute__((noreturn))... yes
checking for __attribute__((noinline))... yes
checking for __attribute__((format))... yes
checking for __attribute__((warn_unused_result))... yes
checking for struct timespec... yes
checking for clockid_t... yes
checking for library containing clock_gettime... none required
checking for clock_gettime... yes
checking for sched_setscheduler... yes
checking for sched_get_priority_min... yes
checking for sched_get_priority_max... yes
checking for nice... yes
checking for recvmmsg... yes
checking for int8_t... yes
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for inline... inline
checking whether strerror_r is declared... yes
checking for strerror_r... yes
checking whether strerror_r returns char *... yes
checking for _Generic... no
checking for __atomic... yes
checking size of void *... 8
checking whether sys/types.h defines makedev... yes
checking for sys/types.h... (cached) yes
checking for netinet/in.h... yes
checking for arpa/nameser.h... yes
checking for netdb.h... yes
checking for resolv.h... yes
checking for sys/prctl.h... yes
checking for linux/netfilter/nfnetlink_conntrack.h... yes
checking for accept4... yes
checking operating system... linux
checking if compiler needs -Werror to reject unknown flags... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking for sin in -lm... yes
checking if libm should be used... yes
checking for ZLIB... yes
checking if zlib should be used... yes
checking for UUID... yes
checking for memory allocator... system
checking for mallopt... yes
checking for mallinfo... yes
checking for LIBCAP... no
checking if libcap should be used... no
checking if apps.plugin should be enabled... yes
checking for IPMIMONITORING... yes
checking for
        ipmi_monitoring_sensor_readings_by_record_id,
        ipmi_monitoring_sensor_readings_by_sensor_type,
        ipmi_monitoring_sensor_read_sensor_number,
        ipmi_monitoring_sensor_read_sensor_name,
        ipmi_monitoring_sensor_read_sensor_state,
        ipmi_monitoring_sensor_read_sensor_units,
        ipmi_monitoring_sensor_iterator_next,
        ipmi_monitoring_ctx_sensor_config_file,
        ipmi_monitoring_ctx_sdr_cache_directory,
        ipmi_monitoring_ctx_errormsg,
        ipmi_monitoring_ctx_create
     in -lipmimonitoring... yes
checking ipmi_monitoring.h usability... yes
checking ipmi_monitoring.h presence... yes
checking for ipmi_monitoring.h... yes
checking ipmi_monitoring_bitmasks.h usability... yes
checking ipmi_monitoring_bitmasks.h presence... yes
checking for ipmi_monitoring_bitmasks.h... yes
checking if freeipmi.plugin should be enabled... yes
checking for NFACCT... no
checking for LIBMNL... no
checking if nfacct.plugin should be enabled... no
checking for setns... yes
checking if cgroup-network can be enabled... yes
checking whether C compiler accepts -flto... yes
checking if -flto builds executables... yes
checking if LTO should be enabled... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating charts.d/Makefile
config.status: creating conf.d/Makefile
config.status: creating netdata.spec
config.status: creating python.d/Makefile
config.status: creating node.d/Makefile
config.status: creating plugins.d/Makefile
config.status: creating src/Makefile
config.status: creating system/Makefile
config.status: creating web/Makefile
config.status: creating diagrams/Makefile
config.status: creating makeself/Makefile
config.status: creating contrib/Makefile
config.status: creating tests/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
 OK   

 --- Cleanup compilation directory --- 
 --- Compile netdata --- 
[/root/netdata]# make -j8 
make  all-recursive
make[1]: Entering directory `/root/netdata'
Making all in charts.d
make[2]: Entering directory `/root/netdata/charts.d'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/netdata/charts.d'
Making all in conf.d
make[2]: Entering directory `/root/netdata/conf.d'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/netdata/conf.d'
Making all in diagrams
make[2]: Entering directory `/root/netdata/diagrams'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/netdata/diagrams'
Making all in makeself
make[2]: Entering directory `/root/netdata/makeself'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/netdata/makeself'
Making all in node.d
make[2]: Entering directory `/root/netdata/node.d'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/netdata/node.d'
Making all in plugins.d
make[2]: Entering directory `/root/netdata/plugins.d'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/netdata/plugins.d'
Making all in python.d
make[2]: Entering directory `/root/netdata/python.d'
if sed \
        -e 's#[@]localstatedir_POST@#/usr/local/netdata/netdata/var#g' \
        -e 's#[@]sbindir_POST@#/usr/local/netdata/netdata/usr/sbin#g' \
        -e 's#[@]sysconfdir_POST@#/usr/local/netdata/netdata/etc#g' \
        -e 's#[@]pythondir_POST@#/usr/local/netdata/netdata/usr/libexec/netdata/python.d#g' \
        python-modules-installer.sh.in > python-modules-installer.sh.tmp; then \
        mv "python-modules-installer.sh.tmp" "python-modules-installer.sh"; \
else \
        rm -f "python-modules-installer.sh.tmp"; \
        false; \
fi
make[2]: Leaving directory `/root/netdata/python.d'
Making all in src
make[2]: Entering directory `/root/netdata/src'
gcc -DHAVE_CONFIG_H -I. -I..  -DVARLIB_DIR="\"/usr/local/netdata/netdata/var/lib/netdata\"" -DCACHE_DIR="\"/usr/local/netdata/netdata/var/cache/netdata\"" -DCONFIG_DIR="\"/usr/local/netdata/netdata/etc/netdata\"" -DLOG_DIR="\"/usr/local/netdata/netdata/var/log/netdata\"" -DPLUGINS_DIR="\"/usr/local/netdata/netdata/usr/libexec/netdata/plugins.d\"" -DRUN_DIR="\"/usr/local/netdata/netdata/var/run/netdata\"" -DWEB_DIR="\"/usr/local/netdata/netdata/usr/share/netdata/web\""          -march=native -O2 -msse3 -fomit-frame-pointer -pipe -pthread -flto -MT apps_plugin.o -MD -MP -MF .deps/apps_plugin.Tpo -c -o apps_plugin.o apps_plugin.c
make[2]: Leaving directory `/root/netdata'
make[1]: Leaving directory `/root/netdata'
 OK   

 --- Restore user edited netdata configuration files --- 
 --- Fix generated files permissions --- 
[/root/netdata]# find ./system/ -type f -a \! -name \*.in -a \! -name Makefile\* -a \! -name \*.conf -a \! -name \*.service -a \! -name \*.logrotate -exec chmod 755 \{\} \; 
 OK   

 --- Add user netdata to required user groups --- 
Adding netdata user group ...
[/root/netdata]# groupadd -r netdata 
 OK   

Adding netdata user account with home /usr/local/netdata/netdata ...
[/root/netdata]# useradd -r -g netdata -c netdata -s /usr/sbin/nologin --no-create-home -d /usr/local/netdata/netdata netdata 
 OK   

Group 'docker' does not exist.
Adding netdata user to the nginx group ...
[/root/netdata]# usermod -a -G nginx netdata 
 OK   

Group 'varnish' does not exist.
Adding netdata user to the haproxy group ...
[/root/netdata]# usermod -a -G haproxy netdata 
 OK   

Adding netdata user to the adm group ...
[/root/netdata]# usermod -a -G adm netdata 
 OK   

Group 'nsd' does not exist.
Group 'proxy' does not exist.
Group 'squid' does not exist.
Group 'ceph' does not exist.
 --- Install logrotate configuration for netdata --- 
[/root/netdata]# cp system/netdata.logrotate /etc/logrotate.d/netdata 
 OK   

[/root/netdata]# chmod 644 /etc/logrotate.d/netdata 
 OK   

 --- Read installation options from netdata.conf --- 

    Permissions
    - netdata user     : netdata
    - netdata group    : netdata
    - web files user   : netdata
    - web files group  : netdata
    - root user        : root

    Directories
    - netdata conf dir : /usr/local/netdata/netdata/etc/netdata
    - netdata log dir  : /usr/local/netdata/netdata/var/log/netdata
    - netdata run dir  : /usr/local/netdata/netdata/var/run
    - netdata lib dir  : /usr/local/netdata/netdata/var/lib/netdata
    - netdata web dir  : /usr/local/netdata/netdata/usr/share/netdata/web
    - netdata cache dir: /usr/local/netdata/netdata/var/cache/netdata

    Other
    - netdata port     : 19999

 --- Fix permissions of netdata directories (using user 'netdata') --- 
[/root/netdata]# mkdir -p /usr/local/netdata/netdata/var/run 
 OK   

[/root/netdata]# chown -R root:netdata /usr/local/netdata/netdata/etc/netdata 
 OK   

[/root/netdata]# find /usr/local/netdata/netdata/etc/netdata -type f -exec chmod 0640 \{\} \; 
 OK   

[/root/netdata]# find /usr/local/netdata/netdata/etc/netdata -type d -exec chmod 0755 \{\} \; 
 OK   

[/root/netdata]# chown -R netdata:netdata /usr/local/netdata/netdata/usr/share/netdata/web 
 OK   

[/root/netdata]# find /usr/local/netdata/netdata/usr/share/netdata/web -type f -exec chmod 0664 \{\} \; 
 OK   

[/root/netdata]# find /usr/local/netdata/netdata/usr/share/netdata/web -type d -exec chmod 0775 \{\} \; 
 OK   

[/root/netdata]# chown -R netdata:netdata /usr/local/netdata/netdata/var/lib/netdata 
 OK   

[/root/netdata]# chown -R netdata:netdata /usr/local/netdata/netdata/var/cache/netdata 
 OK   

[/root/netdata]# chown -R netdata:netdata /usr/local/netdata/netdata/var/log/netdata 
 OK   

[/root/netdata]# chmod 755 /usr/local/netdata/netdata/var/log/netdata 
 OK   

[/root/netdata]# chown netdata:root /usr/local/netdata/netdata/var/log/netdata 
 OK   

[/root/netdata]# chown -R root /usr/local/netdata/netdata/usr/libexec/netdata 
 OK   

[/root/netdata]# find /usr/local/netdata/netdata/usr/libexec/netdata -type d -exec chmod 0755 \{\} \; 
 OK   

[/root/netdata]# find /usr/local/netdata/netdata/usr/libexec/netdata -type f -exec chmod 0644 \{\} \; 
 OK   

[/root/netdata]# find /usr/local/netdata/netdata/usr/libexec/netdata -type f -a -name \*.plugin -exec chmod 0755 \{\} \; 
 OK   

[/root/netdata]# find /usr/local/netdata/netdata/usr/libexec/netdata -type f -a -name \*.sh -exec chmod 0755 \{\} \; 
 OK   

[/root/netdata]# chown root:netdata /usr/local/netdata/netdata/usr/libexec/netdata/plugins.d/apps.plugin 
 OK   

[/root/netdata]# chmod 0750 /usr/local/netdata/netdata/usr/libexec/netdata/plugins.d/apps.plugin 
 OK   

[/root/netdata]# setcap cap_dac_read_search\,cap_sys_ptrace+ep /usr/local/netdata/netdata/usr/libexec/netdata/plugins.d/apps.plugin 
 OK   

[/root/netdata]# chown root:netdata /usr/local/netdata/netdata/usr/libexec/netdata/plugins.d/freeipmi.plugin 
 OK   

[/root/netdata]# chmod 4750 /usr/local/netdata/netdata/usr/libexec/netdata/plugins.d/freeipmi.plugin 
 OK   

[/root/netdata]# chown root:netdata /usr/local/netdata/netdata/usr/libexec/netdata/plugins.d/cgroup-network 
 OK   

[/root/netdata]# chmod 4750 /usr/local/netdata/netdata/usr/libexec/netdata/plugins.d/cgroup-network 
 OK   

[/root/netdata]# chown root /usr/local/netdata/netdata/usr/libexec/netdata/plugins.d/cgroup-network-helper.sh 
 OK   

[/root/netdata]# chmod 0550 /usr/local/netdata/netdata/usr/libexec/netdata/plugins.d/cgroup-network-helper.sh 
 OK   

[/root/netdata]# chmod a+rX /usr/local/netdata/netdata/usr/libexec 
 OK   

[/root/netdata]# chmod a+rX /usr/local/netdata/netdata/usr/share/netdata 
 OK   

 --- Install netdata at system init --- 
Installing systemd service...
[/root/netdata]# cp system/netdata.service /etc/systemd/system/netdata.service 
 OK   

[/root/netdata]# systemctl daemon-reload 
 OK   

[/root/netdata]# systemctl enable netdata 
Created symlink from /etc/systemd/system/multi-user.target.wants/netdata.service to /etc/systemd/system/netdata.service.
 OK   

 --- Start netdata --- 
[/root/netdata]# /usr/bin/systemctl stop netdata 
 OK   

[/root/netdata]# /usr/bin/systemctl restart netdata 
 OK   

OK. NetData Started!


-------------------------------------------------------------------------------

Downloading default configuration from netdata...
[/root/netdata]# curl -s -o /usr/local/netdata/netdata/etc/netdata/netdata.conf.new http://localhost:19999/netdata.conf 
 OK   

[/root/netdata]# mv /usr/local/netdata/netdata/etc/netdata/netdata.conf.new /usr/local/netdata/netdata/etc/netdata/netdata.conf 
 OK   

 OK  New configuration saved for you to edit at /usr/local/netdata/netdata/etc/netdata/netdata.conf 

[/root/netdata]# chown netdata /usr/local/netdata/netdata/etc/netdata/netdata.conf 
 OK   

[/root/netdata]# chmod 0664 /usr/local/netdata/netdata/etc/netdata/netdata.conf 
 OK   

 --- Check KSM (kernel memory deduper) --- 
 --- Check version.txt --- 
 --- Check apps.plugin --- 
 --- Generate netdata-uninstaller.sh --- 
 --- Basic netdata instructions --- 

netdata by default listens on all IPs on port 19999,
so you can access it with:

  http://this.machine.ip:19999/

To stop netdata run:

  systemctl stop netdata

To start netdata run:

  systemctl start netdata


Uninstall script generated: ./netdata-uninstaller.sh
Update script generated   : ./netdata-updater.sh

netdata-updater.sh can work from cron. It will trigger an email from cron
only if it fails (it does not print anything when it can update netdata).
Run this to automatically check and install netdata updates once per day:

sudo ln -s /root/netdata/netdata-updater.sh /etc/cron.daily/netdata-updater

 --- We are done! --- 

  ^
  |.-.   .-.   .-.   .-.   .-.   .  netdata                          .-.   .-
  |   '-'   '-'   '-'   '-'   '-'   is installed and running now!  -'   '-'  
  +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->

  enjoy real-time performance and health monitoring...

Install GO language in Ubuntu 16 LTS from the official site package

Ubuntu 16 LTS comes with too old GO language version, the version in the official repository is

golang-1.6.

Many programs released past couple of years depend on go lang 1.7+, so 1.6 in Ubuntu 16 LTS is really obsolete. At present the latest version is 1.9, so we’ll show you simple steps to install the go lang on your ubuntu 16 lts server

STEP 1) Get root if you want to install it globally to be used from any user!

sudo su
cd

STEP 2) Download the GO language binaries from the official site

https://golang.org/dl/

And copy the URL link of the program from the Linux section, now it has the following text:

Linux 2.6.23 or later, Intel 64-bit processor
go1.10.linux-amd64.tar.gz (114MB)

And download it with wget:

wget https://dl.google.com/go/go1.9.4.linux-amd64.tar.gz

STEP 4) Uncompress the file with “tar”

tar xzvf go1.9.4.linux-amd64.tar.gz

STEP 5) Move the files in “/usr/local/go”

you could put the installation anywhere, but most manual installed programs go to “/usr/local”

mv go /usr/local/

STEP 6) Set properly the environment to use your GO 1.9 installation

    • Create file with path and name

      /etc/profile.d/golang.sh

    • Make the file executable with
      chmod 755 /etc/profile.d/golang.sh
      
    • Insert the following line, which will add to the environment PATH your GO executable binaries
[[ -d "/usr/local/go" ]] && export PATH="$PATH:/usr/local/go/bin"

STEP 7) Reload the environment or just log off/in and check if you could execute the GO tool

root@srv.local:~# source /etc/profile
root@srv.local:~# go version
go version go1.9.4 linux/amd64

* Here are all the commands in one place to install the specific version of GO 1.9.4 AMD64, you can use them in a script:

cd
mkdir go-installation
cd ./go-installation
sudo wget https://dl.google.com/go/go1.9.4.linux-amd64.tar.gz
sudo tar xzvf go1.9.4.linux-amd64.tar.gz
sudo mv go /usr/local/
cat <<END | sudo tee /etc/profile.d/golang.sh 1>/dev/null
[[ -d "/usr/local/go" ]] && export PATH="\$PATH:/usr/local/go/bin"
END
sudo chmod 755 /etc/profile.d/golang.sh
source /etc/profile

And do not forget to

source /etc/profile

in your current shell session. It is mandatory for your current shell if you execute the above command from a script!

* This installation of GO Language 1.9 is from the official source the home site of GO Language. There are other easier ways to do it using, for example there are PPA repositories with Ubuntu packages ready to install, but they are not supported by the official GO team! Use them at your own risk as with all other PPA repositories.

How to install the latest linux kernel (mainline) in CentOS 7 distro

Here you can see the steps to install the latest (mainline stable) kernel under CentOS 7, whether we need the latest driver, because we bought a new laptop released for the first time last month with the latest hardware or there is a hot fix of some nasty bug it is of no matter.
Here are the steps about installing the latest kernel to our CentOS 7, you must have root access:

  • STEP 1 Import the public key of the repository, which offer us the packages of the CentOS 7 mainline stable kernel (and some other kernels, like the Red Hat Enterprise Linux (RHEL) 6 and 7 and more, you can check out the site). The site of the repository is

    https://elrepo.org/

    Import the public key

    #change to root user (skip the first line if you are root)
    sudo su
    rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
    
  • STEP 2 Check the latest version of the rpm install package of the repository, the command is under

    To install ELRepo for RHEL-7, SL-7 or CentOS-7:

    So at present the latest version is “7.0-3” and execute to wget to download the package for the repository elrepo:

    wget http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
    
  • STEP 3 Install the elrepo package with yum (you can do it with rpm command, but let yum manage all your packages and metadata for them!)
    yum -y install ./elrepo-release-7.0-3.el7.elrepo.noarch.rpm
    

    STEP 4 List the available kernels from the elrepo to choose the one you like

    yum list available --disablerepo='*' --enablerepo=elrepo-kernel
    

    To install the latest mainline kernel you must use package starting with

    kernel-ml-*

    at moment of writing the latest mainline kernel is

    4.15.4-1.el7.elrepo

    So execute

    yum install -y --enablerepo=elrepo-kernel kernel-ml
    

    And it will pull the

    kernel-ml-4.15.4-1.el7.elrepo.x86_64

    and install it

  • STEP 5 Check if you are going to boot the new kernel, you’ve installed and set the right one to boot

    cat /boot/grub2/grubenv |grep saved
    # GRUB Environment Block
    saved_entry=CentOS Linux (3.10.0-693.el7.x86_64) 7 (Core)
    

    And as you see, no it’ll not boot to the new kernel, so you must configure grub2 to boot your newly just installed kernel. First check all the installed kernels, set the right kernel and then it is mandatory to call

    grub2-mkconfig

    to update the grub2 configuration:

    [root@srv ~]# awk -F\' /^menuentry/{print\$2} /boot/grub2/grub.cfg 
    CentOS Linux (4.15.4-1.el7.elrepo.x86_64) 7 (Core)
    CentOS Linux (3.10.0-693.el7.x86_64) 7 (Core)
    CentOS Linux (0-rescue-0a26fe4b81d845209fb8958c8e29d600) 7 (Core)
    

    The position 0 (YES, it starts from ZERO!) is “CentOS Linux (4.15.4-1.el7.elrepo.x86_64) 7 (Core)”, so you have two options to set it:

    grub2-set-default 0
    grub2-mkconfig -o /boot/grub2/grub.cfg
    

    Check to see if everything is OK with

    [root@srv ~]# cat /boot/grub2/grubenv |grep saved
    saved_entry=0
    

    or you can set the name of the kernel to boot with

    grub2-set-default "CentOS Linux (4.15.4-1.el7.elrepo.x86_64) 7 (Core)"
    grub2-mkconfig -o /boot/grub2/grub.cfg
    

    Check to see if everything is OK with

    [root@srv ~]# cat /boot/grub2/grubenv |grep saved
    saved_entry=CentOS Linux (4.15.4-1.el7.elrepo.x86_64) 7 (Core)
    
  • STEP 6 is just to reboot
    reboot
    

    STEP 4 Verification of running the latest kernel

    root@srv:~# uname -a
    Linux srv.local 4.15.4-1.el7.elrepo.x86_64 #1 SMP Sat Feb 17 13:35:20 EST 2018 x86_64 x86_64 x86_64 GNU/Linux
    

Install log of the procedure (your output may vary depending on your hardware installed in your system):

[root@srv ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@srv ~]# wget http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
--2018-02-19 10:20:42--  http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
Resolving www.elrepo.org (www.elrepo.org)... 69.195.83.87
Connecting to www.elrepo.org (www.elrepo.org)|69.195.83.87|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8656 (8.5K) [application/x-rpm]
Saving to: ‘elrepo-release-7.0-3.el7.elrepo.noarch.rpm’

100%[=======================================================================>] 8,656       --.-K/s   in 0.001s  

2018-02-19 10:20:42 (6.97 MB/s) - ‘elrepo-release-7.0-3.el7.elrepo.noarch.rpm’ saved [8656/8656]
[root@srv ~]# yum -y install ./elrepo-release-7.0-3.el7.elrepo.noarch.rpm 
Loaded plugins: fastestmirror
Examining ./elrepo-release-7.0-3.el7.elrepo.noarch.rpm: elrepo-release-7.0-3.el7.elrepo.noarch
Marking ./elrepo-release-7.0-3.el7.elrepo.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package elrepo-release.noarch 0:7.0-3.el7.elrepo will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================
 Package              Arch         Version                   Repository                                     Size
=================================================================================================================
Installing:
 elrepo-release       noarch       7.0-3.el7.elrepo          /elrepo-release-7.0-3.el7.elrepo.noarch       5.2 k

Transaction Summary
=================================================================================================================
Install  1 Package

Total size: 5.2 k
Installed size: 5.2 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : elrepo-release-7.0-3.el7.elrepo.noarch                                                        1/1 
  Verifying  : elrepo-release-7.0-3.el7.elrepo.noarch                                                        1/1 

Installed:
  elrepo-release.noarch 0:7.0-3.el7.elrepo                                                                       

Complete!
[root@srv ~]# yum list available --disablerepo='*' --enablerepo=elrepo-kernel
Loaded plugins: fastestmirror                                                                                                                                               
Loading mirror speeds from cached hostfile                                                                                                                                  
 * elrepo-kernel: mirrors.netix.net                                                                                                                                         
Available Packages                                                                                                                                                          
kernel-lt.x86_64                                                                      4.4.116-1.el7.elrepo                                                     elrepo-kernel
kernel-lt-devel.x86_64                                                                4.4.116-1.el7.elrepo                                                     elrepo-kernel
kernel-lt-doc.noarch                                                                  4.4.116-1.el7.elrepo                                                     elrepo-kernel
kernel-lt-headers.x86_64                                                              4.4.116-1.el7.elrepo                                                     elrepo-kernel
kernel-lt-tools.x86_64                                                                4.4.116-1.el7.elrepo                                                     elrepo-kernel
kernel-lt-tools-libs.x86_64                                                           4.4.116-1.el7.elrepo                                                     elrepo-kernel
kernel-lt-tools-libs-devel.x86_64                                                     4.4.116-1.el7.elrepo                                                     elrepo-kernel
kernel-ml.x86_64                                                                      4.15.4-1.el7.elrepo                                                      elrepo-kernel
kernel-ml-devel.x86_64                                                                4.15.4-1.el7.elrepo                                                      elrepo-kernel
kernel-ml-doc.noarch                                                                  4.15.4-1.el7.elrepo                                                      elrepo-kernel
kernel-ml-headers.x86_64                                                              4.15.4-1.el7.elrepo                                                      elrepo-kernel
kernel-ml-tools.x86_64                                                                4.15.4-1.el7.elrepo                                                      elrepo-kernel
kernel-ml-tools-libs.x86_64                                                           4.15.4-1.el7.elrepo                                                      elrepo-kernel
kernel-ml-tools-libs-devel.x86_64                                                     4.15.4-1.el7.elrepo                                                      elrepo-kernel
perf.x86_64                                                                           4.15.4-1.el7.elrepo                                                      elrepo-kernel
python-perf.x86_64                                                                    4.15.4-1.el7.elrepo                                                      elrepo-kernel
[root@srv ~]# yum install -y --enablerepo=elrepo-kernel kernel-ml
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.uni-sofia.bg
 * elrepo: mirrors.netix.net
 * elrepo-kernel: mirrors.netix.net
 * extras: centos.uni-sofia.bg
 * updates: centos.uni-sofia.bg
Resolving Dependencies
--> Running transaction check
---> Package kernel-ml.x86_64 0:4.15.4-1.el7.elrepo will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================
 Package                               Arch                               Version                                           Repository                                 Size
============================================================================================================================================================================
Installing:
 kernel-ml                             x86_64                             4.15.4-1.el7.elrepo                               elrepo-kernel                              44 M

Transaction Summary
============================================================================================================================================================================
Install  1 Package

Total download size: 44 M
Installed size: 195 M
Downloading packages:
kernel-ml-4.15.4-1.el7.elrepo.x86_64.rpm                                                                                                             |  44 MB  00:00:10     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : kernel-ml-4.15.4-1.el7.elrepo.x86_64                                                                                                                     1/1 
  Verifying  : kernel-ml-4.15.4-1.el7.elrepo.x86_64                                                                                                                     1/1 

Installed:
  kernel-ml.x86_64 0:4.15.4-1.el7.elrepo                                                                                                                                    

Complete!
[root@srv ~]# cat /boot/grub2/grubenv |grep saved
# GRUB Environment Block
saved_entry=CentOS Linux (3.10.0-693.el7.x86_64) 7 (Core)
[root@srv ~]# awk -F\' /^menuentry/{print\$2} /etc/grub2.cfg
CentOS Linux (4.15.4-1.el7.elrepo.x86_64) 7 (Core)
CentOS Linux (3.10.0-693.el7.x86_64) 7 (Core)
CentOS Linux (0-rescue-0a26fe4b81d845209fb8958c8e29d600) 7 (Core)
[root@srv ~]# grub2-set-default "CentOS Linux (4.15.4-1.el7.elrepo.x86_64) 7 (Core)"
[root@srv ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.4-1.el7.elrepo.x86_64
Found initrd image: /boot/initramfs-4.15.4-1.el7.elrepo.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-0a26fe4b81d845209fb8958c8e29d600
Found initrd image: /boot/initramfs-0-rescue-0a26fe4b81d845209fb8958c8e29d600.img
done
[root@srv ~]# reboot
Connection to 192.168.0.18 closed by remote host.
Connection to 192.168.0.18 closed.
...
...
...
[root@srv ~]# uname -a
Linux srv.local 4.15.4-1.el7.elrepo.x86_64 #1 SMP Sat Feb 17 13:35:20 EST 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@srv ~]#

How to install the latest linux kernel (mainline) in Ubuntu (17.10) distro

Sometimes we need to install the latest kernel version of our linux distro (btw it is called “mainline” if you need to google something about it)! Whether we need the latest driver, because we bought a new laptop released for the first time last month with the latest hardware or there is a hot fix of some nasty bug it is of no matter. Here are the steps (and some troubleshooting) about installing the latest kernel to our Ubuntu install 17.10 (with old versions like 16, 15 and 14 should be the same):

  • STEP 1 is to choose our desired kernel from

    http://kernel.ubuntu.com/~kernel-ppa/mainline/

    Open this address in your favorite browser and choose the latest. In our example the latest kernel, which is no release candidate, 4.14.15. Enter the directory

    http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15.1/

    and choose your build, for example amd64 for your 64bit setup (and for most cases choose -generic- one)

    mkdir /root/latestkernel
    cd /root/latestkernel
    wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15.1/linux-headers-4.15.1-041501_4.15.1-041501.201802031831_all.deb
    wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15.1/linux-headers-4.15.1-041501-generic_4.15.1-041501.201802031831_amd64.deb
    wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15.1/linux-image-4.15.1-041501-generic_4.15.1-041501.201802031831_amd64.deb
    
  • STEP 2 after successfully downloading the 3 files just install them with “dpkg” (the package manager tool)
    sudo dpkg -i linux-headers-4.15.1*.deb linux-image-4.15.1*.deb
    
  • STEP 3 is just to reboot your machine, the installation setup did everything you needed to load this kernel
    reboot
    

    STEP 4 Verification of running the latest kernel

    root@srv:~# uname -a
    Linux srv.local 4.15.1-041501-generic #201802031831 SMP Sat Feb 3 18:32:13 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
    

Install log of the procedure (your output may vary depending on your hardware installed in your system):

root@srv:~/latestkernel# sudo dpkg -i linux-headers-4.15.1*.deb linux-image-4.15.1*.deb
Selecting previously unselected package linux-headers-4.15.1-041501.
(Reading database ... 200430 files and directories currently installed.)
Preparing to unpack linux-headers-4.15.1-041501_4.15.1-041501.201802031831_all.deb ...
Unpacking linux-headers-4.15.1-041501 (4.15.1-041501.201802031831) ...
Selecting previously unselected package linux-headers-4.15.1-041501-generic.
Preparing to unpack linux-headers-4.15.1-041501-generic_4.15.1-041501.201802031831_amd64.deb ...
Unpacking linux-headers-4.15.1-041501-generic (4.15.1-041501.201802031831) ...
Selecting previously unselected package linux-image-4.15.1-041501-generic.
Preparing to unpack linux-image-4.15.1-041501-generic_4.15.1-041501.201802031831_amd64.deb ...
Examining /etc/kernel/preinst.d/
run-parts: executing /etc/kernel/preinst.d/intel-microcode 4.15.1-041501-generic /boot/vmlinuz-4.15.1-041501-generic
Done.
Unpacking linux-image-4.15.1-041501-generic (4.15.1-041501.201802031831) ...
Setting up linux-headers-4.15.1-041501 (4.15.1-041501.201802031831) ...
Setting up linux-headers-4.15.1-041501-generic (4.15.1-041501.201802031831) ...                                                                                             
Setting up linux-image-4.15.1-041501-generic (4.15.1-041501.201802031831) ...                                                                                               
Running depmod.                                                                                                                                                             
update-initramfs: deferring update (hook will be called later)                                                                                                              
Examining /etc/kernel/postinst.d.                                                                                                                                           
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.15.1-041501-generic /boot/vmlinuz-4.15.1-041501-generic                                                      
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.15.1-041501-generic /boot/vmlinuz-4.15.1-041501-generic                                                       
update-initramfs: Generating /boot/initrd.img-4.15.1-041501-generic                                                                                                         
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.15.1-041501-generic /boot/vmlinuz-4.15.1-041501-generic                                                   
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.15.1-041501-generic /boot/vmlinuz-4.15.1-041501-generic                                                       
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.15.1-041501-generic /boot/vmlinuz-4.15.1-041501-generic                                                        
Generating grub configuration file ...                                                                                                                                      
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.                                                                   
Found linux image: /boot/vmlinuz-4.15.1-041501-generic                                                                                                                      
Found initrd image: /boot/initrd.img-4.15.1-041501-generic                                                                                                                  
Found linux image: /boot/vmlinuz-4.14.15-041415-generic                                                                                                                     
Found initrd image: /boot/initrd.img-4.14.15-041415-generic                                                                                                                 
Found linux image: /boot/vmlinuz-4.13.0-32-generic
Found initrd image: /boot/initrd.img-4.13.0-32-generic
Found linux image: /boot/vmlinuz-4.13.0-21-generic
Found initrd image: /boot/initrd.img-4.13.0-21-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
root@srv:~/latestkernel#

Access Violation error, when compiling packages in Gentoo

Sometimes if you try to emerge a package in Gentoo you could receive error in the configure phase of the compilation process. The example below is with the emerging the PHP – dev-lang/php-5.6.33:5.6::gentoo, but could happen with many other packages, which are rather old and probably not maintained or the sandbox or even the portage packages are old.
So here is the error and the compilation stops:

srv ~ # emerge -av --nodeps "<php-7"
...
checking for mmap() using MAP_ANON shared memory support... yes
checking for mmap() using /dev/zero shared memory support... yes
checking for mmap() using shm_open() shared memory support...  * ACCESS DENIED:  open_wr:      /run/test.shm.8811LBKone
no
checking for mmap() using regular file shared memory support... yes
...
checking for mmap() using MAP_ANON shared memory support... yes
checking for mmap() using /dev/zero shared memory support... yes
checking for mmap() using shm_open() shared memory support...  * ACCESS DENIED:  open_wr:      /run/test.shm.180309hAMbj
no
checking for mmap() using regular file shared memory support... yes
....
Thank you for using PHP.
config.status: creating php5.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: executing libtool commands
config.status: executing default commands
>>> Source configured.
 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
 * LOG FILE: "/var/log/sandbox/sandbox-13466.log"
 * 
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /run/test.shm.21532Xx6ViE
A: /run/test.shm.21532Xx6ViE
R: /run/test.shm.21532Xx6ViE
C: ./conftest 

F: open_wr
S: deny
P: /run/test.shm.31817hurGxH
A: /run/test.shm.31817hurGxH
R: /run/test.shm.31817hurGxH
C: ./conftest 

F: open_wr
S: deny
P: /run/test.shm.8811LBKone
A: /run/test.shm.8811LBKone
R: /run/test.shm.8811LBKone
C: ./conftest 

F: open_wr
S: deny
P: /run/test.shm.180309hAMbj
A: /run/test.shm.180309hAMbj
R: /run/test.shm.180309hAMbj
C: ./conftest 
 * --------------------------------------------------------------------------------

>>> Failed to emerge dev-lang/php-5.6.33, Log file:

>>>  '/var/tmp/portage/dev-lang/php-5.6.33/temp/build.log'

You could try adding “-sandbox” to feature in “/etc/portage/make.conf”

FEATURES="-sandbox"

But

the sandbox feature is very important and should not be disabled by default.

And that’s why sometime when you disable it with “-sandbox” you still get access violation and you still cannot install/compile the package!
The thing is you see the error and you can fix it easily. The important part is the directory, which causes the error, in the above example with “dev-lang/php”, but could be any other Gentoo package, the problem is the writing permission for files in “/run” directory. So open the configuration file

/etc/sandbox.d/00default

and you’ll see the there is a variable called SANDBOX_WRITE, which accept paths. If you add to this variable at the end the directory “/run” or your access violated directory you’ll be able to install/compile your package with no problems, for the above problem the solution was:

SANDBOX_WRITE="/usr/tmp/conftest:/usr/lib/conftest:/usr/lib32/conftest:/usr/lib64/conftest:/usr/tmp/cf:/usr/lib/cf:/usr/lib32/cf:/usr/lib64/cf:/run"