SF.net SVN: gar:[23633] csw/mgar/pkg/netatalk/trunk
slowfranklin at users.sourceforge.net
slowfranklin at users.sourceforge.net
Sun May 18 08:04:15 CEST 2014
Revision: 23633
http://sourceforge.net/p/gar/code/23633
Author: slowfranklin
Date: 2014-05-18 06:04:13 +0000 (Sun, 18 May 2014)
Log Message:
-----------
Add dbus SMF manifest
Also delete unused patches
Modified Paths:
--------------
csw/mgar/pkg/netatalk/trunk/Makefile
csw/mgar/pkg/netatalk/trunk/files/CSWnetatalk.postinstall
csw/mgar/pkg/netatalk/trunk/files/CSWnetatalk.preremove
csw/mgar/pkg/netatalk/trunk/files/cswnetatalk-tracker-extract.xml
csw/mgar/pkg/netatalk/trunk/files/cswnetatalk-tracker-miner-fs.xml
Added Paths:
-----------
csw/mgar/pkg/netatalk/trunk/files/0001-Disable-dbus.patch
csw/mgar/pkg/netatalk/trunk/files/0001-Upstream-patch-to-make-dbus-optional.patch
csw/mgar/pkg/netatalk/trunk/files/cswnetatalk-dbus.xml
csw/mgar/pkg/netatalk/trunk/files/cswnetatalk.xml
Removed Paths:
-------------
csw/mgar/pkg/netatalk/trunk/files/0000-Add-rpath-for-bdb.patch
csw/mgar/pkg/netatalk/trunk/files/0001-Fix-use-of-unnamed-union-inside-struct.patch
csw/mgar/pkg/netatalk/trunk/files/0003-Fix-misspelled-compiler-variable.patch
csw/mgar/pkg/netatalk/trunk/files/0004-Prevent-SMF-manifest-import-on-install.patch
csw/mgar/pkg/netatalk/trunk/files/0006-Disable-Tracker-autostart.patch
csw/mgar/pkg/netatalk/trunk/files/netatalk.xml
Modified: csw/mgar/pkg/netatalk/trunk/Makefile
===================================================================
--- csw/mgar/pkg/netatalk/trunk/Makefile 2014-05-17 22:05:37 UTC (rev 23632)
+++ csw/mgar/pkg/netatalk/trunk/Makefile 2014-05-18 06:04:13 UTC (rev 23633)
@@ -53,7 +53,8 @@
PATCHFILES += 0003-Disable-noinst-binary-fails-to-link-on-SPARC.patch
PATCHFILES += 0004-Ensure-gsettings-is-called-from-opt-csw-bin.patch
-PATCHFILES += 0006-Disable-Tracker-autostart.patch
+PATCHFILES += 0001-Upstream-patch-to-make-dbus-optional.patch
+PATCHFILES += 0001-Disable-dbus.patch
# will be in 3.1.2:
PATCHFILES += 33dd614058f32bbe3c88734654228d8715f2403e.patch
@@ -89,6 +90,7 @@
CHECKPKG_OVERRIDES_CSWnetatalk += file-with-bad-content|/usr/share|root/var/opt/csw/svc/manifest/network/cswnetatalk.xml
CHECKPKG_OVERRIDES_CSWnetatalk += file-with-bad-content|/usr/share|root/var/opt/csw/svc/manifest/network/cswnetatalk-tracker-miner-fs.xml
CHECKPKG_OVERRIDES_CSWnetatalk += file-with-bad-content|/usr/share|root/var/opt/csw/svc/manifest/network/cswnetatalk-tracker-extract.xml
+CHECKPKG_OVERRIDES_CSWnetatalk += file-with-bad-content|/usr/share|root/var/opt/csw/svc/manifest/network/cswnetatalk-dbus.xml
CHECKPKG_OVERRIDES_CSWnetatalk += bad-rpath-entry|/opt/csw|opt/csw/bin/afppasswd
CHECKPKG_OVERRIDES_CSWnetatalk += bad-rpath-entry|/opt/csw|opt/csw/lib/netatalk/uams_dhx_pam.so
CHECKPKG_OVERRIDES_CSWnetatalk += bad-rpath-entry|/opt/csw|opt/csw/lib/netatalk/uams_dhx_passwd.so
@@ -98,8 +100,8 @@
post-install-modulated:
ginstall -d -m 755 $(DESTDIR)/var/opt/csw/svc/manifest/network
- ginstall -m 444 $(WORKSRC)/distrib/initscripts/netatalk.xml $(DESTDIR)/var/opt/csw/svc/manifest/network/
- mv $(DESTDIR)/var/opt/csw/svc/manifest/network/netatalk.xml $(DESTDIR)/var/opt/csw/svc/manifest/network/cswnetatalk.xml
+ ginstall -m 444 $(FILEDIR)/cswnetatalk.xml $(DESTDIR)/var/opt/csw/svc/manifest/network/
+ ginstall -m 444 $(FILEDIR)/cswnetatalk-dbus.xml $(DESTDIR)/var/opt/csw/svc/manifest/network/
ginstall -m 444 $(FILEDIR)/cswnetatalk-tracker-extract.xml $(DESTDIR)/var/opt/csw/svc/manifest/network/
ginstall -m 444 $(FILEDIR)/cswnetatalk-tracker-miner-fs.xml $(DESTDIR)/var/opt/csw/svc/manifest/network/
@$(MAKECOOKIE)
Deleted: csw/mgar/pkg/netatalk/trunk/files/0000-Add-rpath-for-bdb.patch
===================================================================
--- csw/mgar/pkg/netatalk/trunk/files/0000-Add-rpath-for-bdb.patch 2014-05-17 22:05:37 UTC (rev 23632)
+++ csw/mgar/pkg/netatalk/trunk/files/0000-Add-rpath-for-bdb.patch 2014-05-18 06:04:13 UTC (rev 23633)
@@ -1,34 +0,0 @@
-From 702ab8079a32e9049670cdcdc1bd6f169d3e41a9 Mon Sep 17 00:00:00 2001
-From: Ralph Boehme <sloowfranklin at gmail.com>
-Date: Sun, 5 May 2013 18:21:26 +0200
-Subject: [PATCH] Add rpath for bdb
-
----
- configure | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/configure b/configure
-index 3bbb206..5e54b19 100755
---- a/configure
-+++ b/configure
-@@ -16649,7 +16649,7 @@ fi
-
- if test x"${atalk_cv_bdb_version}" = x"yes"; then
- BDB_CFLAGS="-I${bdbdir}/include${subdir}"
-- BDB_LIBS="-L${bdblibdir} ${atalk_cv_lib_db}"
-+ BDB_LIBS="-L${bdblibdir} -R${bdblibdir} ${atalk_cv_lib_db}"
- BDB_BIN="$bdbbindir"
- BDB_PATH="$bdbdir"
- bdbfound=yes
-@@ -16742,7 +16742,7 @@ fi
-
- if test x"${atalk_cv_bdb_version}" = x"yes"; then
- BDB_CFLAGS="-I${bdbdir}/include${subdir}"
-- BDB_LIBS="-L${bdblibdir} ${atalk_cv_lib_db}"
-+ BDB_LIBS="-L${bdblibdir} -R${bdblibdir} ${atalk_cv_lib_db}"
- BDB_BIN="$bdbbindir"
- BDB_PATH="$bdbdir"
- bdbfound=yes
---
-1.8.1.4
-
Added: csw/mgar/pkg/netatalk/trunk/files/0001-Disable-dbus.patch
===================================================================
--- csw/mgar/pkg/netatalk/trunk/files/0001-Disable-dbus.patch (rev 0)
+++ csw/mgar/pkg/netatalk/trunk/files/0001-Disable-dbus.patch 2014-05-18 06:04:13 UTC (rev 23633)
@@ -0,0 +1,48 @@
+From 0e56bd27a2801a7d7df210262adb2ec61e6dc03f Mon Sep 17 00:00:00 2001
+From: Ralph Boehme <sloowfranklin at gmail.com>
+Date: Sun, 18 May 2014 07:02:00 +0200
+Subject: [PATCH] Disable dbus
+
+---
+ etc/netatalk/netatalk.c | 13 +------------
+ 1 file changed, 1 insertion(+), 12 deletions(-)
+
+diff --git a/etc/netatalk/netatalk.c b/etc/netatalk/netatalk.c
+index 640d386..a0e6f80 100644
+--- a/etc/netatalk/netatalk.c
++++ b/etc/netatalk/netatalk.c
+@@ -411,22 +411,12 @@ int main(int argc, char **argv)
+ sigdelset(&blocksigs, SIGHUP);
+ sigprocmask(SIG_SETMASK, &blocksigs, NULL);
+
+-#ifdef HAVE_TRACKER
+ if (obj.options.flags & OPTION_SPOTLIGHT) {
++#ifdef HAVE_TRACKER
+ setenv("DBUS_SESSION_BUS_ADDRESS", "unix:path=" _PATH_STATEDIR "spotlight.ipc", 1);
+ setenv("XDG_DATA_HOME", _PATH_STATEDIR, 0);
+ setenv("XDG_CACHE_HOME", _PATH_STATEDIR, 0);
+ setenv("TRACKER_USE_LOG_FILES", "1", 0);
+-
+- dbus_path = atalk_iniparser_getstring(obj.iniconfig, INISEC_GLOBAL, "dbus daemon", DBUS_DAEMON_PATH);
+- LOG(log_debug, logtype_default, "DBUS: '%s'", dbus_path);
+- if ((dbus_pid = run_process(dbus_path, "--config-file=" _PATH_CONFDIR "dbus-session.conf", NULL)) == NETATALK_SRV_ERROR) {
+- LOG(log_error, logtype_default, "Error starting '%s'", dbus_path);
+- netatalk_exit(EXITERR_CONF);
+- }
+-
+- /* Allow dbus some time to start up */
+- sleep(1);
+ #endif
+
+ #ifdef HAVE_TRACKER_SPARQL
+@@ -437,7 +427,6 @@ int main(int argc, char **argv)
+ setenv("TRACKER_LANGUAGE_STOPWORDS_DIR", TRACKER_PREFIX "/share/tracker/languages", 0);
+ #endif
+ set_sl_volumes();
+- system(TRACKER_PREFIX "/bin/tracker-control -s");
+ #endif
+ }
+
+--
+1.8.4.1
+
Deleted: csw/mgar/pkg/netatalk/trunk/files/0001-Fix-use-of-unnamed-union-inside-struct.patch
===================================================================
--- csw/mgar/pkg/netatalk/trunk/files/0001-Fix-use-of-unnamed-union-inside-struct.patch 2014-05-17 22:05:37 UTC (rev 23632)
+++ csw/mgar/pkg/netatalk/trunk/files/0001-Fix-use-of-unnamed-union-inside-struct.patch 2014-05-18 06:04:13 UTC (rev 23633)
@@ -1,181 +0,0 @@
-From fa8a635cd0894ee40d05d41482608707b5b2419c Mon Sep 17 00:00:00 2001
-From: Ralph Boehme <sloowfranklin at gmail.com>
-Date: Thu, 2 May 2013 10:23:02 +0200
-Subject: [PATCH] Fix use of unnamed union inside struct
-
----
- include/atalk/dsi.h | 2 +-
- libatalk/dsi/dsi_close.c | 2 +-
- libatalk/dsi/dsi_cmdreply.c | 2 +-
- libatalk/dsi/dsi_getsess.c | 6 +++---
- libatalk/dsi/dsi_getstat.c | 2 +-
- libatalk/dsi/dsi_opensess.c | 2 +-
- libatalk/dsi/dsi_read.c | 2 +-
- libatalk/dsi/dsi_stream.c | 6 +++---
- libatalk/dsi/dsi_tcp.c | 2 +-
- libatalk/dsi/dsi_write.c | 2 +-
- 10 files changed, 14 insertions(+), 14 deletions(-)
-
-diff --git a/include/atalk/dsi.h b/include/atalk/dsi.h
-index fc1af46..c31b522 100644
---- a/include/atalk/dsi.h
-+++ b/include/atalk/dsi.h
-@@ -48,7 +48,7 @@ struct dsi_block {
- union {
- uint32_t dsi_code; /* error code */
- uint32_t dsi_doff; /* data offset */
-- };
-+ } dsi_data;
- uint32_t dsi_len; /* total data length */
- uint32_t dsi_reserved; /* reserved field */
- };
-diff --git a/libatalk/dsi/dsi_close.c b/libatalk/dsi/dsi_close.c
-index 892b982..199954f 100644
---- a/libatalk/dsi/dsi_close.c
-+++ b/libatalk/dsi/dsi_close.c
-@@ -21,7 +21,7 @@ void dsi_close(DSI *dsi)
- dsi->header.dsi_flags = DSIFL_REQUEST;
- dsi->header.dsi_command = DSIFUNC_CLOSE;
- dsi->header.dsi_requestID = htons(dsi_serverID(dsi));
-- dsi->header.dsi_code = dsi->header.dsi_reserved = htonl(0);
-+ dsi->header.dsi_data.dsi_code = dsi->header.dsi_reserved = htonl(0);
- dsi->cmdlen = 0;
- dsi_send(dsi);
- dsi->proto_close(dsi);
-diff --git a/libatalk/dsi/dsi_cmdreply.c b/libatalk/dsi/dsi_cmdreply.c
-index 5b0d627..04d1708 100644
---- a/libatalk/dsi/dsi_cmdreply.c
-+++ b/libatalk/dsi/dsi_cmdreply.c
-@@ -25,7 +25,7 @@ int dsi_cmdreply(DSI *dsi, const int err)
-
- dsi->header.dsi_flags = DSIFL_REPLY;
- dsi->header.dsi_len = htonl(dsi->datalen);
-- dsi->header.dsi_code = htonl(err);
-+ dsi->header.dsi_data.dsi_code = htonl(err);
-
- ret = dsi_stream_send(dsi, dsi->data, dsi->datalen);
-
-diff --git a/libatalk/dsi/dsi_getsess.c b/libatalk/dsi/dsi_getsess.c
-index 38477be..a928d34 100644
---- a/libatalk/dsi/dsi_getsess.c
-+++ b/libatalk/dsi/dsi_getsess.c
-@@ -65,9 +65,9 @@ int dsi_getsession(DSI *dsi, server_child_t *serv_children, int tickleval, afp_c
- LOG(log_error, logtype_dsi, "dsi_getsess: %s", strerror(errno));
- close(ipc_fds[0]);
- dsi->header.dsi_flags = DSIFL_REPLY;
-- dsi->header.dsi_code = DSIERR_SERVBUSY;
-+ dsi->header.dsi_data.dsi_code = DSIERR_SERVBUSY;
- dsi_send(dsi);
-- dsi->header.dsi_code = DSIERR_OK;
-+ dsi->header.dsi_data.dsi_code = DSIERR_OK;
- kill(pid, SIGKILL);
- }
- dsi->proto_close(dsi);
-@@ -81,7 +81,7 @@ int dsi_getsession(DSI *dsi, server_child_t *serv_children, int tickleval, afp_c
- (dsi->header.dsi_command == DSIFUNC_OPEN)) {
- LOG(log_info, logtype_dsi, "dsi_getsess: too many connections");
- dsi->header.dsi_flags = DSIFL_REPLY;
-- dsi->header.dsi_code = DSIERR_TOOMANY;
-+ dsi->header.dsi_data.dsi_code = DSIERR_TOOMANY;
- dsi_send(dsi);
- exit(EXITERR_CLNT);
- }
-diff --git a/libatalk/dsi/dsi_getstat.c b/libatalk/dsi/dsi_getstat.c
-index dac4f76..4be9b80 100644
---- a/libatalk/dsi/dsi_getstat.c
-+++ b/libatalk/dsi/dsi_getstat.c
-@@ -20,7 +20,7 @@ void dsi_getstatus(DSI *dsi)
- {
- dsi->header.dsi_flags = DSIFL_REPLY;
- /*dsi->header.dsi_command = DSIFUNC_STAT;*/
-- dsi->header.dsi_code = dsi->header.dsi_reserved = 0;
-+ dsi->header.dsi_data.dsi_code = dsi->header.dsi_reserved = 0;
-
- memcpy(dsi->commands, dsi->status, dsi->statuslen);
- dsi->cmdlen = dsi->statuslen;
-diff --git a/libatalk/dsi/dsi_opensess.c b/libatalk/dsi/dsi_opensess.c
-index a2dcb4c..2945f9b 100644
---- a/libatalk/dsi/dsi_opensess.c
-+++ b/libatalk/dsi/dsi_opensess.c
-@@ -44,7 +44,7 @@ void dsi_opensession(DSI *dsi)
- /* let the client know the server quantum. we don't use the
- * max server quantum due to a bug in appleshare client 3.8.6. */
- dsi->header.dsi_flags = DSIFL_REPLY;
-- dsi->header.dsi_code = 0;
-+ dsi->header.dsi_data.dsi_code = 0;
- /* dsi->header.dsi_command = DSIFUNC_OPEN;*/
-
- dsi->cmdlen = 2 * (2 + sizeof(i)); /* length of data. dsi_send uses it. */
-diff --git a/libatalk/dsi/dsi_read.c b/libatalk/dsi/dsi_read.c
-index a0cbd87..31ee3bd 100644
---- a/libatalk/dsi/dsi_read.c
-+++ b/libatalk/dsi/dsi_read.c
-@@ -31,7 +31,7 @@ ssize_t dsi_readinit(DSI *dsi, void *buf, const size_t buflen, const size_t size
- dsi->flags |= DSI_NOREPLY; /* we will handle our own replies */
- dsi->header.dsi_flags = DSIFL_REPLY;
- dsi->header.dsi_len = htonl(size);
-- dsi->header.dsi_code = htonl(err);
-+ dsi->header.dsi_data.dsi_code = htonl(err);
-
- dsi->in_write++;
- if (dsi_stream_send(dsi, buf, buflen)) {
-diff --git a/libatalk/dsi/dsi_stream.c b/libatalk/dsi/dsi_stream.c
-index 05c36fc..afce54e 100644
---- a/libatalk/dsi/dsi_stream.c
-+++ b/libatalk/dsi/dsi_stream.c
-@@ -45,7 +45,7 @@ static void dsi_header_pack_reply(const DSI *dsi, char *buf)
- buf[0] = dsi->header.dsi_flags;
- buf[1] = dsi->header.dsi_command;
- memcpy(buf + 2, &dsi->header.dsi_requestID, sizeof(dsi->header.dsi_requestID));
-- memcpy(buf + 4, &dsi->header.dsi_code, sizeof(dsi->header.dsi_code));
-+ memcpy(buf + 4, &dsi->header.dsi_data.dsi_code, sizeof(dsi->header.dsi_data.dsi_code));
- memcpy(buf + 8, &dsi->header.dsi_len, sizeof(dsi->header.dsi_len));
- memcpy(buf + 12, &dsi->header.dsi_reserved, sizeof(dsi->header.dsi_reserved));
- }
-@@ -366,7 +366,7 @@ ssize_t dsi_stream_read_file(DSI *dsi, const int fromfd, off_t offset, const siz
- dsi->flags |= DSI_NOREPLY;
- dsi->header.dsi_flags = DSIFL_REPLY;
- dsi->header.dsi_len = htonl(length);
-- dsi->header.dsi_code = htonl(err);
-+ dsi->header.dsi_data.dsi_code = htonl(err);
- dsi_header_pack_reply(dsi, block);
-
- #ifdef HAVE_SENDFILEV
-@@ -615,7 +615,7 @@ int dsi_stream_receive(DSI *dsi)
- return 0;
-
- memcpy(&dsi->header.dsi_requestID, block + 2, sizeof(dsi->header.dsi_requestID));
-- memcpy(&dsi->header.dsi_code, block + 4, sizeof(dsi->header.dsi_code));
-+ memcpy(&dsi->header.dsi_data.dsi_code, block + 4, sizeof(dsi->header.dsi_data.dsi_code));
- memcpy(&dsi->header.dsi_len, block + 8, sizeof(dsi->header.dsi_len));
- memcpy(&dsi->header.dsi_reserved, block + 12, sizeof(dsi->header.dsi_reserved));
- dsi->clientID = ntohs(dsi->header.dsi_requestID);
-diff --git a/libatalk/dsi/dsi_tcp.c b/libatalk/dsi/dsi_tcp.c
-index f73147a..731252e 100644
---- a/libatalk/dsi/dsi_tcp.c
-+++ b/libatalk/dsi/dsi_tcp.c
-@@ -209,7 +209,7 @@ static pid_t dsi_tcp_open(DSI *dsi)
- dsi->header.dsi_command = block[1];
- memcpy(&dsi->header.dsi_requestID, block + 2,
- sizeof(dsi->header.dsi_requestID));
-- memcpy(&dsi->header.dsi_code, block + 4, sizeof(dsi->header.dsi_code));
-+ memcpy(&dsi->header.dsi_data.dsi_code, block + 4, sizeof(dsi->header.dsi_data.dsi_code));
- memcpy(&dsi->header.dsi_len, block + 8, sizeof(dsi->header.dsi_len));
- memcpy(&dsi->header.dsi_reserved, block + 12,
- sizeof(dsi->header.dsi_reserved));
-diff --git a/libatalk/dsi/dsi_write.c b/libatalk/dsi/dsi_write.c
-index 65a479e..dc35caf 100644
---- a/libatalk/dsi/dsi_write.c
-+++ b/libatalk/dsi/dsi_write.c
-@@ -32,7 +32,7 @@ size_t dsi_writeinit(DSI *dsi, void *buf, const size_t buflen _U_)
-
- /* figure out how much data we have. do a couple checks for 0
- * data */
-- header = ntohl(dsi->header.dsi_doff);
-+ header = ntohl(dsi->header.dsi_data.dsi_doff);
- dsi->datasize = header ? ntohl(dsi->header.dsi_len) - header : 0;
-
- if (dsi->datasize > 0) {
---
-1.8.1.4
-
Added: csw/mgar/pkg/netatalk/trunk/files/0001-Upstream-patch-to-make-dbus-optional.patch
===================================================================
--- csw/mgar/pkg/netatalk/trunk/files/0001-Upstream-patch-to-make-dbus-optional.patch (rev 0)
+++ csw/mgar/pkg/netatalk/trunk/files/0001-Upstream-patch-to-make-dbus-optional.patch 2014-05-18 06:04:13 UTC (rev 23633)
@@ -0,0 +1,224 @@
+From 7da8df4a160508ed323caca495f04db923064718 Mon Sep 17 00:00:00 2001
+From: Ralph Boehme <sloowfranklin at gmail.com>
+Date: Sun, 18 May 2014 06:37:24 +0200
+Subject: [PATCH] Upstream patch to make dbus optional
+
+---
+ etc/netatalk/netatalk.c | 97 +++++++++++++++++++++++++++++--------------------
+ 1 file changed, 58 insertions(+), 39 deletions(-)
+
+diff --git a/etc/netatalk/netatalk.c b/etc/netatalk/netatalk.c
+index 4cdc466..640d386 100644
+--- a/etc/netatalk/netatalk.c
++++ b/etc/netatalk/netatalk.c
+@@ -48,24 +48,37 @@
+ /* how many seconds we wait to shutdown from SIGTERM before we send SIGKILL */
+ #define KILL_GRACETIME 5
+
++/* defines that control whether services should run by default */
++#define NETATALK_SRV_NEEDED -1
++#define NETATALK_SRV_OPTIONAL 0
++#define NETATALK_SRV_ERROR NETATALK_SRV_NEEDED
++
+ /* forward declaration */
+ static pid_t run_process(const char *path, ...);
+ static void kill_childs(int sig, ...);
+
+ /* static variables */
+ static AFPObj obj;
+-static pid_t afpd_pid = -1, cnid_metad_pid = -1, dbus_pid = -1;
+-static uint afpd_restarts, cnid_metad_restarts, dbus_restarts, trackerd_restarts;
++static pid_t afpd_pid = NETATALK_SRV_NEEDED;
++static pid_t cnid_metad_pid = NETATALK_SRV_NEEDED;
++static pid_t dbus_pid = NETATALK_SRV_OPTIONAL;
++static uint afpd_restarts, cnid_metad_restarts, dbus_restarts;
+ static struct event_base *base;
+ struct event *sigterm_ev, *sigquit_ev, *sigchld_ev, *timer_ev;
+ static int in_shutdown;
+ static const char *dbus_path;
+-static char *trackerd_loglev;
+
+ /******************************************************************
+ * Misc stuff
+ ******************************************************************/
+
++static bool service_running(pid_t pid)
++{
++ if ((pid != NETATALK_SRV_NEEDED) && (pid != NETATALK_SRV_OPTIONAL))
++ return true;
++ return false;
++}
++
+ /* Set Tracker Miners to index all our volumes */
+ static int set_sl_volumes(void)
+ {
+@@ -203,17 +216,21 @@ static void sigchld_cb(evutil_socket_t fd, short what, void *arg)
+ }
+
+ if (pid == afpd_pid)
+- afpd_pid = -1;
++ afpd_pid = NETATALK_SRV_ERROR;
+ else if (pid == cnid_metad_pid)
+- cnid_metad_pid = -1;
++ cnid_metad_pid = NETATALK_SRV_ERROR;
+ else if (pid == dbus_pid)
+- dbus_pid = -1;
++ dbus_pid = NETATALK_SRV_ERROR;
+ else
+ LOG(log_error, logtype_afpd, "Bad pid: %d", pid);
+ }
+
+- if (in_shutdown && afpd_pid == -1 && cnid_metad_pid == -1 && dbus_pid == -1)
++ if (in_shutdown
++ && !service_running(afpd_pid)
++ && !service_running(cnid_metad_pid)
++ && !service_running(dbus_pid)) {
+ event_base_loopbreak(base);
++ }
+ }
+
+ /* timer callback */
+@@ -222,7 +239,7 @@ static void timer_cb(evutil_socket_t fd, short what, void *arg)
+ if (in_shutdown)
+ return;
+
+- if (afpd_pid == -1) {
++ if (afpd_pid == NETATALK_SRV_NEEDED) {
+ afpd_restarts++;
+ LOG(log_note, logtype_afpd, "Restarting 'afpd' (restarts: %u)", afpd_restarts);
+ if ((afpd_pid = run_process(_PATH_AFPD, "-d", "-F", obj.options.configfile, NULL)) == -1) {
+@@ -230,7 +247,7 @@ static void timer_cb(evutil_socket_t fd, short what, void *arg)
+ }
+ }
+
+- if (cnid_metad_pid == -1) {
++ if (cnid_metad_pid == NETATALK_SRV_NEEDED) {
+ cnid_metad_restarts++;
+ LOG(log_note, logtype_afpd, "Restarting 'cnid_metad' (restarts: %u)", cnid_metad_restarts);
+ if ((cnid_metad_pid = run_process(_PATH_CNID_METAD, "-d", "-F", obj.options.configfile, NULL)) == -1) {
+@@ -239,10 +256,10 @@ static void timer_cb(evutil_socket_t fd, short what, void *arg)
+ }
+
+ #ifdef HAVE_TRACKER
+- if (dbus_pid == -1) {
++ if (dbus_pid == NETATALK_SRV_NEEDED) {
+ dbus_restarts++;
+ LOG(log_note, logtype_afpd, "Restarting 'dbus' (restarts: %u)", dbus_restarts);
+- if ((dbus_pid = run_process(dbus_path, "--config-file=" _PATH_CONFDIR "dbus.session.conf", NULL)) == -1) {
++ if ((dbus_pid = run_process(dbus_path, "--config-file=" _PATH_CONFDIR "dbus-session.conf", NULL)) == -1) {
+ LOG(log_error, logtype_default, "Error starting '%s'", dbus_path);
+ }
+ }
+@@ -262,7 +279,7 @@ static void kill_childs(int sig, ...)
+ va_start(args, sig);
+
+ while ((pid = va_arg(args, pid_t *)) != NULL) {
+- if (*pid == -1)
++ if (*pid == NETATALK_SRV_ERROR || *pid == NETATALK_SRV_OPTIONAL)
+ continue;
+ kill(*pid, sig);
+ }
+@@ -279,7 +296,7 @@ static void netatalk_exit(int ret)
+ /* this forks() and exec() "path" with varags as argc[] */
+ static pid_t run_process(const char *path, ...)
+ {
+- int ret, i = 0;
++ int i = 0;
+ #define MYARVSIZE 64
+ char *myargv[MYARVSIZE];
+ va_list args;
+@@ -299,7 +316,7 @@ static pid_t run_process(const char *path, ...)
+ }
+ va_end(args);
+
+- ret = execv(path, myargv);
++ (void)execv(path, myargv);
+
+ /* Yikes! We're still here, so exec failed... */
+ LOG(log_error, logtype_cnid, "Fatal error in exec: %s", strerror(errno));
+@@ -358,12 +375,12 @@ int main(int argc, char **argv)
+
+ LOG(log_note, logtype_default, "Netatalk AFP server starting");
+
+- if ((afpd_pid = run_process(_PATH_AFPD, "-d", "-F", obj.options.configfile, NULL)) == -1) {
++ if ((afpd_pid = run_process(_PATH_AFPD, "-d", "-F", obj.options.configfile, NULL)) == NETATALK_SRV_ERROR) {
+ LOG(log_error, logtype_afpd, "Error starting 'afpd'");
+ netatalk_exit(EXITERR_CONF);
+ }
+
+- if ((cnid_metad_pid = run_process(_PATH_CNID_METAD, "-d", "-F", obj.options.configfile, NULL)) == -1) {
++ if ((cnid_metad_pid = run_process(_PATH_CNID_METAD, "-d", "-F", obj.options.configfile, NULL)) == NETATALK_SRV_ERROR) {
+ LOG(log_error, logtype_afpd, "Error starting 'cnid_metad'");
+ netatalk_exit(EXITERR_CONF);
+ }
+@@ -395,42 +412,44 @@ int main(int argc, char **argv)
+ sigprocmask(SIG_SETMASK, &blocksigs, NULL);
+
+ #ifdef HAVE_TRACKER
+- setenv("DBUS_SESSION_BUS_ADDRESS", "unix:path=" _PATH_STATEDIR "spotlight.ipc", 1);
+- setenv("XDG_DATA_HOME", _PATH_STATEDIR, 0);
+- setenv("XDG_CACHE_HOME", _PATH_STATEDIR, 0);
+- setenv("TRACKER_USE_LOG_FILES", "1", 0);
+-
+- dbus_path = atalk_iniparser_getstring(obj.iniconfig, INISEC_GLOBAL, "dbus daemon", DBUS_DAEMON_PATH);
+- LOG(log_debug, logtype_default, "DBUS: '%s'", dbus_path);
+- if ((dbus_pid = run_process(dbus_path, "--config-file=" _PATH_CONFDIR "dbus-session.conf", NULL)) == -1) {
+- LOG(log_error, logtype_default, "Error starting '%s'", dbus_path);
+- netatalk_exit(EXITERR_CONF);
+- }
++ if (obj.options.flags & OPTION_SPOTLIGHT) {
++ setenv("DBUS_SESSION_BUS_ADDRESS", "unix:path=" _PATH_STATEDIR "spotlight.ipc", 1);
++ setenv("XDG_DATA_HOME", _PATH_STATEDIR, 0);
++ setenv("XDG_CACHE_HOME", _PATH_STATEDIR, 0);
++ setenv("TRACKER_USE_LOG_FILES", "1", 0);
++
++ dbus_path = atalk_iniparser_getstring(obj.iniconfig, INISEC_GLOBAL, "dbus daemon", DBUS_DAEMON_PATH);
++ LOG(log_debug, logtype_default, "DBUS: '%s'", dbus_path);
++ if ((dbus_pid = run_process(dbus_path, "--config-file=" _PATH_CONFDIR "dbus-session.conf", NULL)) == NETATALK_SRV_ERROR) {
++ LOG(log_error, logtype_default, "Error starting '%s'", dbus_path);
++ netatalk_exit(EXITERR_CONF);
++ }
+
+- /* Allow dbus some time to start up */
+- sleep(1);
++ /* Allow dbus some time to start up */
++ sleep(1);
+ #endif
+
+ #ifdef HAVE_TRACKER_SPARQL
+ #ifdef SOLARIS
+- setenv("XDG_DATA_DIRS", TRACKER_PREFIX "/share", 0);
+- setenv("TRACKER_DB_ONTOLOGIES_DIR", TRACKER_PREFIX "/share/tracker/ontologies", 0);
+- setenv("TRACKER_EXTRACTOR_RULES_DIR", TRACKER_PREFIX "/share/tracker/extract-rules", 0);
+- setenv("TRACKER_LANGUAGE_STOPWORDS_DIR", TRACKER_PREFIX "/share/tracker/languages", 0);
++ setenv("XDG_DATA_DIRS", TRACKER_PREFIX "/share", 0);
++ setenv("TRACKER_DB_ONTOLOGIES_DIR", TRACKER_PREFIX "/share/tracker/ontologies", 0);
++ setenv("TRACKER_EXTRACTOR_RULES_DIR", TRACKER_PREFIX "/share/tracker/extract-rules", 0);
++ setenv("TRACKER_LANGUAGE_STOPWORDS_DIR", TRACKER_PREFIX "/share/tracker/languages", 0);
+ #endif
+- set_sl_volumes();
+- system(TRACKER_PREFIX "/bin/tracker-control -s");
++ set_sl_volumes();
++ system(TRACKER_PREFIX "/bin/tracker-control -s");
+ #endif
++ }
+
+ /* run the event loop */
+ ret = event_base_dispatch(base);
+
+- if (afpd_pid != -1 || cnid_metad_pid != -1 || dbus_pid != -1) {
+- if (afpd_pid != -1)
++ if (service_running(afpd_pid) || service_running(cnid_metad_pid) || service_running(dbus_pid)) {
++ if (service_running(afpd_pid))
+ LOG(log_error, logtype_afpd, "AFP service did not shutdown, killing it");
+- if (cnid_metad_pid != -1)
++ if (service_running(cnid_metad_pid))
+ LOG(log_error, logtype_afpd, "CNID database service did not shutdown, killing it");
+- if (dbus_pid != -1)
++ if (service_running(dbus_pid))
+ LOG(log_error, logtype_afpd, "DBUS session daemon still running, killing it");
+ kill_childs(SIGKILL, &afpd_pid, &cnid_metad_pid, &dbus_pid, NULL);
+ }
+--
+1.8.4.1
+
Deleted: csw/mgar/pkg/netatalk/trunk/files/0003-Fix-misspelled-compiler-variable.patch
===================================================================
--- csw/mgar/pkg/netatalk/trunk/files/0003-Fix-misspelled-compiler-variable.patch 2014-05-17 22:05:37 UTC (rev 23632)
+++ csw/mgar/pkg/netatalk/trunk/files/0003-Fix-misspelled-compiler-variable.patch 2014-05-18 06:04:13 UTC (rev 23633)
@@ -1,36 +0,0 @@
-From a03430e9e6b9f9a83902e652cad6d06d3931ce3e Mon Sep 17 00:00:00 2001
-From: Ralph Boehme <sloowfranklin at gmail.com>
-Date: Thu, 2 May 2013 10:28:11 +0200
-Subject: [PATCH 3/3] Fix misspelled compiler variable
-
----
- configure | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/configure b/configure
-index f34f304..3bbb206 100755
---- a/configure
-+++ b/configure
-@@ -17413,7 +17413,7 @@ fi
-
-
- CFLAGS="$save_CFLAGS"
--LDLFLAGS="$save_LDLFLAGS"
-+LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
-
-
-@@ -21818,8 +21818,8 @@ $as_echo " CFLAGS = $ZEROCONF_CFLAGS" >&6; }
- if test x"$netatalk_cv_ldap" = x"yes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: LDAP:" >&5
- $as_echo " LDAP:" >&6; }
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: LIBS = $LDAP_LDLFLAGS $LDAP_LIBS" >&5
--$as_echo " LIBS = $LDAP_LDLFLAGS $LDAP_LIBS" >&6; }
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: LIBS = $LDAP_LDFLAGS $LDAP_LIBS" >&5
-+$as_echo " LIBS = $LDAP_LDFLAGS $LDAP_LIBS" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: CFLAGS = $LDAP_CFLAGS" >&5
- $as_echo " CFLAGS = $LDAP_CFLAGS" >&6; }
- fi
---
-1.8.1.4
-
Deleted: csw/mgar/pkg/netatalk/trunk/files/0004-Prevent-SMF-manifest-import-on-install.patch
===================================================================
--- csw/mgar/pkg/netatalk/trunk/files/0004-Prevent-SMF-manifest-import-on-install.patch 2014-05-17 22:05:37 UTC (rev 23632)
+++ csw/mgar/pkg/netatalk/trunk/files/0004-Prevent-SMF-manifest-import-on-install.patch 2014-05-18 06:04:13 UTC (rev 23633)
@@ -1,25 +0,0 @@
-From 4f487a28be731ecd36e30ea2ca3b4039ba69132a Mon Sep 17 00:00:00 2001
-From: Ralph Boehme <sloowfranklin at gmail.com>
-Date: Wed, 8 May 2013 13:59:21 +0200
-Subject: [PATCH] Prevent SMF manifest import on install
-
----
- distrib/initscripts/Makefile.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/distrib/initscripts/Makefile.in b/distrib/initscripts/Makefile.in
-index 3ceeba3..e030cc6 100644
---- a/distrib/initscripts/Makefile.in
-+++ b/distrib/initscripts/Makefile.in
-@@ -719,7 +719,7 @@ uninstall: uninstall-startup
- @USE_NETBSD_TRUE at uninstall-startup: uninstall-am
-
- @USE_SOLARIS_TRUE at install-data-hook:
-- at USE_SOLARIS_TRUE@ svccfg import netatalk.xml
-+# @USE_SOLARIS_TRUE@ svccfg import netatalk.xml
-
- @USE_SOLARIS_TRUE at uninstall-startup:
- @USE_SOLARIS_TRUE@ svccfg delete network/netatalk
---
-1.8.1.4
-
Deleted: csw/mgar/pkg/netatalk/trunk/files/0006-Disable-Tracker-autostart.patch
===================================================================
--- csw/mgar/pkg/netatalk/trunk/files/0006-Disable-Tracker-autostart.patch 2014-05-17 22:05:37 UTC (rev 23632)
+++ csw/mgar/pkg/netatalk/trunk/files/0006-Disable-Tracker-autostart.patch 2014-05-18 06:04:13 UTC (rev 23633)
@@ -1,24 +0,0 @@
-From 7c7fc8caad4ff92b63962ed35f342a28e2c79398 Mon Sep 17 00:00:00 2001
-From: Ralph Boehme <sloowfranklin at gmail.com>
-Date: Sat, 17 May 2014 09:56:50 +0200
-Subject: [PATCH] Disable Tracker autostart
-
----
- etc/netatalk/netatalk.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/etc/netatalk/netatalk.c b/etc/netatalk/netatalk.c
-index 4cdc466..1a304d1 100644
---- a/etc/netatalk/netatalk.c
-+++ b/etc/netatalk/netatalk.c
-@@ -419,7 +419,6 @@ int main(int argc, char **argv)
- setenv("TRACKER_LANGUAGE_STOPWORDS_DIR", TRACKER_PREFIX "/share/tracker/languages", 0);
- #endif
- set_sl_volumes();
-- system(TRACKER_PREFIX "/bin/tracker-control -s");
- #endif
-
- /* run the event loop */
---
-1.8.4.1
-
Modified: csw/mgar/pkg/netatalk/trunk/files/CSWnetatalk.postinstall
===================================================================
--- csw/mgar/pkg/netatalk/trunk/files/CSWnetatalk.postinstall 2014-05-17 22:05:37 UTC (rev 23632)
+++ csw/mgar/pkg/netatalk/trunk/files/CSWnetatalk.postinstall 2014-05-18 06:04:13 UTC (rev 23633)
@@ -1,5 +1,5 @@
#!/bin/sh
chroot ${PKG_INSTALL_ROOT:-/} /usr/sbin/svccfg import /var/opt/csw/svc/manifest/network/cswnetatalk.xml > /dev/null 2>&1
-
+chroot ${PKG_INSTALL_ROOT:-/} /usr/sbin/svccfg import /var/opt/csw/svc/manifest/network/cswnetatalk-dbus.xml > /dev/null 2>&1
chroot ${PKG_INSTALL_ROOT:-/} /usr/sbin/svccfg import /var/opt/csw/svc/manifest/network/cswnetatalk-tracker-extract.xml > /dev/null 2>&1
chroot ${PKG_INSTALL_ROOT:-/} /usr/sbin/svccfg import /var/opt/csw/svc/manifest/network/cswnetatalk-tracker-miner-fs.xml > /dev/null 2>&1
Modified: csw/mgar/pkg/netatalk/trunk/files/CSWnetatalk.preremove
===================================================================
--- csw/mgar/pkg/netatalk/trunk/files/CSWnetatalk.preremove 2014-05-17 22:05:37 UTC (rev 23632)
+++ csw/mgar/pkg/netatalk/trunk/files/CSWnetatalk.preremove 2014-05-18 06:04:13 UTC (rev 23633)
@@ -1,4 +1,5 @@
#!/bin/sh
chroot ${PKG_INSTALL_ROOT:-/} /usr/sbin/svccfg delete -f cswnetatalk
+chroot ${PKG_INSTALL_ROOT:-/} /usr/sbin/svccfg delete -f cswnetatalk-dbus
chroot ${PKG_INSTALL_ROOT:-/} /usr/sbin/svccfg delete -f cswnetatalk-tracker-extract
chroot ${PKG_INSTALL_ROOT:-/} /usr/sbin/svccfg delete -f cswnetatalk-tracker-miner-fs
Added: csw/mgar/pkg/netatalk/trunk/files/cswnetatalk-dbus.xml
===================================================================
(Binary files differ)
Index: csw/mgar/pkg/netatalk/trunk/files/cswnetatalk-dbus.xml
===================================================================
--- csw/mgar/pkg/netatalk/trunk/files/cswnetatalk-dbus.xml 2014-05-17 22:05:37 UTC (rev 23632)
+++ csw/mgar/pkg/netatalk/trunk/files/cswnetatalk-dbus.xml 2014-05-18 06:04:13 UTC (rev 23633)
Property changes on: csw/mgar/pkg/netatalk/trunk/files/cswnetatalk-dbus.xml
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/xml
\ No newline at end of property
Modified: csw/mgar/pkg/netatalk/trunk/files/cswnetatalk-tracker-extract.xml
===================================================================
(Binary files differ)
Modified: csw/mgar/pkg/netatalk/trunk/files/cswnetatalk-tracker-miner-fs.xml
===================================================================
(Binary files differ)
Added: csw/mgar/pkg/netatalk/trunk/files/cswnetatalk.xml
===================================================================
(Binary files differ)
Index: csw/mgar/pkg/netatalk/trunk/files/cswnetatalk.xml
===================================================================
--- csw/mgar/pkg/netatalk/trunk/files/cswnetatalk.xml 2014-05-17 22:05:37 UTC (rev 23632)
+++ csw/mgar/pkg/netatalk/trunk/files/cswnetatalk.xml 2014-05-18 06:04:13 UTC (rev 23633)
Property changes on: csw/mgar/pkg/netatalk/trunk/files/cswnetatalk.xml
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/xml
\ No newline at end of property
Deleted: csw/mgar/pkg/netatalk/trunk/files/netatalk.xml
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list