Category Archives: BSD

docker-registry at simulakrum

If docker on a systemd-infected system complains that it cannot log into docker-registry at, add the following into docker.service file:

:~# grep simulakrum /etc/systemd/system/
ExecStart=/usr/bin/dockerd –insecure-registry -H fd://

and then reload the systemd and restart docker daemon:

systemctl daemon-reload
systemctl restart docker.service

If the same things happens in a FreeBSD, add the same switch into the following file:

root@beastie:~ # grep simulakrum /usr/local/etc/rc.d/docker
daemon -p /var/run/ ${command} -d -e jail –insecure-registry -s zfs -g ${docker_dir} -D >/var/log/docker.log 2>/var/log/docker.log

and then restart the docker daemon:

root@beastie:~ # /usr/local/etc/rc.d/docker restart
Stopping docker…
Starting docker…
root@beastie:~ #

Re-install pkg for the win

This morning another pkg update && pkg upgrade failed on my FreeBSD 11 CURRENT amd64. It was some 80-ish packages, and it wouldn’t go past py33-atspi-2.12.0_1. It took a make deinstall && make reinstall of the /usr/ports/ports-mngmt/pkg to complete the upgrade.

I couldn’t figure out in details what caused this awkward situation.

Fortunately, with the exception of the necessity to keep enchant locked if I want gedit to have language dictionaries available in the spell-checker plugin, this is the first clumsiness of the pkgng tool I’ve run into in several months of usage, even under the CURRENT branch.

There, just a brief note! ūüôā

The conjugate function for clang 3.4.1 on FreeBSD fails?

Dealing with the conjugate of complex numbers brought me some linker failures for clang 3.4.1 on FreeBSD 11 CURRENT amd64:

vanja@current:/tmp % cat konjugat.c
#include <complex.h>
#include <stdio.h>

int main(void)
double complex kpx = 1.0 + 3.0*I;
double complex konjugat = conj(kpx);
printf(“Kompleksni broj je %.2f%+.2fi\n”, creal(kpx), cimag(kpx));
printf(“Konjugat od kpx je %.2f%+.2fi\n”, creal(konjugat) ,cimag(konjugat));
return 0;

Continue reading

enchant stole the languages in gedit-plugins

A note on strange gedit behaviour: after the last update of ports¬† – yes, there is always something wrong with ports after an update, no matter what it looks like – my gedit wasn’t able to do spell checking, though I was sure I had hunspell and aspell for at least English and German installed system-wide.

Gedit simply displayed no languages in the appropriate menu.

It would re-compile and re-install even from ports, just fine, but no re-compilation of plugins, python bindings or dictionaries helped until I re-installed enchant from ports! There, it might help someone figure out where have all the languages gone:

pkg info gedit\* \*enchant \*aspell

Debian Wheezy i386 in FreeBSD’s bhyve

Just managed to install a Debian Wheezy i386 in the FreeBSD’s bhyve, after a failed attempts with Fedora 21 server and openSuSE 13.2. Also, grub2-bhyve wasn’t reliable until I changed the arch to i386, and the type of medium to “netinstall” – that got it rolling.

One warning – the video is uncut, and thus suffers from a few half-minute gaps during the installation.

The FreeBSD used is FreeBSD 11.0-CURRENT amd64, because at the moment bhyve is functional for AMD CPUs only in CURRENT. Continue reading

Positive, comparative, and the code used in a linux

I read a thread where OpenBSD community were discussing the code for the network time daemon, and some figures stated there seemed almost unreal. Out of the pure curiosity, that has nothing to do with deeper understanding of the ntp daemon code, I ran “a test” used there on an OpenBSD, a FreeBSD and a Linux machine. The results are truly staggering:

uname -rms ; pwd ; for i in $(find . -name “*.[ch]”); do cat $i >> allcode; done ; egrep -v ‘[:blank:]*/?\*’ allcode | grep -v “^ *$” | wc -l
OpenBSD 5.6 amd64

uname -rms ; pwd ; for i in $(find . -name “*.[ch]”); do cat $i >> allcode; done ; egrep -v ‘[:blank:]*/?\*’ allcode | grep -v “^ *$” | wc -l
FreeBSD 11.0-CURRENT amd64

uname -rms ; pwd ; for i in $(find . -name “*.[ch]”); do cat $i >> allcode; done ; egrep -v ‘[[:blank:]]*/?\*’ allcode | grep -v “^ *$” | wc -l
Linux 3.17.6-200.fc20.x86_64 x86_64

Project OpenBSD proved itself time and again as a proper place if you want to learn coding!

Wake-on-LAN a FreeBSD server

Compiled from at least three sources of wisdom, here is a brief wake-on-lan note for FreeBSD 10.1-STABLE.

Set your BIOS first, mine is tuned in “Advanced >> APM >> Power On By PME”!

Next, check your NIC:

# grep -l IFCAP_WOL /usr/src/sys/dev/*/*.c

Continue reading

If php-fastcgi won’t come to the IP:port, the socket will come to the php-fastcgi

I’ve had an unusual problem with¬†lighttpd-1.4.35p2-ldap-mysql and¬†php-fastcgi-5.4.30 on an OpenBSD 5.6 amd64:¬†php-fastcgi-5.4.30 was refusing to use/bind to an otherwise perfectly available address and port no matter what, with similar to the following in the logs:

(mod_fastcgi.c.984) bind failed for: tcp: Can’t assign requested address

That was ridiculous, because

a) none of the methods would give even a smallest hint that the IP and port were somehow and somewhere in use,
b) changing the IP, the port, or any other parameter for the server.bind, server.port, or the fastcgi.server section would make a difference – exactly the same message would emerge again in the log, only with the new parameters.

The socket, though, works just fine, so, in order to stop spending time on debugging of such a bizarre behaviour, I simply switched to the socket method.

However, I’d really like to read an explanation for this particular mystery. Any ideas? Or I simply have to start somewhere before the line 984 of the mod_fastcgi.c?

Mediawiki in chroot – php in hell

Setting Mediawiki’s LDAP authentication and mail functionality while it is running in an OpenBSD’s nginx chroot took some time to debug and prepare.

As always, the first thing should be the set-up of a log:

$wgDebugLogFile = “../logs/mediawiki/debug-{$wgDBname}.log”;
error_reporting( -1 );
ini_set( ‘display_errors’, 1 );

Continue reading