Gentoo Archives: gentoo-dev

From: Stuart Herbert <stuart@g.o>
To: gentoo-dev@l.g.o
Cc: tigger@g.o
Subject: [gentoo-dev] RFC: GLEP #20: /srv - Services Home Directory Support
Date: Mon, 23 Feb 2004 19:15:39
Message-Id: 200402231915.19528.stuart@gentoo.org
1 http://www.gentoo.org/proj/en/glep/glep-0020.html
2
3 GLEP: 20
4 Title: /srv - Services Home Directory Support
5 Version: $Revision: 1.1 $
6 Last-Modified: $Date: 2004/02/22 02:09:07 $
7 Author: Stuart Herbert <stuart@g.o>, Rob Holland <tigger@g.o>
8 Status: Draft
9 Type: Standards Track
10 Content-Type: text/x-rst
11 Created: 09-Feb-2004
12 Post-History: 21-Feb-2004
13
14 Thanks To
15 =========
16
17 Thanks to Robin H. Johnson (robbat2@g.o) for his assistance in writing
18 this GLEP.
19
20 Abstract
21 ========
22
23 This GLEP proposes a new root-level directory - /srv - as an optional home
24 for the data (and sometimes the software too) for software that provides
25 services.
26
27 /srv will be supported via a USE flag. This gives users the choice
28 of using a dedicated service home hierarchy or not.
29
30 /srv is defined in FHS 2.3, which is part of the upcoming LSB v2.0 release
31 (http://bugs.freestandards.org/cgi-bin/bugzilla/show_bug.cgi?id=16)
32
33 Motivation
34 ==========
35
36 Gentoo currently does not provide sufficiently flexible support for
37 sites which wish to consolidate the data for their service-orientated
38 software under one simple, easy to administer, location.
39
40 Adding optional support for the /srv directory structure will give
41 sites increased flexibility on how to layout their machines.
42
43 Specification
44 =============
45
46 A new global USE flag - srvdir - will be added to Portage.
47
48 Ebuilds that choose to support the srvdir USE flag will configure the
49 package to install and use their data under the /srv directory.
50
51 Ebuilds that choose to support the srvdir USE flag - and which install
52 packages that need write access to the same directories that the
53 software is installed into - will configure the package to install
54 the software under the /srv directory.
55
56 All packages configured to support the srvdir USE flag will support
57 this breakdown of /srv:
58
59 /srv/<fqdn>/<service>/<service-specific tree>
60
61 where
62 <fqdn> is the fully-qualified domain name
63 <service> is the name of the service
64 <service-specific tree> is unique to the package
65
66 Ebuilds that install anything into /srv will install into /srv/localhost.
67 /srv/localhost - or any of the <service> directories underneath it - may be
68 symlinks created by the local administrator.
69
70 Examples
71 ========
72
73 For example, backup packages which support the srvdir USE flag could
74 save backup data under the /srv/<hostname>/backups directory for each
75 host on the network that they perform backups for.
76
77 For example, web-based applications which support the srvdir USE flag
78 could install their software under the /srv/localhost/www/htdocs directory.
79 Ebuilds for web-based applications which also support the vhost USE flag
80 will allow the user to install software under other service domains
81 through the webapp-config package. See GLEP #11 and the vhost-config tool for
82 more information on how this works.
83
84 There are many other packages that could support the srvdir USE flag -
85 including Portage itself.
86
87 For packages that do not support the srvdir USE flag, there is currently no
88 recommended default location to use - although /var/localhost may prove a
89 useful alternative.
90
91 Rationale
92 =========
93
94 Introducing optional support for the /srv directory will benefit a number of
95 groups of Gentoo users.
96
97 * Users who wish to have /usr mounted read-only
98
99 /srv provides an optional alternative for packages that install writable
100 files into /usr.
101
102 * Users who wish to isoloate services from /home utilisation
103
104 Services stop working when real users fill /home. As many packages cannot
105 detect or robustly cope with this situation, services that write files
106 to disk normally end up corrupting those files.
107
108 * Users who do not wish to export /var or its sub-directories
109
110 Exporting /var - or its subdirectories - via NFS et al is something that
111 some system administrators simply do not wish to do. Providing these users
112 with the choice of installing into /srv fits with the published Gentoo
113 philosophy of allowing users as much choice as possible.
114
115 * Users who share resources via NFS, or who use Network-Attached Storage (NAS)
116
117 Allowing system administrators to choose to configure service-providing
118 software to use a single file hierarchy will greatly simply the management
119 and maintenance of NFS exports - and imports - in clustered environments.
120
121 * Service providers, who host more than one customer's services on a machine
122
123 Grouping all the storage (web, ftp, databases, IMAP, etc etc) under one
124 location greatly simplifies managing disk quotas on that host.
125
126 It is common practice for shared hosted systems to place web sites,
127 ftp sites and so on under a user's actual home directory. This practice
128 requires the user's home directory to be world-readable, which does not
129 promote strong security!
130
131 * Users who wish to store service-orientated files onto a single logical
132 volume to support future growth
133
134 The Gentoo Philosophy clearly states that Gentoo Linux will be a
135 highly-configurable meta-distribution. Adding optional support for /srv is
136 very much in keeping with our Philosophy.
137
138 Implementation
139 ==============
140
141 A new USE flag - srvdir - will be added to Portage.
142
143 Ebuilds and eclasses will choose to support the srvdir USE flag or not on
144 an individual basis.
145
146 (Author's note: If this GLEP is approved, all web-based applications will
147 support the srvdir USE flag through the work being carried out under GLEP #11)
148
149 There has been some debate about whether the /srv directory should be provided
150 by the basesystem package or not. Because this support is optional, and
151 because different sites will have different storage requirements, we believe
152 that it should be left to the local Gentoo system administrator to manually
153 create the /srv directory.
154
155 If baselayout feels that it must install a /srv, then we propose that
156 baselayout installs /srv as a symlink to /var/srv. This approach will support
157 installations that mount the root filesystem read-only.
158
159 Backwards Compatibility
160 =======================
161
162 Users who choose not to use the new srvdir USE flag will see little to no
163 change. It is likely that some ebuilds will change their non-srvdir directory
164 layout to reduce the amount of effort required to support both options.
165
166 Copyright
167 =========
168
169 This document is licensed under the Creative Commons - Attribution / Share
170 Alike license. (http://creativecommons.org/licenses/by-sa/1.0)
171
172 Best regards,
173 Stu
174 --
175 Stuart Herbert stuart@g.o
176 Gentoo Developer http://www.gentoo.org/
177 Beta packages for download http://dev.gentoo.org/~stuart/packages/
178 Come and meet me in March 2004 http://www.phparch.com/cruise/
179
180 GnuGP key id# F9AFC57C available from http://pgp.mit.edu
181 Key fingerprint = 31FB 50D4 1F88 E227 F319 C549 0C2F 80BA F9AF C57C
182 --