u/LiquidVenom66

▲ 17 r/openbsd+1 crossposts

Running miniDLNA on OpenBSD 7.8 — rcctl broken, here's the workaround

Hey everyone,

Just got miniDLNA running stable on OpenBSD 7.8 after quite a battle. Sharing my findings in case others hit the same issues.

The Problem

rcctl start minidlna reports ok but immediately rcctl check minidlna returns failed. The service never creates a PID file and dies silently. This seems to be a known issue with the rc script on OpenBSD 7.8 — possibly related to the unveil/pledge restrictions in the package.

Root Causes Found

rcctl broken — minidlna's rc script doesn't work reliably on 7.8

unveil restrictions — media paths outside /var/db/minidlna are blocked when running as daemon

Don't use -d flag — it prevents self-daemonization and causes instability

Corrupt/incomplete media files — minidlna crashes scanning bad metadata

Working Solution

Create symlinks so media paths are within unveil scope:

ln -sf /data/media/videos /var/db/minidlna/videos

ln -sf /data/media/music /var/db/minidlna/music

ln -sf /data/media/photos /var/db/minidlna/photos

media_dir=V,/var/db/minidlna/videos

media_dir=A,/var/db/minidlna/music

media_dir=P,/var/db/minidlna/photos

friendly_name=MyServer

db_dir=/var/db/minidlna

log_dir=/var/log

port=8200

inotify=no

notify_interval=60

/etc/login.conf — increase openfiles limit:

minidlna:\

:openfiles=4096:\\

:tc=daemon:

cap_mkdb /etc/login.conf

/etc/rc.conf.local:

minidlna_class=minidlna

/etc/rc.local — bypass rcctl entirely:

#!/bin/sh

mkdir -p /var/run/minidlna

chown _minidlna:_minidlna /var/run/minidlna

/usr/local/sbin/minidlnad \

-f /etc/minidlna.conf \

-P /var/run/minidlna/minidlna.pid \

-u _minidlna

Key insight: Without -d, minidlna self-daemonizes with PPID=1 — stable and boot-persistent. With -d it stays in foreground and dies when the shell exits.

Verify it's running correctly:

ps -p $(pgrep minidlnad | head -1) -o pid,ppid,command

# PPID should be 1

Hope this saves someone the hours I spent on it!

OpenBSD 7.8 · miniDLNA 1.3.3

reddit.com
u/LiquidVenom66 — 4 days ago