Loki

Overview

This is a flavour containing the loki data source, promtail log ingestor, and grafana viewer.

The flavour includes a local consul agent instance to be available that it can connect to (see configuration below). You can e.g. use the consul pot flavour on this site to run consul. If no consul instance is available at first, make sure it’s up within an hour and the certificate renewal process will restart consul. You can also connect to this host and service consul restart manually.

Installation

  • Create a ZFS data set on the parent system beforehand zfs create -o mountpoint=/mnt/lokidata zroot/lokidata
  • Create your local jail from the image or the flavour files.
  • Clone the local jail
  • Mount in the ZFS data set you created pot mount-in -p <jailname> -m /mnt -d /mnt/lokidata
  • Optionally export the ports after creating the jail: pot export-ports -p <jailname> -e 3100:3100 -e 3000:3000
  • Adjust to your environment:
    sudo pot set-env -p <jailname> -E DATACENTER=<datacentername> -E NODENAME=<nodename> \
    -E IP=<IP address of this system> -E CONSULSERVERS='<correctly formatted list of quoted IP addresses>' \
    -E VAULTSERVER=<IP address vault server> -E VAULTTOKEN=<token> \
    [-E GOSSIPKEY=<32 byte Base64 key from consul keygen>] [-E DNSFORWARDERS=<none|list of IPs>]
    

The CONSULSERVERS parameter defines the consul server instances, and must be set as CONSULSERVERS='"10.0.0.2"' or CONSULSERVERS='"10.0.0.2", "10.0.0.3", "10.0.0.4"' or CONSULSERVERS='"10.0.0.2", "10.0.0.3", "10.0.0.4", "10.0.0.5", "10.0.0.6"'

The GOSSIPKEY parameter is the gossip encryption key for consul agent. We’re using a default key if you do not set the parameter, do not use the default key for production encryption, instead provide your own.

The VAULTSERVER parameter is the IP address of the vault server to authenticate to, and obtain certificates from.

The VAULTTOKEN parameter is the issued token from the vault server.

The DNSFORWARDERS parameter is a space delimited list of IPs to forward DNS requests to. If set to none or left out, no DNS forwarders are used.

Explanation

There are several components to having a searchable log-ingestor:

1. Remote syslog server accepting incoming logs

syslogd is configured to accept syslog on UDP port 514 from hosts in the specified subnet, and save all to /mnt/logs/central.log.

Remote hosts have their syslog.conf configured to send logs to this host.

This is a very broad and blunt approach, where syslog-ng may be a preferred approach with wildcard capabilities and multiple files.

2. Promtail log parsing and labelling

promtail is configured as a service and monitors /mnt/logs/central.log for data to ingest and label, before submitting to loki.

3. Loki data source

loki is configured as a service and ingests data-with-labels, and makes available for query purposes.

4. Grafana with “search logs” dashboard

grafana is a viewer for the data in the loki data source. A separate grafana flavour must be configured with loki as a data source to view captured logs.

Usage

To access loki make sure your grafana flavour has a data source with this host’s IP:

  • https://:3000 and open the search logs dashboard.

Persistent Storage

Persistent storage will be in the ZFS dataset zroot/lokidata, available inside the image at /mnt

If you stop the image, the data will still exist, and a new image can be started up and still use it.

If you need to change the directory parameters for the ZFS dataset, adjust the mount-in command accordingly for the source directory as mounted by the parent OS.

Do not adjust the image destination mount point at /mnt because Loki is configured to use this directory for data.

You can optionally place your own configuration files for loki and promtail in:

  • Loki: /mnt/lokidata/loki/loki-local-config.yaml.in
  • Promtail: /mnt/lokidata/loki/promtail-local-config.yaml.in

Getting Started

How To Use The Ready-Made Image

FreeBSD 14.1:
pot import -p loki-amd64-14_1 -t 0.3.7 -U https://potluck.honeyguide.net/loki

With Signify Verification:
fetch https://potluck.honeyguide.net/potluck.pub; pot import -p loki-amd64-14_1 -t 0.3.7 -C potluck.pub -U https://potluck.honeyguide.net/loki

If you don’t want to use the default pot bridged network configuration but instead need an individual network setup (e.g. assign a host IP address), after importing it you can simply clone the jail like that (em0 is the host network adapter in this example):
pot clone -P loki-amd64-14_1 -p my-cloned-jail -N alias -i "em0|10.10.10.10"

Note: Some images might require specific network configuration, double check the Overview-chapter at the top.

Alternatively: Create a Jail With This Flavour Yourself

1. Create Flavour Files

Save all files and directories from https://github.com/hny-gd/potluck/tree/master/loki to /usr/local/etc/pot/flavours/

2. Create Jail From Flavour

Run
pot create -b <FreeBSD Version> -p <jailname> -t single -N public-bridge -f fbsd-update

with your FreeBSD version (e.g. 14.1) and the name your jail should get.

Note: Some images might require specific network configuration, double check the Overview-chapter at the top.

Version History

0.3.7

  • Update syslog-ng config to use modern config options

0.3.6

  • Enable milliseconds in syslog-ng for all log timestamps

0.3.5

  • Remove syslog log target from promtail and syslog-ng.conf and improve parsing of the varlogs target. This allows reingesting logs after disaster. Also parse severity.

0.3.4

  • Add Loki metrics endpoint as a service in Consul (restores the “lost” version 0.2.26)

0.3.3

  • Change image so it builds on FreeBSD 14.x

0.3.2

  • Return to upstream versions of loki and promtail
  • This uses rc scripts taken from the port (including some strangeness), so we can switch back in the future and stay compatible

0.3.1

  • Version bump for new base image 14.1
  • Extra steps to trim image size

0.2.26

  • Add Loki metrics endpoint as a service in Consul

0.2.25

  • More fixes to loki and promtail
  • Breaking change: In case a custom promtail-local-config.yaml.in is used, adjust positions: to filename: /mnt/log/promtail/positions.yaml

0.2.24

  • Fixes to starting promtail

0.2.23

  • Switch to FreeBSD package versions of loki and promtail

0.2.22

  • Make consul-template retry more often

0.2.21

  • Update consul configuration to new version
  • Fix _app label in node-exporter

0.2.20

  • Disable QNAME minimization in unbound (consul can’t handle it)

0.2.19

  • Move special logs into their own dirs

0.2.18

  • Add filtering of metric logs to a separate file in loki

0.2.17

  • Version bump to rebuild

0.2.16

  • Version bump for rebuild to fix missing images on potluck site

0.2.15

  • Version bump for p3 rebuild

0.2.14

  • Allow placing alternative copies of loki and promtail config files on mount-in

0.2.13

  • Add new parameter DNSFORWARDERS to allow controlling how unbound is configured
  • Add reseason support to allow restarting grafana with fresh credentials

0.2.12

  • Update to Loki version 2.6.1, updates to loki-local-config.yaml
  • Update to Promtail version 2.6.1

0.2.11

  • Add support for json logs with pipeline_stages in promtail conf

0.2.10

  • Version bump for layered images

0.2.9

  • Move loki and promtail download to image build phase

0.2.8

  • Make consul node_names non-FQDN

0.2.7

  • Major rework of templates, certificate issuing, and token/entity/group/role structure

0.2.6

  • Improve metrics collection

0.2.5

  • Serve loki over mTLS
  • Move loki data to persistent storage

0.2.4

  • Merged PR 26, incrementing changelog version

0.2.3

  • Dummy changelog entry, missing increments to version

0.2.2

  • Dummy changelog entry, missing increments to version

0.2.1

  • Dummy changelog entry, missing increments to version

0.2.0

  • Many improvements to service mesh components

0.1.3

  • Rebuild for FreeBSD 12_3 and 13 & pot 13

0.1.2

  • Updating version for merge

0.1.1

  • Fixing missing certs directory

0.1.0

  • Big update for hashcluster changes

0.0.15

  • Removing sftppass, unsetting consul sysrc parameters where needed

0.0.14

  • General security updates

0.0.13

  • Tweaking mandatory variables for optional parameters

0.0.12

  • Bug-fix on gossip key

0.0.11

  • Implementing mandatory variables

0.0.10

  • Documentation updates

0.0.9

  • Updates for tls-client-validation to be working with temp certificates via sftp at first

0.0.8

  • Turning off flow-control in syslog-ng, setting 120s time_reopen, and reducing log-fifo parameter

0.0.7

  • Clearing syslog-ng /dev/console entries to remove log spam

0.0.6

  • Added max connections option for syslog-ng, standardised cert.pem key.pem ca.pem for certificate filenames

0.0.5

  • Switched to rsyslog with tls

0.0.4

  • Switched to quarterly package sources

0.0.3

  • Removed Grafana to separate flavour

0.0.2

  • Addition of Grafana Loki

0.0.1

  • First bash at loki syslogd centralised logging system

0.0.0

  • Initiate file

These images were built on Wed Nov 6 20:01:42 UTC 2024

Manual Image Download Links

loki-amd64-14_1_0.3.7.xz ( )
loki-amd64-14_1_0.3.7.xz.skein ( ) loki-amd64-14_1_0.3.7.xz.skein.sig ( ) loki-amd64-14_1_0.3.7.xz.meta ( )

Jenkins Pot Creation Logs

loki-amd64-14_1_0.3.7:


loki/loki:
copy-in -s /usr/local/etc/pot/flavours/loki.d/local -d /root/.pot_local
loki/loki.sh:
#!/bin/sh

# Based on POTLUCK TEMPLATE v3.0
# Altered by Michael Gmelin
#
# EDIT THE FOLLOWING FOR NEW FLAVOUR:
# 1. RUNS_IN_NOMAD - true or false
# 2. If RUNS_IN_NOMAD is false, can delete the <flavour>+4 file, else
#    make sure pot create command doesn't include it
# 3. Create a matching <flavour> file with this <flavour>.sh file that
#    contains the copy-in commands for the config files from <flavour>.d/
#    Remember that the package directories don't exist yet, so likely copy
#    to /root
# 4. Adjust package installation between BEGIN & END PACKAGE SETUP
# 5. Adjust jail configuration script generation between BEGIN & END COOK
#    Configure the config files that have been copied in where necessary

# Set this to true if this jail flavour is to be created as a nomad
# (i.e. blocking) jail.
# You can then query it in the cook script generation below and the script
# is installed appropriately at the end of this script
RUNS_IN_NOMAD=false

# set the cook log path/filename
COOKLOG=/var/log/cook.log

# check if cooklog exists, create it if not
if [ ! -e $COOKLOG ]
then
    echo "Creating $COOKLOG" | tee -a $COOKLOG
else
    echo "WARNING $COOKLOG already exists"  | tee -a $COOKLOG
fi
date >> $COOKLOG

# -------------------- COMMON ---------------

STEPCOUNT=0
step() {
  STEPCOUNT=$(("$STEPCOUNT" + 1))
  STEP="$*"
  echo "Step $STEPCOUNT: $STEP" | tee -a $COOKLOG
}

exit_ok() {
  trap - EXIT
  exit 0
}

FAILED=" failed"
exit_error() {
  STEP="$*"
  FAILED=""
  exit 1
}

set -e
trap 'echo ERROR: $STEP$FAILED | (>&2 tee -a $COOKLOG)' EXIT

# -------------- BEGIN PACKAGE SETUP -------------

step "Bootstrap package repo"
mkdir -p /usr/local/etc/pkg/repos
# only modify repo if not already done in base image
# shellcheck disable=SC2016
test -e /usr/local/etc/pkg/repos/FreeBSD.conf || \
  echo 'FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly" }' \
    >/usr/local/etc/pkg/repos/FreeBSD.conf
ASSUME_ALWAYS_YES=yes pkg bootstrap

step "Touch /etc/rc.conf"
touch /etc/rc.conf

# this is important, otherwise running /etc/rc from cook will
# overwrite the IP address set in tinirc
step "Remove ifconfig_epair0b from config"
# shellcheck disable=SC2015
sysrc -cq ifconfig_epair0b && sysrc -x ifconfig_epair0b || true

step "Disable sendmail"
service sendmail onedisable

step "Disable sshd"
service sshd onedisable || true

step "Create /usr/local/etc/rc.d"
mkdir -p /usr/local/etc/rc.d

step "Clean freebsd-update"
rm -rf /var/db/freebsd-update
mkdir -p /var/db/freebsd-update

# we need consul for consul agent
step "Install package consul"
pkg install -y consul

step "Install package consul-template"
pkg install -y consul-template

step "Patching consul-template rc scripts"
sed -i '' 's/^\(start_precmd=consul_template_startprecmd\)$/\1;'\
'extra_commands=reload/'  /usr/local/etc/rc.d/consul-template || true

step "Install package openssl"
pkg install -y openssl

step "Install package node_exporter"
pkg install -y node_exporter

step "Install package sudo"
pkg install -y sudo

step "Install package curl"
pkg install -y curl

step "Install package jq"
pkg install -y jq

step "Install package jo"
pkg install -y jo

step "Install package nginx"
pkg install -y nginx

step "Install package vault"
pkg install -y vault

step "Install package syslog-ng"
pkg install -y syslog-ng

step "Clean package installation"
pkg clean -ay

# last updated 2024-10-11
step "Download loki release from github"
fetch -qo - https://github.com/grafana/loki/releases/download/\
v3.2.0/loki-freebsd-amd64.zip | tar -Oxf - loki-freebsd-amd64 \
  >/usr/local/bin/loki
chmod 755 /usr/local/bin/loki

if [ "$(sha256 -q /usr/local/bin/loki)" != \
  "e104034dec55f2ce55492d102f45ac1729567a88d41357ea10d0f61bf58e446c" ]; then
  exit_error "/usr/local/bin/loki checksum mismatch!"
fi

# last updated 2024-10-11
step "Download promtail release from github"
fetch -qo - https://github.com/grafana/loki/releases/download/\
v3.2.0/promtail-freebsd-amd64.zip | tar -Oxf - promtail-freebsd-amd64 \
  >/usr/local/bin/promtail
chmod 755 /usr/local/bin/promtail

if [ "$(sha256 -q /usr/local/bin/promtail)" != \
  "38e730412eee148c0d5d178bdd49b802974492b74fd32d192bcd1ca81a66b4bb" ]; then
  exit_error "/usr/local/bin/promtail checksum mismatch!"
fi

# -------------- END PACKAGE SETUP -------------


#
# Now generate the run command script "cook"
# It configures the system on the first run by creating the config file(s)
# On subsequent runs, it only starts sleeps (if nomad-jail) or simply exits
#

# this runs when image boots
# ----------------- BEGIN COOK ------------------


step "Clean cook artifacts"
rm -rf /usr/local/bin/cook /usr/local/share/cook

step "Install pot local"
tar -C /root/.pot_local -cf - . | tar -C /usr/local -xf -
rm -rf /root/.pot_local

step "Set file ownership on cook scripts"
chown -R root:wheel /usr/local/bin/cook /usr/local/share/cook
chmod 755 /usr/local/share/cook/bin/*

# ----------------- END COOK ------------------


# ---------- NO NEED TO EDIT BELOW ------------

step "Make cook script executable"
if [ -e /usr/local/bin/cook ]
then
    echo "setting executable bit on /usr/local/bin/cook" | tee -a $COOKLOG
    chmod u+x /usr/local/bin/cook
else
    exit_error "there is no /usr/local/bin/cook to make executable"
fi

#
# There are two ways of running a pot jail: "Normal", non-blocking mode and
# "Nomad", i.e. blocking mode (the pot start command does not return until
# the jail is stopped).
# For the normal mode, we create a /usr/local/etc/rc.d script that starts
# the "cook" script generated above each time, for the "Nomad" mode, the cook
# script is started by pot (configuration through flavour file), therefore
# we do not need to do anything here.
#

# Create rc.d script for "normal" mode:
step "Create rc.d script to start cook"
echo "creating rc.d script to start cook" | tee -a $COOKLOG

# shellcheck disable=SC2016
echo '#!/bin/sh
#
# PROVIDE: cook
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
. /etc/rc.subr
name="cook"
rcvar="cook_enable"
load_rc_config $name
: ${cook_enable:="NO"}
: ${cook_env:=""}
command="/usr/local/bin/cook"
command_args=""
run_rc_command "$1"
' > /usr/local/etc/rc.d/cook

step "Make rc.d script to start cook executable"
if [ -e /usr/local/etc/rc.d/cook ]
then
  echo "Setting executable bit on cook rc file" | tee -a $COOKLOG
  chmod u+x /usr/local/etc/rc.d/cook
else
  exit_error "/usr/local/etc/rc.d/cook does not exist"
fi

if [ "$RUNS_IN_NOMAD" != "true" ]
then
  step "Enable cook service"
  # This is a non-nomad (non-blocking) jail, so we need to make sure the script
  # gets started when the jail is started:
  # Otherwise, /usr/local/bin/cook will be set as start script by the pot
  # flavour
  echo "enabling cook" | tee -a $COOKLOG
  service cook enable
fi

# -------------------- DONE ---------------
exit_ok

loki/loki+1:
loki/loki+1.sh:

loki/loki+2:
loki/loki+2.sh:

loki/loki+3:
loki/loki+3.sh:

loki/loki+4:
loki/loki+4.sh:
=====>  Create conf dir (/mnt/srv/pot/jails/loki-amd64-14_1/conf)
=====>  Cloning freebsd-potluck-amd64-14_1_0_0_31 with snap 
=====>  clone zroot/srv/pot/jails/freebsd-potluck-amd64-14_1_0_0_31/m@1730306249 into zroot/srv/pot/jails/loki-amd64-14_1/m
=====>  Flavour: fbsd-update
=====>  Starting loki-amd64-14_1 pot for the initial bootstrap
=====>  mount /mnt/srv/pot/jails/loki-amd64-14_1/m/tmp
defaultrouter: 10.192.0.1 -> 10.192.0.1
===>  Starting the pot loki-amd64-14_1
=====>  Pot loki-amd64-14_1 jail params are: allow.set_hostname=false allow.raw_sockets allow.socket_af allow.chflags exec.clean mount.devfs enforce_statfs=2 sysvshm=new sysvsem=new sysvmsg=new children.max=0 devfs_ruleset=4 stop.timeout=10 name=loki-amd64-14_1 host.hostname=loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net osrelease=14.1-RELEASE-p6 path=/mnt/srv/pot/jails/loki-amd64-14_1/m persist vnet vnet.interface=epair0b
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/local/lib/compat/pkg
32-bit compatibility ldconfig path: /usr/lib32 /usr/lib32
Starting Network: lo0 epair0b.
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
	options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
	inet 127.0.0.1 netmask 0xff000000
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6
	groups: lo
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair0b: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
	options=8<VLAN_MTU>
	ether 02:6d:c2:a8:e0:0b
	inet 10.192.0.3 netmask 0xffc00000 broadcast 10.255.255.255
	groups: epair
	media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
	status: active
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add net default: gateway 10.192.0.1
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Clearing /tmp (X related).
Updating /var/run/os-release done.
Creating and/or trimming log files.
Updating motd:.
Starting syslogd.
Starting sendmail_submit.
Starting cron.

Wed Nov  6 19:57:36 UTC 2024
/usr/local/etc/pot/flavours/fbsd-update.sh -> /mnt/srv/pot/jails/loki-amd64-14_1/m/tmp/fbsd-update.sh
=====>  Executing fbsd-update script on loki-amd64-14_1
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching public key from update2.freebsd.org... done.
Fetching metadata signature for 14.1-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Fetching 2 metadata files... done.
Inspecting system... done.
Preparing to download files... done.

No updates needed to update system to 14.1-RELEASE-p6.
No updates are available to install.
=====>  Stop the pot loki-amd64-14_1
=====>  Remove p4672bca2f2560 epair network interfaces
=====>  unmount /mnt/srv/pot/jails/loki-amd64-14_1/m/tmp
=====>  unmount /mnt/srv/pot/jails/loki-amd64-14_1/m/dev
=====>  Flavour: loki
=====>  Executing loki pot commands on loki-amd64-14_1
=====>  mount /mnt/srv/pot/jails/loki-amd64-14_1/m/tmp
=====>  Source /usr/local/etc/pot/flavours/loki.d/local copied in the pot loki-amd64-14_1
=====>  unmount /mnt/srv/pot/jails/loki-amd64-14_1/m/tmp
=====>  /mnt/srv/pot/jails/loki-amd64-14_1/m/dev is already unmounted
=====>  Starting loki-amd64-14_1 pot for the initial bootstrap
=====>  mount /mnt/srv/pot/jails/loki-amd64-14_1/m/tmp
defaultrouter: 10.192.0.1 -> 10.192.0.1
===>  Starting the pot loki-amd64-14_1
=====>  Pot loki-amd64-14_1 jail params are: allow.set_hostname=false allow.raw_sockets allow.socket_af allow.chflags exec.clean mount.devfs enforce_statfs=2 sysvshm=new sysvsem=new sysvmsg=new children.max=0 devfs_ruleset=4 stop.timeout=10 name=loki-amd64-14_1 host.hostname=loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net osrelease=14.1-RELEASE-p6 path=/mnt/srv/pot/jails/loki-amd64-14_1/m persist vnet vnet.interface=epair0b
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/local/lib/compat/pkg
32-bit compatibility ldconfig path: /usr/lib32 /usr/lib32
Starting Network: lo0 epair0b.
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
	options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
	inet 127.0.0.1 netmask 0xff000000
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6
	groups: lo
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair0b: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
	options=8<VLAN_MTU>
	ether 02:70:d9:a9:7a:0b
	inet 10.192.0.3 netmask 0xffc00000 broadcast 10.255.255.255
	groups: epair
	media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
	status: active
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add net default: gateway 10.192.0.1
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Clearing /tmp (X related).
Updating /var/run/os-release done.
Creating and/or trimming log files.
Updating motd:.
Starting syslogd.
Starting sendmail_submit.
Starting cron.

Wed Nov  6 19:58:19 UTC 2024
/usr/local/etc/pot/flavours/loki.sh -> /mnt/srv/pot/jails/loki-amd64-14_1/m/tmp/loki.sh
=====>  Executing loki script on loki-amd64-14_1
WARNING /var/log/cook.log already exists
Step 1: Bootstrap package repo
pkg already bootstrapped at /usr/local/sbin/pkg
Step 2: Touch /etc/rc.conf
Step 3: Remove ifconfig_epair0b from config
Step 4: Disable sendmail
sendmail disabled in /etc/rc.conf
sendmail_submit disabled in /etc/rc.conf
sendmail_msp_queue disabled in /etc/rc.conf
Step 5: Disable sshd
sshd disabled in /etc/rc.conf
Step 6: Create /usr/local/etc/rc.d
Step 7: Clean freebsd-update
Step 8: Install package consul
Updating FreeBSD repository catalogue...
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] Fetching data.pkg: .......... done
Processing entries: .......... done
FreeBSD repository update completed. 35518 packages processed.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	consul: 1.19.2

Number of packages to be installed: 1

The process will require 124 MiB more space.
24 MiB to be downloaded.
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/1] Fetching consul-1.19.2.pkg: .......... done
Checking integrity... done (0 conflicting)
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/1] Installing consul-1.19.2...
===> Creating groups
Creating group 'consul' with gid '469'
===> Creating users
Creating user 'consul' with uid '469'
===> Creating homedir(s)
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/1] Extracting consul-1.19.2: ..... done
Step 9: Install package consul-template
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	consul-template: 0.39.1_1

Number of packages to be installed: 1

The process will require 13 MiB more space.
4 MiB to be downloaded.
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/1] Fetching consul-template-0.39.1_1.pkg: .......... done
Checking integrity... done (0 conflicting)
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/1] Installing consul-template-0.39.1_1...
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/1] Extracting consul-template-0.39.1_1: ..... done
Step 10: Patching consul-template rc scripts
Step 11: Install package openssl
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 12: Install package node_exporter
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	node_exporter: 1.8.2

Number of packages to be installed: 1

The process will require 11 MiB more space.
4 MiB to be downloaded.
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/1] Fetching node_exporter-1.8.2.pkg: .......... done
Checking integrity... done (0 conflicting)
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/1] Installing node_exporter-1.8.2...
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/1] Extracting node_exporter-1.8.2: .......... done
=====
Message from node_exporter-1.8.2:

--
If upgrading from a version of node_exporter <0.15.0 you'll need to update any
custom command line flags that you may have set as it now requires a
double-dash (--flag) instead of a single dash (-flag).
The collector flags in 0.15.0 have now been replaced with individual boolean
flags and the -collector.procfs` and -collector.sysfs` flags have been renamed
to --path.procfs and --path.sysfs respectively.
Step 13: Install package sudo
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 14: Install package curl
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 15: Install package jq
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 16: Install package jo
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 17: Install package nginx
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	nginx: 1.26.2_5,3
	pcre2: 10.43

Number of packages to be installed: 2

The process will require 9 MiB more space.
2 MiB to be downloaded.
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/2] Fetching nginx-1.26.2_5,3.pkg: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [2/2] Fetching pcre2-10.43.pkg: .......... done
Checking integrity... done (0 conflicting)
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/2] Installing pcre2-10.43...
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/2] Extracting pcre2-10.43: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [2/2] Installing nginx-1.26.2_5,3...
===> Creating groups
Using existing group 'www'
===> Creating users
Using existing user 'www'
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [2/2] Extracting nginx-1.26.2_5,3: .......... done
=====
Message from nginx-1.26.2_5,3:

--
Recent version of the NGINX introduces dynamic modules support.  In
FreeBSD ports tree this feature was enabled by default with the DSO
knob.  Several vendor's and third-party modules have been converted
to dynamic modules.  Unset the DSO knob builds an NGINX without
dynamic modules support.

To load a module at runtime, include the new `load_module'
directive in the main context, specifying the path to the shared
object file for the module, enclosed in quotation marks.  When you
reload the configuration or restart NGINX, the module is loaded in.
It is possible to specify a path relative to the source directory,
or a full path, please see
https://www.nginx.com/blog/dynamic-modules-nginx-1-9-11/ and
http://nginx.org/en/docs/ngx_core_module.html#load_module for
details.

Default path for the NGINX dynamic modules is

/usr/local/libexec/nginx.
Step 18: Install package vault
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	vault: 1.17.1

Number of packages to be installed: 1

The process will require 301 MiB more space.
52 MiB to be downloaded.
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/1] Fetching vault-1.17.1.pkg: .......... done
Checking integrity... done (0 conflicting)
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/1] Installing vault-1.17.1...
===> Creating groups
Creating group 'vault' with gid '471'
===> Creating users
Creating user 'vault' with uid '471'
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/1] Extracting vault-1.17.1: ..... done
=====
Message from vault-1.17.1:

--
The vault user created by the vault package is now a member of the daemon
class, which will allow it to use mlock() when started by the rc script. This
will not be reflected in systems where the user already exists. Please add the
vault user to the daemon class manually by running:

pw usermod -L daemon -n vault

or delete the user and reinstall the package.

You may also need to increase memorylocked for the daemon class in
/etc/rc.conf to more than 1024M (the default) or more:

vault_limits_mlock="2048M"

Or to disable mlock, add:

disable_mlock = 1

to /usr/local/etc/vault.hcl
Step 19: Install package syslog-ng
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 9 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	e2fsprogs-libuuid: 1.47.1
	glib: 2.80.5,2
	ivykis: 0.43.2
	json-c: 0.18
	libffi: 3.4.6
	mpdecimal: 4.0.0
	py311-packaging: 24.1
	python311: 3.11.10
	syslog-ng: 4.8.0_2

Number of packages to be installed: 9

The process will require 234 MiB more space.
32 MiB to be downloaded.
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/9] Fetching ivykis-0.43.2.pkg: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [2/9] Fetching mpdecimal-4.0.0.pkg: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [3/9] Fetching py311-packaging-24.1.pkg: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [4/9] Fetching glib-2.80.5,2.pkg: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [5/9] Fetching syslog-ng-4.8.0_2.pkg: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [6/9] Fetching libffi-3.4.6.pkg: ........ done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [7/9] Fetching json-c-0.18.pkg: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [8/9] Fetching e2fsprogs-libuuid-1.47.1.pkg: ..... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [9/9] Fetching python311-3.11.10.pkg: .......... done
Checking integrity... done (0 conflicting)
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/9] Installing mpdecimal-4.0.0...
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [1/9] Extracting mpdecimal-4.0.0: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [2/9] Installing libffi-3.4.6...
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [2/9] Extracting libffi-3.4.6: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [3/9] Installing python311-3.11.10...
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [3/9] Extracting python311-3.11.10: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [4/9] Installing py311-packaging-24.1...
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [4/9] Extracting py311-packaging-24.1: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [5/9] Installing ivykis-0.43.2...
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [5/9] Extracting ivykis-0.43.2: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [6/9] Installing glib-2.80.5,2...
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [6/9] Extracting glib-2.80.5,2: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [7/9] Installing json-c-0.18...
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [7/9] Extracting json-c-0.18: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [8/9] Installing e2fsprogs-libuuid-1.47.1...
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [8/9] Extracting e2fsprogs-libuuid-1.47.1: .......... done
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [9/9] Installing syslog-ng-4.8.0_2...
[loki-amd64-14_1.vsf00002.cpt.za.honeyguide.net] [9/9] Extracting syslog-ng-4.8.0_2: .......... done
==> Running trigger: glib-schemas.ucl
Compiling glib schemas
No schema files found: doing nothing.
==> Running trigger: gio-modules.ucl
Generating GIO modules cache
=====
Message from python311-3.11.10:

--
Note that some standard Python modules are provided as separate ports
as they require additional dependencies. They are available as:

py311-gdbm       databases/py-gdbm@py311
py311-sqlite3    databases/py-sqlite3@py311
py311-tkinter    x11-toolkits/py-tkinter@py311
=====
Message from syslog-ng-4.8.0_2:

--
syslog-ng is now installed!  To replace FreeBSD's standard syslogd
(/usr/sbin/syslogd), complete these steps:

1. Create a configuration file named /usr/local/etc/syslog-ng.conf
   (a sample named syslog-ng.conf.sample has been included in
   /usr/local/etc). Note that this is a change in 2.0.2
   version, previous ones put the config file in
   /usr/local/etc/syslog-ng/syslog-ng.conf, so if this is an update
   move that file in the right place

2. Configure syslog-ng to start automatically by adding the following
   to /etc/rc.conf:

        syslog_ng_enable="YES"

3. Prevent the standard FreeBSD syslogd from starting automatically by
   adding a line to the end of your /etc/rc.conf file that reads:

        syslogd_enable="NO"

4. Shut down the standard FreeBSD syslogd:

     kill `cat /var/run/syslog.pid`

5. Start syslog-ng:

     /usr/local/etc/rc.d/syslog-ng start
Step 20: Clean package installation
The following package files will be deleted:
	/var/cache/pkg/e2fsprogs-libuuid-1.47.1~362f74ac69.pkg
	/var/cache/pkg/vault-1.17.1.pkg
	/var/cache/pkg/consul-1.19.2.pkg
	/var/cache/pkg/py311-packaging-24.1.pkg
	/var/cache/pkg/python311-3.11.10~286ca605ff.pkg
	/var/cache/pkg/mpdecimal-4.0.0~355dbb0218.pkg
	/var/cache/pkg/syslog-ng-4.8.0_2~cf5f9ee289.pkg
	/var/cache/pkg/pcre2-10.43.pkg
	/var/cache/pkg/json-c-0.18.pkg
	/var/cache/pkg/glib-2.80.5,2.pkg
	/var/cache/pkg/node_exporter-1.8.2.pkg
	/var/cache/pkg/nginx-1.26.2_5,3~339c37ca93.pkg
	/var/cache/pkg/consul-template-0.39.1_1.pkg
	/var/cache/pkg/syslog-ng-4.8.0_2.pkg
	/var/cache/pkg/json-c-0.18~4c2b04b9f9.pkg
	/var/cache/pkg/consul-template-0.39.1_1~e70a830f78.pkg
	/var/cache/pkg/vault-1.17.1~2d50b59c87.pkg
	/var/cache/pkg/e2fsprogs-libuuid-1.47.1.pkg
	/var/cache/pkg/pcre2-10.43~d476f63222.pkg
	/var/cache/pkg/python311-3.11.10.pkg
	/var/cache/pkg/ivykis-0.43.2.pkg
	/var/cache/pkg/glib-2.80.5,2~909ca79520.pkg
	/var/cache/pkg/ivykis-0.43.2~07934ae53e.pkg
	/var/cache/pkg/node_exporter-1.8.2~d3c8df78fe.pkg
	/var/cache/pkg/libffi-3.4.6~e038c4b1cf.pkg
	/var/cache/pkg/mpdecimal-4.0.0.pkg
	/var/cache/pkg/nginx-1.26.2_5,3.pkg
	/var/cache/pkg/py311-packaging-24.1~b3b408ec53.pkg
	/var/cache/pkg/libffi-3.4.6.pkg
	/var/cache/pkg/consul-1.19.2~ffcc2d4893.pkg
The cleanup will free 118 MiB
Deleting files: .......... done
Step 21: Download loki release from github
Step 22: Download promtail release from github
Step 23: Clean cook artifacts
Step 24: Install pot local
Step 25: Set file ownership on cook scripts
Step 26: Make cook script executable
setting executable bit on /usr/local/bin/cook
Step 27: Create rc.d script to start cook
creating rc.d script to start cook
Step 28: Make rc.d script to start cook executable
Setting executable bit on cook rc file
Step 29: Enable cook service
enabling cook
cook enabled in /etc/rc.conf
=====>  Stop the pot loki-amd64-14_1
=====>  Remove p4672bca5b2560 epair network interfaces
=====>  unmount /mnt/srv/pot/jails/loki-amd64-14_1/m/tmp
=====>  unmount /mnt/srv/pot/jails/loki-amd64-14_1/m/dev
===>  exporting loki-amd64-14_1 @ 1730923168 to /tmp/loki-amd64-14_1_0.3.7.xz

This site © Honeyguide Group (Pty) Ltd, all the hosted software their respective license owners 2020 - 2021 - Disclaimer