Parameterize log levels and log formats

The log levels and log formats are now customizable through
dcache.conf.

New configuration properties:

dcache.log.level.file
dcache.log.level.pinboard
dcache.log.level.remote
dcache.log.level.events
dcache.log.format.file
dcache.log.format.pinboard

Target: master
Require-notes: yes
Require-book: yes
Acked-by: Albert Rossi <arossi@fnal.gov>
Patch: http://rb.dcache.org/r/5530/
(cherry picked from commit a96423a403e3c4ad12f99d02191c3f80157a4549)
logging: Set remote appender log level to off by default

Unless explicitly configured, we should not attempt to send any log events to
the remote appender (both for performance reasons and as a workaround for the
problem with the socket appender connecting to itself).

Target: trunk
Request: 2.6
Require-book: yes
Require-notes: yes
Patch: http://rb.dcache.org/r/5664/
Acked-by: Albert Rossi <arossi@fnal.gov>
Fix quickJava for some shell versions

The current implementation and usage of quickJava relies on a shell-
specific behaviour; specifically, that specifying a environment
variable for a command that is actually a shell function becomes
an environment variable for that shell function.

Although this works for some versions of bash, it's now clear that
there are other versions of bash (and perhaps other shells) for
which this does not hold.

This patch fixes this problem by explicitly exporting the CLASSPATH
variable as an environment variable.

Patch: http://rb.dcache.org/r/5603
Acked-by: Tigran Mkrtchyan
Target: master
Requires-book: no
Requires-notes: no
(cherry picked from commit 083a7eb7263186d4cc72d2e8123459ab286d81e7)
Respect session read-only in SRM

Ticket: 7842
Acked-by: Al Rossi
Target: 2.6
Require-book: no
Require-notes: yes
gplazma: Fix DN extraction from proxy certificates

Addresses an issue in the x509 and xacml plugins in which the DN of
a proxy certificate rather the the DN of the user is extracted.

Extracting the DN of the user owning a proxy certificate involves
traversing the certificate chain, discarding any proxy certificates,
until the user's real certificate is found. The existing code in
dCache is not aware of all possible proxy certificate types, which
in some cases lead it to extract the DN of a proxy certififcate
rather than the user's DN.

Target: trunk
Request: 2.6
Require-notes: yes
Require-book: no
Acked-by: Albert Rossi <arossi@fnal.gov>
Patch: http://rb.dcache.org/r/5667/
(cherry picked from commit b848b326b54eec0b5196febbff1201a65d1403d7)
cells: Remove "Sending CellException to" log message

Addresses an issue of frequent "Sending CellException to" messages in log files.
This is a regression introduced when we removed the last pieces of the old
logging system from dCache. These messages used to be surpressed, but now
happen to be logged.

The patch improves the text of the log message and changes the log level to
debug.

Target: trunk
Request: 2.6
Require-notes: yes
Require-book: no
Acked-by: Albert Rossi <arossi@fnal.gov>
Patch: http://rb.dcache.org/r/5665/
(cherry picked from commit b419ba459fd57eeac1bd0af4554340436a364360)
(2.6) dcache-webadmin (alarms): provide option for absence of alarms database

module: dcache-webadmin, dcache (alarms)

The ticket reported an SQL stack trace error in the httpd log under the condition that they (a) are not running an alarmserver, and (b) have left the default settings for alarms alone.

The immediate fix was for them to set alarms.store.db.type=xml, but it makes sense for there to be an "off" option on this property as well.

This patch adds this option and makes it the default.  This complements the change of the remote log level default to off as well.

Testing done:

The following configurations were checked:

1.  type = off, alarmserver started
    (a) alarmserver reports: 21 Jun 2013 09:29:53 (alarms) [] alarms database type is OFF; server will not be started
    (b) httpd reports: nothing
    (c) page: The datastore for alarms and warnings has been disabled (see the configuration alarm properties).

2.  type = xml, no store.xml, alarmserver not started
    (b) httpd reports: nothing
    (c) page: The datastore for alarms and warnings has been disabled (see the configuration alarm properties).

3.  type = xml, alarmserver started
    everything is sane

4.  type = xml, with store.xml, alarmserver not started
    (b) httpd reports: nothing
    (c) page: query returns only what is currently in db.

5.  type = rdbms, no alarms db; alarmserver not started
    (b) httpd reports the underlying DataNucleus stack traces for "alarms database does not exist"
    (c) page: reports Internal error
    I would argue this is the correct behavior.  It is a misconfiguration.

6.  type = rdbms, no alarms db; alarmserver started
    (a) alarmserver reports Failed to create bean 'liquibase' : FATAL: database "alarms" does not exist from ac_create_$_2_3
        stops and tries to restart
    (b)/(c) same as above
    Again, this is correct behavior.

7.  type = rdbms, alarmserver not started
    (b) httpd reports: nothing
    (c) page: query returns only what is currently in db.

8.  type = rdbms, alarmserver started
    everything is sane

Target: master
Patch: http://rb.dcache.org/r/5668
Ticket: http://rt.dcache.org/Ticket/Display.html?id=7887
Request: 2.6
Require-notes: yes
Require-book: yes
Acked-by: Gerd

RELEASE NOTES:
BOOK:

The options for alarms.store.db.type are not off,xml,rdbms, with off being the default.  If no alarms service is desired, the off option will prevent the web page from trying to establish a connection the the database.
webdav: Fix problems with root paths

Addresses several issues in the webdav door:

- HTTP PUT without redirect is broken in earlier versions of 2.6. This
  regression was introduced in b460302934a6dab2cde1202a38883552d62ac65d.

  The problem is that the the resource path after upload is produced by
  concatenating the server's root path with a full dCache name space path,
  thus the root path appear twice in the generated path.

- The URI name space depends on who authenticates, which means that the
  same URI can have several meanings. This makes bookmarking and linking
  difficult.

- The CSS refers to a non-existing background image.

The solution to these problems are related. The patch removes the
webdavChrootToUserRoot property. An authenticated users root directory
is now always enforced, but only by checking that the request is within
the users root path. If a user has a non-null root and accesses the
root of the webdav door, a redirect to the users home directory is
generated.

The above change resulted in repeated authentication requests in the
browser, because the browser would try to access a non-existing
background image and a non-existing favicon.ico file. Access to these
would be denied, as they are outside the users root directory, and
thus the browser would ask for another user name and password. To
solve this problem, the patch fixes the CSS and adds a favicon.ico file.

An earlier version of this patch was submitted as http://rb.dcache.org/r/5201/

Target: trunk
Request: 2.6
Require-book: yes
Require-notes: yes
Acked-by: Dmitry Litvintsev <litvinse@fnal.gov>
Patch: http://rb.dcache.org/r/5672/
(cherry picked from commit e48a670d502815203704af59a2dedfa7307c13ba)

Conflicts:
	modules/dcache-webdav/src/main/java/org/dcache/webdav/DcacheResourceFactory.java
Merge pull request #101 from gbehrmann/fix/2.6/rb5530

Parameterize log levels and log formats
Merge pull request #102 from gbehrmann/fix/2.6/rb5664

logging: Set remote appender log level to off by default
Merge pull request #103 from gbehrmann/fix/2.6/rb5603

Fix quickJava for some shell versions
Merge pull request #105 from gbehrmann/fix/2.6/rb5667

gplazma: Fix DN extraction from proxy certificates
Merge pull request #106 from gbehrmann/fix/2.6/rb5665

cells: Remove "Sending CellException to" log message
Merge pull request #104 from DmitryLitvintsev/fix/2.6/fix_srm_readonly

Respect session read-only in SRM
Merge pull request #108 from alrossi/fix/2.6/alarm_server_off_option

(2.6) dcache-webadmin (alarms): provide option for absence of alarms dat...
Merge pull request #109 from gbehrmann/fix/2.6/rb5672

webdav: Fix problems with root paths
Merge remote branch 'main/2.6' into feature/2.6/billing_soa
Removed the old (superfluous) loginBroker=LoginBroker definition for dcache.properties.