Wo kann ich ein Fileshare unter FreeBSD ablegen?

444
bradarnett

Ich möchte eine allgemeine Dateifreigabe auf meiner FreeBSD-Box einrichten. Ich habe vor, es über mehrere Dienste (nfs / samba / etc) verfügbar zu machen, aber ich frage mich, ob es einen bestimmten Ort gibt, der der "richtige" Ort ist, um ein solches Verzeichnis zu erstellen.

Ich weiß, dass ich technisch einfach ein Verzeichnis bei / share oder wo auch immer ich mag, erstellen kann, aber ich bin daran interessiert, was genau der strenge Standard (falls vorhanden) vorschlägt.

1

3 Antworten auf die Frage

1
TOOGAM

I believe the best answer will be under /srv.

The best place to check is your operating system's manual page named "hier" (which are the first letters from the word "hierarchy", referring to the filesystem layout/hierarchy). Run "man hier". Or look online; since you mentioned FreeBSD, I can provide you with this convenient hyperlink to the online version of FreeBSD's manual page for "hier".

I quickly scanned that and didn't notice any directories that seemed to specifically match what you describe. So, for this particular purpose, that man page doesn't provide the answer. However, checking that first is a good practice. This way, if you do start to use an operating system which does have a customization relevant to a task that you are doing, you may end up following documentation that works most consistent with other software (like other parts of the operating system) that use the same design.

So, since this particular operating system's "hier" page doesn't provide anything more specific, the next place to check is some sort of standardized location that isn't very specific to your operating system. The best standard for that is FHS. FHS 2.3 documentation of /srv notes the purpose of that directory is:

site-specific data which is served by this system

It has examples of:

structuring data under /srv is by protocol, eg. ftp, rsync, www, and cvs

So I would suggest either /srv/smb/ (unless you prefer /srv/cifs/). However, as noted in the FHS documentation, the subdirectories under /srv/ "will differ from host to host", so that is simply a suggested example layout and you are welcome to customize it (while still being "compliant" to the standard).

1
Amiramix

Ich stelle meine Inhalte aus Gefängnissen zur Verfügung, z. B. ein Gefängnis für Git-Repositories, ein anderes Gefängnis für NFS / SFTP-Freigaben, ein anderes für WWW- oder IMAP-E-Mails usw. Für mich ist es daher sinnvoll, diese Freigaben innerhalb der Dateisysteme dieser Gefängnisse zu haben, zum Beispiel /j/nas/sftpuser/disk1, /j/git/gituser/repos, /j/mda/mail, /j/web/www. Auf diese Weise können sie von Daemons, die in diesen Gefängnissen laufen, abgerufen und bedient werden.

Es handelt sich um ZFS-Datasets, deren logischer Speicherort sich nach den Vererbungsregeln unterscheidet. Zum Beispiel befinden sich SFTP- und WWW-Freigaben unter einem übergeordneten Datensatz mit " atimegedreht" offaber " compressiongedreht" on.

0
Frank Thomas

There isn't a specific place. Here is the FreeBSD documentation on that point. The Directory structure standard concerns itself with programs, configuration files, and structures for core OS operations, but has almost nothing to say about Data.

The best fit is a subdir of var like /var/shares as it does usually store data, but at the same time, var is really mostly used to store data for system applications, and is supposed to be transient, not archival. Sometimes people do weird things with mount points in var, like mounting ram disks, or another temporary storage technique.

Obwohl meine Antwort eine andere Option bietet, wollte ich diese ansprechen. Bevor die Dateistruktur von LSB zu FHS weiterentwickelt wurde, wurde generell empfohlen, ein Verzeichnis unter / var für Daten zu verwenden, die möglicherweise aktualisiert werden. Die Einführung von FHS war nicht allgemein sofort (und bleibt bis heute weitgehend unvollständig), so dass selbst nach / srv / von einigen Plattformen empfohlen und verwendet wurde, andere Betriebssysteme verwendeten / var. Als Beispiel zeigt [hier] (http://serverfault.com/questions/124127/linux-fhs-srv-vs-var-where-do-i-put-stuff) an, dass Fedora / RHEL / var nach einigen anderen verwendet verwendet / srv TOOGAM vor 8 Jahren 0