Penguin, small TECH.BARWICK.DE
Linux
 

Recent posts

Categories

Archive

Syndication

 



Powered By

Info

The Prometheus PostgreSQL storage adapter does not seem amenable to being executed directly from a systemd service file.

As a workaround I created a wrapper script like this (adjust parameters as required):

#!/bin/bash

# Wrapper to launch prometheus-postgresql-adapter, as calling
# it directly from the systemd service file doesn't seem to work.
#
# Disclaimer: there is probably a better way of doing this.

nohup /usr/local/bin/prometheus-postgresql-adapter \
-pg-host=... \
-pg-port=... \
-pg-database="..." \
-pg-user="..." \
>> /var/log/prometheus-postgresql-storage-adapter/prometheus-pg-adapter.log 2>&1

and a service file like this:

[Unit]
Description=Prometheus PostgreSQL Storage Adapter
Documentation=https://github.com/timescale/prometheus-postgresql-adapter
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=prometheus
Group=prometheus
ExecStart=/usr/local/bin/prometheus-postgresql-adapter-wrapper
Restart=on-failure

[Install]
WantedBy=multi-user.target

which works fine (YMMV of course).

There may of course be a more elegant way of solving this issue, if so feel free to share.


Posted in Linux | add a comment

Monday, May 30, 2016   9:54 PM

Forcing GPG passphrase input in the terminal

One annoyance when entering GPG passphrases in terminal applications on many systems is that a seperate GUI window pops up. To enable passphrase entry in the comfort of your own terminal, set the following line in .gnupg/gpg-agent.conf

pinentry-program /usr/bin/pinentry-curses


Posted in Linux | add a comment

Sunday, February 22, 2015   5:44 AM

openSUSE 13.2 - Notes


Posted in Linux | add a comment

Sunday, February 16, 2014   8:39 AM

OpenSUSE / Samba: "Invalid key 0 given to dptr_close" error

After upgrading to openSUSE 13.1, the Samba configuration - which I use mainly to share a directory on my workstation-cum-fileserver to a media player on the local network - mysteriously failed to work as expected. The client could mount, but not see, any directories or files. The only vaguely relevant clue appeared to be this entry in /var/log/samba/log.smbd:

Invalid key 0 given to dptr_close

After much head-scratching, it turns out AppArmor is enabled by default on openSUSE 13.1 and was the source of the error. Resolving the issue with AppArmor brought Samba back to life.


Posted in Linux | add a comment

Tuesday, February 11, 2014   1:53 AM

VirtualBox on openSUSE 13.1

I made the mistake of installing VirtualBox from the openSUSE repository, and after much pain trying to troubleshoot the error "This usually means that the vboxdrv module is not loaded. Try again after loading the module" (which pops up every time a virtual machine is launched), I remember the least painful way to install VirtualBox on openSUSE is to follow these instructions, adjusting the version numbers (both for openSUSE and for VirtualBox) accordingly.

As of the time of writing, download.virtualbox.org doesn't provide packages for openSUSE 13.1, however the packages for 12.3 installed just fine and seems to work so far using some pre-existing images, including different Windows versions.

Note: this issue appears to have gone away in OpenSUSE 13.2.


Posted in Linux | add a comment

Wednesday, January 30, 2013   3:07 AM

Installing Debian VirtualBox GuestAdditions

While installing Debian 6 on VirtualBox, I noticed it evidently detected it was running in VirtualBox and automatically added three virtualbox-ose-guest-* packages to the install, which is nice. However they are somewhat dated - version 3.2.x whereas the GuestAdditions virtual CD mounted by VirtualBox provides 4.1.x.

Remove the existing packages with:

  apt-get remove virtualbox-ose-guest-dkms virtualbox-ose-guest-utils virtualbox-ose-guest-x11

(otherwise the GuestAdditions installer will complain) and reboot to remove installed kernel modules.

The virtual CD does not appear to be startable from a double click - the error "Cannot find the autorun program" pops up - instead run the script directly with:

  bash VBoxLinuxAdditions-x86.run

A further reboot will activate the GuestAdditions.


Posted in Linux | add a comment