Skip to content

Commit

Permalink
Feature update to new base 21.4.1 from smartos.org
Browse files Browse the repository at this point in the history
* Add skylime-extra pkgsrc repository by default to pkgin. [Thomas Merkel]
* Use new pkgsrc.smartos.org PGP key in our keyring. [Thomas Merkel]
* Provide better smartos-munin-plugin handling. [Thomas Merkel]
* Switch to fixed znapzend version with correct perl dependencies.
  [Thomas Merkel]
  • Loading branch information
drscream committed Aug 1, 2022
1 parent 8f67ff4 commit 4d807a0
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 17 deletions.
21 changes: 21 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 21.4.1

### New

* Add skylime-extra pkgsrc repository by default to pkgin. [Thomas Merkel]
* Overwrite nullmailer SMF to support syslog logging. [Thomas Merkel]

Pipe nullmailer stdout/stderr to logger and syslog. Otherwise logging is
provided in the svc logfile without datetime information.

* Provide better smartos-munin-plugin handling. [Thomas Merkel]

Support extra sub-directory for our own plugins which should not overwrite
existing plugins. We are sure our additional plugins are overwrite symlink
defaults if they exists.

### Fix

* Switch to fixed znapzend version with correct perl dependencies.
[Thomas Merkel]

## 21.4.0

### New
Expand Down
36 changes: 29 additions & 7 deletions copy/opt/core/bin/munin-node-plugins
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,42 @@
# Thomas Merkel <tm@core.io>
# Enable munin node plugins by commandline

set -e

MUNIN_PLUGIN_SRC=${MUNIN_PLUGIN_SRC-'/opt/local/lib/munin/plugins'}
MUNIN_PLUGIN_DST=${MUNIN_PLUGIN_DST-'/opt/local/etc/munin/plugins'}
MUNIN_PLUGIN_SUB_LOOKUP=${MUNIN_PLUGIN_SUB_LOOKUP-'smartos'}
MUNIN_PLUGINS=${MUNIN_PLUGINS-$@}

for plugin in ${MUNIN_PLUGINS[@]}; do
if [ ! -x ${MUNIN_PLUGIN_SRC}/${plugin} ]; then
plugin_src=${plugin%_*}_
[ ! -x ${MUNIN_PLUGIN_SRC}/${plugin_src} ] && \
function munin_plugins_lookup() {
local munin_plugin_src=${1}
local munin_plugin_dst=${2}
local munin_plugin=${3}

if [ ! -x ${munin_plugin_src}/${munin_plugin} ]; then
plugin_src=${munin_plugin%_*}_
[ ! -x ${munin_plugin_src}/${plugin_src} ] && \
plugin_src=${plugin_src%%_*}_
else
plugin_src=${plugin}
fi
if [[ -x ${MUNIN_PLUGIN_SRC}/${plugin_src} ]]; then
echo "munin-node-plugins: ${plugin}"
ln -sf ${MUNIN_PLUGIN_SRC}/${plugin_src} ${MUNIN_PLUGIN_DST}/${plugin}

# Symlink only if it really exists and is executable. Echo the output for
# better logging information.
if [[ -x ${munin_plugin_src}/${plugin_src} ]]; then
echo "munin-node-plugins: ${munin_plugin}"
echo "${munin_plugin_src}/${plugin_src} -> ${munin_plugin_dst}/${plugin}"
ln -sf ${munin_plugin_src}/${plugin_src} ${munin_plugin_dst}/${plugin}
return 0
else
return 1
fi
}

for plugin in ${MUNIN_PLUGINS[@]}; do
# Default lookup should be $MUNIN_PLUGIN_SUB_LOOKUP
if ! munin_plugins_lookup ${MUNIN_PLUGIN_SRC}/${MUNIN_PLUGIN_SUB_LOOKUP} ${MUNIN_PLUGIN_DST} ${plugin}; then
# Going into default lookup
munin_plugins_lookup ${MUNIN_PLUGIN_SRC} ${MUNIN_PLUGIN_DST} ${plugin}
fi
done
Binary file modified copy/opt/local/etc/gnupg/pkgsrc.gpg
Binary file not shown.
12 changes: 7 additions & 5 deletions customize
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ MUNIN_PLUGINS="
"

echo "* Use the skylime pkgsrc mirror"
gsed -i 's:pkgsrc.joyent.com:pkgsrc.smartos.skylime.net:g' /opt/local/etc/pkg_install.conf
gsed -i 's:pkgsrc.joyent.com:pkgsrc.smartos.skylime.net:g' /opt/local/etc/pkgin/repositories.conf
gsed -n 's:\(^https\://.*\)/[a-z]\+/[A-Za-z]\+/\([0-9]\{4\}Q[0-9]\)/.*:\1/skylime-extra/\2/x86_64/:p' \
/opt/local/etc/pkgin/repositories.conf >> /opt/local/etc/pkgin/repositories.conf
gsed -i 's:pkgsrc.smartos.org/packages:packages.pkgsrc.pub/smartos:g' /opt/local/etc/pkg_install.conf
gsed -i 's:pkgsrc.smartos.org/packages:packages.pkgsrc.pub/smartos:g' /opt/local/etc/pkgin/repositories.conf

gsed -i 's#\(^https://[a-z.]*\)/\([a-z]*\)/\(.*\)/All#\1/skylime-extra/\3\n\1/\2/\3/All#' \
/opt/local/etc/pkgin/repositories.conf

pkg_admin rebuild
pkgin -y up
Expand All @@ -42,7 +43,8 @@ echo "* Create munin template file that will be used during mdata setup"
cp /opt/local/etc/munin/munin-node.conf /opt/local/etc/munin/munin-node.conf.tpl

echo "* Download and install community munin plugins (overwrite all other plugins)"
curl -L https://github.com/drscream/smartos-munin-plugins/archive/v${MUNIN_PLUGIN_VERSION}.tar.gz | gtar xz -C /opt/local/lib/munin/plugins --strip-components=1
mkdir -p /opt/local/lib/munin/plugins/smartos
curl -L https://github.com/drscream/smartos-munin-plugins/archive/v${MUNIN_PLUGIN_VERSION}.tar.gz | gtar xz -C /opt/local/lib/munin/plugins/smartos --strip-components=1

echo "* Activate munin plugins"
/opt/core/bin/munin-node-plugins ${MUNIN_PLUGINS}
Expand Down
4 changes: 2 additions & 2 deletions manifest
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name="core-base"
organization="SkyLime"
brand="Instance"
version="21.4.0"
version="21.4.1"
description="Base core.io image"
homepage="https://github.com/skylime/mi-core-base"
users="root admin"
base="a7199134-7e94-11ec-be67-db6f482136c2"
base="c3331440-012e-11ed-b9de-df56921591c9"
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "core-base",
"version": "21.4.0",
"version": "21.4.1",
"description": "Base core.io image",
"organization": "SkyLime",
"brand": "Instance",
"homepage": "https://github.com/skylime/mi-core-base",
"base": "a7199134-7e94-11ec-be67-db6f482136c2",
"base": "c3331440-012e-11ed-b9de-df56921591c9",
"customer_metadata": {
"admin_authorized_keys": {
"type": "text",
Expand Down
2 changes: 1 addition & 1 deletion packages
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ unzip
# grep required to work with sm- commands
grep
# backup
znapzend
http://packages.pkgsrc.pub/skylime-extra/SmartOS/2021Q4/x86_64/znapzend-0.21.1nb20220801.tgz
# letsencrypt
py39-certbot

0 comments on commit 4d807a0

Please sign in to comment.