Hello,
During a review the following question came up:
Would it be OK if a package creates /var/db/<pkgname> for various kind of reasons (in this case a daemon would serve audio files the user puts there)?
In Fedora only the nscd uses this directory: /var/db/Makefile /var/db/nscd/*
The FHS doesn't contain any specific guidelines about the usage of /var/db/ and a quick web search revealed that on a couple of systems some daemons use /var/db like this /var/db/mysql /var/db/openldap etc.
1. Would it be acceptable in Fedora as well that a package creates /var/db/<pkgname> ?
2. Would it make sense in this specific case, where a streaming server would serve the audio files from this directory (per default)? Personally I think that a collection of audio files should not be considered a database and so it shouldn't be there. Since usually the user has his audio collection in his home directory, I would just configure the daemon that way, that the user has to specifically configure the directory where the files reside the server should stream...
Thanks & Best regards, Christian
Le Jeu 28 janvier 2010 11:49, Christian Krause a écrit :
Would it be OK if a package creates /var/db/<pkgname> for various kind of reasons (in this case a daemon would serve audio files the user puts there)?
In Fedora only the nscd uses this directory: /var/db/Makefile /var/db/nscd/*
The FHS doesn't contain any specific guidelines about the usage of /var/db/
On the contrary the FHS is very clear about such cases
« Applications must generally not add directories to the top level of /var. Such directories should only be added if they have some system-wide implication, and in consultation with the FHS mailing list. »
If it's not defined by the FHS, it should not be used or created.
On 01/28/2010 11:49 AM, Christian Krause wrote:
Hello,
During a review the following question came up:
Would it be OK if a package creates /var/db/<pkgname> for various kind of reasons (in this case a daemon would serve audio files the user puts there)?
Generally speaking: No.
In Fedora only the nscd uses this directory: /var/db/Makefile /var/db/nscd/*
Well, a fact which I consider similarly arguable as your case ;)
I am not sufficiently familiar with nscd, but I guess it using /var/db is a historic artifact, similar to /var/named, /var/ftp, /var/yp etc.
The FHS doesn't contain any specific guidelines about the usage of /var/db/ and a quick web search revealed that on a couple of systems some daemons use /var/db like this /var/db/mysql /var/db/openldap etc.
To my knowledge this doesn't apply to fedora, because we generally advise people to use /var/lib/<package>
- Would it be acceptable in Fedora as well that a package creates
/var/db/<pkgname> ?
I would vote against it and would recommend /var/lib/<package> or a subdirectory thereof.
This way a package can "play whatever games", inside of this directory, if it needs to.
- Would it make sense in this specific case, where a streaming server
would serve the audio files from this directory (per default)?
What kind of files are inside of this "db" directory?
Are they * an arbitrary directory hierarchy of plain "content" files? * a prestructured directory hierarchy (prestructured to meet the demands of your application) of plain "content" files? * real "database" files (e.g. indicies on something else)?
Depending on the answers to these questions, there would be several alternatives, rsp. further questions to be discussed.
Personally I think that a collection of audio files should not be considered a database and so it shouldn't be there.
c.f. my last comment.
Since usually the user has his audio collection in his home directory,
Not in real deamon driven scenario. There he would have his audio collection in an arbitrary directory, (could be a decicated user's home, could be some directory below /srv, could be elsewhere).
I would just configure the daemon that way, that the user has to specifically configure the directory where the files reside the server should stream...
Agreed, that's how I would do it.
Ralf
On 01/28/2010 12:32 PM, Ralf Corsepius wrote:
On 01/28/2010 11:49 AM, Christian Krause wrote:
- Would it be acceptable in Fedora as well that a package creates
/var/db/<pkgname> ?
I would vote against it and would recommend /var/lib/<package> or a subdirectory thereof.
This way a package can "play whatever games", inside of this directory, if it needs to.
Ok, I fully agree that for other packages, which store their own variable data, this would be the best solution.
- Would it make sense in this specific case, where a streaming server
would serve the audio files from this directory (per default)?
What kind of files are inside of this "db" directory?
Are they
- an arbitrary directory hierarchy of plain "content" files?
Yes, basically these will be the collection of audio/mp3 files the user wants to be served.
- a prestructured directory hierarchy (prestructured to meet the demands
of your application) of plain "content" files?
- real "database" files (e.g. indicies on something else)?
No.
Since usually the user has his audio collection in his home directory,
Not in real deamon driven scenario. There he would have his audio collection in an arbitrary directory, (could be a decicated user's home, could be some directory below /srv, could be elsewhere).
Yeah, agreed. We cannot predict which directory the user will use at all.
I would just configure the daemon that way, that the user has to specifically configure the directory where the files reside the server should stream...
Agreed, that's how I would do it.
Ok, we'll go this way.
Thanks for the clarification.
Best regards, Christian
packaging@lists.fedoraproject.org