From: Ralph Boehme Date: Mon, 4 Mar 2013 16:45:19 +0000 (+0100) Subject: New option 'afpstats' X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=bb8bc51e54795edffc1d2b70cb232eba79b97ffb New option 'afpstats' --- diff --git a/NEWS b/NEWS index 070b773c..7f43cf0f 100644 --- a/NEWS +++ b/NEWS @@ -18,7 +18,9 @@ Changes in 3.0.3 * NEW: AFP stats about active session via dbus IPC. Client side python program `afpstats`. Requires dbus, dbus-glib any python-dbus. configure option --dbus-sysconf-dir for specifying dbus - system security configuration files. + system security configuration files. + New option 'afpstats' (default: no) which determines whether + to enable the feature or not. * NEW: dtrace probes, cf include/atalk/afp_dtrace.d for available probes. * UPD: Reload groups when reloading volumes. FR #71. diff --git a/etc/afpd/main.c b/etc/afpd/main.c index 22650479..141d420c 100644 --- a/etc/afpd/main.c +++ b/etc/afpd/main.c @@ -329,7 +329,8 @@ int main(int ac, char **av) #ifdef HAVE_DBUS_GLIB /* Run dbus AFP statics thread */ - (void)afpstats_init(server_children); + if (obj.options.flags & OPTION_DBUS_AFPSTATS) + (void)afpstats_init(server_children); #endif afp_child_t *child; diff --git a/include/atalk/globals.h b/include/atalk/globals.h index e5fbb292..96f062a0 100644 --- a/include/atalk/globals.h +++ b/include/atalk/globals.h @@ -55,6 +55,7 @@ #define OPTION_ACL2MACCESS (1 << 8) #define OPTION_NOZEROCONF (1 << 9) #define OPTION_SHARE_RESERV (1 << 11) /* whether to use Solaris fcntl F_SHARE locks */ +#define OPTION_DBUS_AFPSTATS (1 << 12) /* whether to run dbus thread for afpstats */ #define PASSWD_NONE 0 #define PASSWD_SET (1 << 0) diff --git a/libatalk/util/netatalk_conf.c b/libatalk/util/netatalk_conf.c index b51b2a0d..fdc7e556 100644 --- a/libatalk/util/netatalk_conf.c +++ b/libatalk/util/netatalk_conf.c @@ -1719,6 +1719,8 @@ int afp_config_parse(AFPObj *AFPObj, char *processname) options->flags |= OPTION_NOSENDFILE; if (iniparser_getboolean(config, INISEC_GLOBAL, "solaris share reservations", 1)) options->flags |= OPTION_SHARE_RESERV; + if (iniparser_getboolean(config, INISEC_GLOBAL, "afpstats", 0)) + options->flags |= OPTION_DBUS_AFPSTATS; if (iniparser_getboolean(config, INISEC_GLOBAL, "afp read locks", 0)) options->flags |= OPTION_AFP_READ_LOCK; if (!iniparser_getboolean(config, INISEC_GLOBAL, "save password", 1)) diff --git a/man/man5/afp.conf.5.tmpl b/man/man5/afp.conf.5.tmpl index c03ad30a..6840bf7d 100644 --- a/man/man5/afp.conf.5.tmpl +++ b/man/man5/afp.conf.5.tmpl @@ -2,12 +2,12 @@ .\" Title: afp.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.0 -.\" Date: 19 Jan 2013 +.\" Date: 19 Feb 2013 .\" Manual: Netatalk 3.0 .\" Source: Netatalk 3.0 .\" Language: English .\" -.TH "AFP\&.CONF" "5" "19 Jan 2013" "Netatalk 3.0" "Netatalk 3.0" +.TH "AFP\&.CONF" "5" "19 Feb 2013" "Netatalk 3.0" "Netatalk 3.0" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -508,6 +508,11 @@ afp read locks = \fIBOOLEAN\fR (default: \fIno\fR) \fB(G)\fR Whether to apply locks to the byte region read in FPRead calls\&. The AFP spec mandates this, but it\*(Aqs not really in line with UNIX semantics and is a performance hug\&. .RE .PP +afpstats = \fIBOOLEAN\fR (default: \fIno\fR) \fB(G)\fR +.RS 4 +Whether to provide AFP runtime statistics (connected users, open volumes) via dbus\&. +.RE +.PP basedir regex = \fIregex\fR \fB(H)\fR .RS 4 Regular expression which matches the parent directory of the user homes\&. If @@ -871,7 +876,7 @@ cnid scheme = \fIbackend\fR \fB(V)\fR set the CNID backend to be used for the volume, default is [:DEFAULT_CNID_SCHEME:] available schemes: [:COMPILED_BACKENDS:] .RE .PP -ea = \fInone|auto|sys|ad\fR +ea = \fInone|auto|sys|ad\fR \fB(V)\fR .RS 4 Specify how Extended Attributes are stored\&. @@ -914,7 +919,7 @@ specifies the Mac client charset for this Volume, e\&.g\&. \fIMAC_CYRILLIC\fR\&. If not specified the global setting is applied\&. This setting is only required if you need volumes, where the Mac charset differs from the one globally set in the [Global] section\&. .RE .PP -casefold = \fBoption\fR +casefold = \fBoption\fR \fB(V)\fR .RS 4 The casefold option handles, if the case of filenames should be changed\&. The available options are: .sp @@ -951,7 +956,7 @@ is for directories only\&. Don\*(Aqt use with "\fBunix priv = no\fR"\&. .\} .nf file perm = 0660 directory perm = - 0770 + 0770 .fi .if n \{\ .RE