Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo's prosody has unusual locations
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Shibotto
Apprentice
Apprentice


Joined: 19 Jun 2015
Posts: 157
Location: CET/CEST

PostPosted: Fri Jun 28, 2019 8:52 pm    Post subject: Gentoo's prosody has unusual locations Reply with quote

Hi everyone. I just installed prosody on my new Gentoo and while I was importing my old config I noticed it defaults to some odd paths:
  • /etc/jabber instead of /etc/prosody for configs
  • /var/spool/jabber instead of /var/lib/prosody for data

It's different from every other distro I tried and I was wondering what's the rationale behind this choice. /var/spool in particular sounds really wrong to me.
Back to top
View user's profile Send private message
miket
Guru
Guru


Joined: 28 Apr 2007
Posts: 506
Location: Gainesville, FL, USA

PostPosted: Wed Jul 03, 2019 4:51 am    Post subject: Reply with quote

I havn't used Prosody, but I did use ejabberd many years ago on an old, dead machine from which I recovered the filesystem that I still keep on line. Ejabberd also used /etc/jabber/ and /var/spool/jabber. While the /etc/jabber directory had package-specific files like ejabberd.cfg, the /var/spool/jabber directory has a lot of files I guess that the maintainer hoped would be the same across the various Jabber daemons.

I would not share the maintainer's confidence that, say, ejabberd and prosody could both use a share like /var/spool/jabber/roster.DCD without conflict. I kind of get that the he would want to set it up so that all Jabber daemons use the same set of directories, but surely that could make for problems if you wanted to replace one daemon for another.

Here's an example from a different kind of server daemon. If you wanted to switch from Apache to nginx, you'd continue to serve documents from /var/www/. The two packages, however, use their own separate /etc directories for configuration!

Jabber doesn't have standardized files to serve like a web server does, so it would sure seem to be better to use package specific directories.

Fortunately, there's a way out! I notice that the ebuilds define the environment variables JABBER_ETC and JABBER_SPOOL. These are the variables which supply the directory names you find problematic. The ebuild for ejabber defines these two also--when the same directory names as values!

The quick and dirty way to override these is to specify the environment variables on the Portage command line, like this:
Code:
JABBER_ETC=/etc/prodody JABBER_SPOOL=/var/lib/prosody emerge prodody
but that's the suboptimal way. You really would want your configuration to stick when you upgrade the package. Here's how. In the /etc/portage/env/ directory, set up file prosody.conf with these contents:
Code:
JABBER_ETC="/etc/prodody"
JABBER_SPOOL="/var/lib/prosody"

Next make a reference to this file in /etc/portage/package.env:
Code:
net-im/prosody prosody.conf


Now when you emerge prosody, the directories should be what you want.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum