]> arthur.barton.de Git - netatalk.git/commitdiff
Merge master
authorFrank Lahm <franklahm@googlemail.com>
Mon, 20 Jun 2011 08:23:33 +0000 (10:23 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Mon, 20 Jun 2011 08:23:33 +0000 (10:23 +0200)
16 files changed:
NEWS
config/Makefile.am
configure.in
distrib/initscripts/rc.atalk.suse.tmpl
etc/afpd/Makefile.am
etc/cnid_dbd/cmd_dbd.c
etc/cnid_dbd/db_param.h
macros/summary.m4
man/man1/dbd.1
test/afpd/Makefile.am
test/afpd/afpfunc_helpers.c
test/afpd/afpfunc_helpers.h
test/afpd/subtests.c
test/afpd/subtests.h
test/afpd/test.c
test/afpd/test.h

diff --git a/NEWS b/NEWS
index 2a54c2b9dad44dd8d957bd9093cf1c64142abda1..e096cad84061c7ed28de36e3521ebb181a5acb90 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+Changes in 2.2.1
+================
+
+* FIX: cnid_dbd: increase BerkeleyDB locks and lockobjs
+* FIX: afpd: increase BerkeleyDB locks and lockobjs
+* FIX: suse: initscript return better status
+
 Changes in 2.2
 ==============
 
@@ -125,6 +132,7 @@ Changes in 2.1.6
 * FIX: AppleDouble buffer overrun by extremely long filename
 * UPD: afpd: return version info with machine type in DSIGetStatus
 * UPD: dbd: use on-disk temporary rebuild db instead of in-memory db
+* UPD: suse: initscript update
 
 Changes in 2.1.5
 ================
index 1131fe6c8bc0c82faaaaecc45627ad2e5eb7526c..bd503aebb8a407065ae8ea8d4964be4f26a5fc9d 100644 (file)
@@ -69,7 +69,7 @@ install-config-files: $(CONFFILES) $(GENFILES)
                fi; \
        done
 if USE_DEBIAN
-       $(mkinstalldirs) $(DESTDIR)/default
+       $(mkinstalldirs) $(DESTDIR)/etc/default
        if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f /etc/default/netatalk; then \
                echo "$(INSTALL_DATA) $(srcdir)/netatalk.conf $(DESTDIR)/etc/default/netatalk"; \
                $(INSTALL_DATA) $(srcdir)/netatalk.conf $(DESTDIR)/etc/default/netatalk; \
index ea334e47e72210699089039979e18396ca1bb73b..78bdd2be7c2f55c37582c749fca3176b63d020a2 100644 (file)
@@ -8,6 +8,7 @@ AC_SUBST(NETATALK_VERSION)
 AC_CANONICAL_SYSTEM
 AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
 AM_CONFIG_HEADER(config.h)
+AM_MAINTAINER_MODE([enable])
 
 dnl Checks for programs.
 AC_PROG_AWK
index 886591bcd8a98a7067d1f09967df84d3ea3393d8..f392d51cfc5a6cd1480a0eb040227ab487a86f0b 100755 (executable)
@@ -7,29 +7,15 @@
 # 
 ### BEGIN INIT INFO
 # Provides:       netatalk
-# Required-Start: $network $named $remote_fs $syslog
-# Required-Stop:
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Should-Start:  $network $named $remote_fs $syslog slpd
+# Should-Stop:   $remote_fs $network $syslog
 # Default-Start:  3 5
 # Default-Stop:
-# Description:    AFP over TCP and legacy Appletalk daemons
+# Description:    AFP over TCP and legacy AppleTalk daemons
 ### END INIT INFO
 
-test -f /etc/rc.config && {
-. /etc/rc.config
-
-# Determine the base and follow a runlevel link name.
-base=${0##*/}
-link=${base#*[SK][0-9][0-9]}
-
-# Force execution if not called by a runlevel directory.
-test $link = $base && START_ATALK=yes
-test "$START_ATALK" = "yes" || exit 0
-
-test -f /etc/rc.status && . /etc/rc.status
-# The echo return value for success (defined in /etc/rc.config).
-return=$rc_done
-}
-
 ATALK_NAME=`hostname|sed 's/\..*$//'`
 ATALK_UNIX_CHARSET='LOCALE'
 ATALK_MAC_CHARSET='MAC_ROMAN'
@@ -48,44 +34,59 @@ TIMELORD_RUN=no
 ATALK_ZONE=
 ATALK_BGROUND=no
 
-
+. /etc/rc.status
 . :ETCDIR:/netatalk.conf
 
 # startup code for everything
 atalk_startup() {
     if [ x"${ATALKD_RUN}" != x"no" ]; then 
-       echo -n "  Starting atalkd:"
-       :SBINDIR:/atalkd
+       echo -n "  Starting atalkd ... "
+       :SBINDIR:/atalkd ; my_ec=$?
 
-       if [ -x :BINDIR:/nbprgstr ]; then       
+       if [ -x :BINDIR:/nbprgstr -a "$my_ec" = "0" ]; then     
+           echo -n ".. "
            :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:Workstation
+           echo -n ". "
            :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:netatalk
-
        fi      
+       if [ "$my_ec" != "0" ] ; then false ; fi
+       rc_status -v
+       
+       rc_reset
 
        if [ x"${PAPD_RUN}" = x"yes"  -a -x :SBINDIR:/papd ]; then
-           echo -n "  Starting papd:"
+           echo -n "  Starting papd"
            :SBINDIR:/papd
+           rc_status -v
        fi
 
+       rc_reset
+
        if [ x"${TIMELORD_RUN}" = x"yes"  -a -x :SBINDIR:/timelord ]; then
            echo -n "  Starting timelord"
            :SBINDIR:/timelord
+           rc_status -v
        fi
 
+       rc_reset
+
     fi
 
     if [ x"${CNID_METAD_RUN}" = x"yes" -a -x :SBINDIR:/cnid_metad ] ; then
-           echo -n "  Starting cnid_metad:"
-        startproc :SBINDIR:/cnid_metad $CNID_CONFIG
+           echo -n "  Starting cnid_metad "
+           startproc :SBINDIR:/cnid_metad ${CNID_CONFIG}
+           rc_status -v
     fi
 
     if [ x"${AFPD_RUN}" = x"yes" -a -x :SBINDIR:/afpd ] ; then
-           echo -n "  Starting afpd:"
-           echo ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
+           echo -n "  Starting afpd ("
+           echo -n ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
                -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE}
+           echo -n ")"
            startproc :SBINDIR:/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
-               -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE}
+               ${AFPD_OPTIONS} \
+               -c ${AFPD_MAX_CLIENTS} -n "${ATALK_NAME}${ATALK_ZONE}"
+           rc_status -v
     fi
 
        touch /var/lock/subsys/atalk 
@@ -93,41 +94,59 @@ atalk_startup() {
 
 case "$1" in
     start)
+       if test ! -z "$UID" -a "$UID" != 0 ; then
+               echo "you have to be root to start netatalk daemons"
+               rc_failed
+       else
        if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then 
-           echo "Starting netatalk in the background ... "
+           echo -n "Starting netatalk in the background ..."
            atalk_startup >& /dev/null &
+           rc_status -v
        else
            echo "Starting netatalk (this may take a while) ..."
            atalk_startup
        fi
+       fi
        ;;
     stop)
-       echo -n "Shutting down netatalk:"
-       killproc -TERM :SBINDIR:/papd
-        if test -x :SBINDIR:/timelord ; then
-         killproc -TERM :SBINDIR:/timelord
-        fi        
-       killproc -TERM :SBINDIR:/atalkd
+       echo -n "Shutting down netatalk"
+       if test -x :SBINDIR:/papd ; then
+           killproc -TERM :SBINDIR:/papd
+       fi
+       if test -x :SBINDIR:/timelord ; then
+           killproc -TERM :SBINDIR:/timelord
+       fi
+       if test -x :SBINDIR:/atalkd ; then
+           killproc -TERM :SBINDIR:/atalkd
+       fi
+       killproc -TERM :SBINDIR:/cnid_metad
        killproc -TERM :SBINDIR:/afpd
-       if test -x :SBINDIR:/cnid_metad ; then
-         killproc -TERM :SBINDIR:/cnid_metad
-        fi
-       echo -e "$return"
+
+       rc_status -v
        ;;
-    restart|reload)
-       $0 stop && $0 start || return=$rc_failed
+    restart|reload|force-reload)
+       $0 stop
+       $0 start
+       rc_status
        ;;
     status)
-       echo -n "Checking for service atalk:"
-       checkproc :SBINDIR:/papd && echo -n "OK" || echo -n "No process"
-       checkproc :SBINDIR:/afpd && echo -n "OK" || echo "No process"
-        if test -x :SBINDIR:/timelord ; then
-         checkproc :SBINDIR:/timelord || return=$rc_failed
-        fi
-        if test -x :SBINDIR:/cnid_metad ; then
-         checkproc :SBINDIR:/cnid_metad || return=$rc_failed
-        fi
-        checkproc :SBINDIR:/atalkd && echo "OK" || echo "No process"   
+       echo "Checking for netatalk services"
+       if [ x"${ATALKD_RUN}" = x"yes" -a -x :SBINDIR:/atalkd ] ; then
+           checkproc :SBINDIR:/atalkd && echo -n "atalkd: OK   " || echo -n "atalkd: No process        "
+       fi
+       if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ] ; then
+           checkproc :SBINDIR:/papd && echo -n "papd: OK       " || echo -n "papd: No process  "
+       fi
+       if [ x"${TIMELORD_RUN}" = x"yes" -a -x :SBINDIR:/timelord ] ; then
+           checkproc :SBINDIR:/timelord && echo -n   " timelord: OK    " || echo -n " timelord: No process     "
+       fi
+       if [ x"${CNID_METAD_RUN}" = x"yes" ] ; then
+           checkproc :SBINDIR:/cnid_metad && echo -n " cnid_metad: OK  " || echo -n " cnid_metad: No process   "
+       fi
+       checkproc :SBINDIR:/afpd && echo "afpd: OK" || echo "afpd: No process"
+       # assume that afpd is the "main" process ...
+       checkproc :SBINDIR:/afpd
+       rc_status -v
        ;;
     *)
        echo "Usage: $0 {start|stop|restart|status}"
@@ -135,7 +154,4 @@ case "$1" in
        ;;
 esac
 
-# Inform the caller not only verbosely and set an exit status.
-test "$return" = "$rc_done" || exit 1
-exit 0
-
+rc_exit
index 34edab51f9c439a68b8f8656715ea19c4ebe27ae..40ca70ccde8f004010bdaa0e0b9abf5ed781a9e5 100644 (file)
@@ -70,7 +70,7 @@ afpd_SOURCES += acls.c
 endif
 
 
-noinst_HEADERS = auth.h afp_config.h desktop.h directory.h file.h \
+noinst_HEADERS = auth.h afp_config.h desktop.h directory.h fce_api_internal.h file.h \
         filedir.h fork.h icon.h mangle.h misc.h status.h switch.h \
         uam_auth.h uid.h unix.h volume.h hash.h acls.h acl_mappings.h extattrs.h \
         dircache.h afp_zeroconf.h afp_avahi.h
index 5493a28059461cb525f49f99ecaa0cbf16dbb15d..e07741564136026d719db8505bb04df8f3101c0c 100644 (file)
@@ -199,11 +199,8 @@ static void usage (void)
            "      Options: -c Don't create .AppleDouble stuff, only cleanup orphaned.\n"
            "               -f wipe database and rebuild from IDs stored in AppleDouble files,\n"
            "                  only available for volumes without 'nocnidcache' option. Implies -e.\n\n"
-           "   -u Prepare upgrade:\n"
-           "      Before installing an upgraded version of Netatalk that is linked against\n"
-           "      a newer BerkeleyDB lib, run `dbd -u ...` from the OLD Netatalk pior to\n"
-           "      upgrading on all volumes. This removes the BerkleyDB environment.\n"
-           "      On exit cnid_dbd does this automatically, so normally calling dbd -u should not be necessary.\n\n"
+           "   -u Upgrade:\n"
+           "      Opens the database which triggers any necessary upgrades, then closes and exits.\n\n"
            "General options:\n"
            "   -e only work on inactive volumes and lock them (exclusive)\n"
            "   -x rebuild indexes (just for completeness, mostly useless!)\n"
@@ -374,13 +371,6 @@ int main(int argc, char **argv)
             goto exit_failure;
     }
 
-    /* Prepare upgrade ? */
-    if (prep_upgrade) {
-        if (dbif_env_remove(dbpath))
-            goto exit_failure;
-        goto exit_success;
-    }        
-
     /* Check if -f is requested and wipe db if yes */
     if ((flags & DBD_FLAGS_FORCE) && rebuild && (volinfo.v_flags & AFPVOL_CACHE)) {
         char cmd[8 + MAXPATHLEN];
@@ -420,6 +410,12 @@ int main(int argc, char **argv)
             dbif_close(dbd);
             goto exit_failure;
         }
+
+        /* Prepare upgrade ? We're done */
+        if (prep_upgrade) {
+            (void)dbif_txn_close(dbd, 1);
+            goto cleanup;
+        }
     }
 
     /* Downgrade db lock if not running exclusive */
@@ -441,6 +437,7 @@ int main(int argc, char **argv)
         }
     }
 
+cleanup:
     /* Cleanup */
     dbd_log(LOGDEBUG, "Closing db");
     if (! nocniddb) {
index fce1cb5a9ddc89883745a30d1a386ed4be3cca81..0d6e9b9eb7b2b28d0599886d3c71703defc3e569 100644 (file)
@@ -11,8 +11,8 @@
 
 #define DEFAULT_LOGFILE_AUTOREMOVE 1
 #define DEFAULT_CACHESIZE          (8 * 1024) /* KB, so 8 MB */
-#define DEFAULT_MAXLOCKS           5000
-#define DEFAULT_MAXLOCKOBJS        5000
+#define DEFAULT_MAXLOCKS           20000
+#define DEFAULT_MAXLOCKOBJS        20000
 #define DEFAULT_FLUSH_FREQUENCY    1000
 #define DEFAULT_FLUSH_INTERVAL     1800
 #define DEFAULT_USOCK_FILE         "usock"
index 84109816bb7fa590a12345d5f14b29e1d9f0c50b..744c4f2b7f8e05aade37cece7e06728fbbd0a49d 100644 (file)
@@ -52,6 +52,8 @@ dnl   fi
        AC_MSG_RESULT([         valid shell check:       $netatalk_cv_use_shellcheck])
        AC_MSG_RESULT([         cracklib support:        $netatalk_cv_with_cracklib])
        AC_MSG_RESULT([         Samba sharemode interop: $neta_cv_have_smbshmd])
+       AC_MSG_RESULT([         ACL support:             $with_acl_support])
+       AC_MSG_RESULT([         LDAP support:            $with_ldap])
        if test x"$use_pam_so" = x"yes" -a x"$netatalk_cv_install_pam" = x"no"; then
                AC_MSG_RESULT([])
                AC_MSG_WARN([ PAM support was configured for your system, but the netatalk PAM configuration file])
index caff254846f426d85fd1f3505ece5c5265afcd2c..e45581399e0e1ef6cad1778ff0a6b20c49689453 100644 (file)
@@ -251,9 +251,9 @@ option\&. Implies
 .PP
 \-u
 .RS 4
-Prepare upgrade:
+Upgrade:
 .sp
-Before installing an upgraded version of Netatalk that is linked against a newer BerkeleyDB lib, run `dbd \-u \&.\&.\&.` from the OLD Netatalk pior to upgrading on all volumes\&. This removes the BerkleyDB environment\&. On exit cnid_dbd does this automatically, so normally calling dbd \-u should not be necessary !
+Opens the database which triggers any necessary upgrades, then closes and exits\&.
 .RE
 .SH "OPTIONS"
 .PP
index 2bb6b3e9d56b9c81047602a37ca197f8b96c77fe..ca379e0eec0fcd6c79f29c8d7164ed3f97ccc6ef 100644 (file)
@@ -25,6 +25,8 @@ test_SOURCES =  test.c subtests.c afpfunc_helpers.c \
                                $(top_builddir)/etc/afpd/directory.c \
                                $(top_builddir)/etc/afpd/enumerate.c \
                                $(top_builddir)/etc/afpd/extattrs.c \
+                               $(top_builddir)/etc/afpd/fce_api.c \
+                               $(top_builddir)/etc/afpd/fce_util.c \
                                $(top_builddir)/etc/afpd/file.c \
                                $(top_builddir)/etc/afpd/filedir.c \
                                $(top_builddir)/etc/afpd/fork.c \
index b5b8165f0b33dfce0772848c57d931e92a1f8dcd..fe443c15747bd50e3fee07086baedee53d8eb67e 100644 (file)
 #include <atalk/directory.h>
 #include <atalk/queue.h>
 #include <atalk/bstrlib.h>
+#include <atalk/globals.h>
 
 #include "file.h"
 #include "filedir.h"
 #include "directory.h"
 #include "dircache.h"
 #include "hash.h"
-#include "globals.h"
 #include "afp_config.h"
 #include "volume.h"
 
index 3fda7df321cd94e5eae0b438cd85a3c686607a83..2a0fcd23c43ec6a6ff12acefe613767e6a4a0a35 100644 (file)
 #include <atalk/directory.h>
 #include <atalk/queue.h>
 #include <atalk/bstrlib.h>
+#include <atalk/globals.h>
 
 #include "file.h"
 #include "filedir.h"
 #include "directory.h"
 #include "dircache.h"
 #include "hash.h"
-#include "globals.h"
 #include "afp_config.h"
 #include "volume.h"
 
index 6e76a18ce8dae3c3b71694ff8621924ac31b75a5..cdc4f58b90d3202718802d1e009b6830a1c13ba8 100644 (file)
 #include <atalk/directory.h>
 #include <atalk/queue.h>
 #include <atalk/bstrlib.h>
+#include <atalk/globals.h>
 
 #include "directory.h"
 #include "dircache.h"
 #include "hash.h"
-#include "globals.h"
 #include "afp_config.h"
 #include "volume.h"
 
index 1ce10a06fd11b18744ccd26f1471323a5ee7b3d9..ee32144a51682eeaa2d0af8358133274406fce7b 100644 (file)
 #include <atalk/directory.h>
 #include <atalk/queue.h>
 #include <atalk/bstrlib.h>
+#include <atalk/globals.h>
 
 #include "directory.h"
 #include "dircache.h"
 #include "hash.h"
-#include "globals.h"
 #include "afp_config.h"
 #include "volume.h"
 
index c554260cb85bb0c7962a55ffab0b2a2516c9fc5b..74008019c7c77283f27e7ea719494b72eb3e960b 100644 (file)
 #include <atalk/directory.h>
 #include <atalk/queue.h>
 #include <atalk/bstrlib.h>
+#include <atalk/globals.h>
 
 #include "file.h"
 #include "filedir.h"
 #include "directory.h"
 #include "dircache.h"
 #include "hash.h"
-#include "globals.h"
 #include "afp_config.h"
 #include "volume.h"
 
index 802120a24a9b58d55de864dbef272ff05e348840..382a5bd5bfaaf1502b7626cbdb7192b265f2c05b 100644 (file)
 #include <atalk/directory.h>
 #include <atalk/queue.h>
 #include <atalk/bstrlib.h>
+#include <atalk/globals.h>
 
 #include "directory.h"
 #include "dircache.h"
 #include "hash.h"
-#include "globals.h"
 #include "afp_config.h"
 #include "volume.h"
 #include "subtests.h"