Enlightenment CVS committal

Author  : mej
Project : e17
Module  : apps/entrance

Dir     : e17/apps/entrance/src/daemon


Modified Files:
        Entranced.h Makefile.am spawner.c util.c util.h 


Log Message:
Tue Mar 13 13:14:28 2007                        Michael Jennings (mej)

Fix "make distcheck" by replacing $sysconfdir with a value that
doesn't contain $prefix if, and only if, $prefix is /usr or
/usr/local.  Otherwise, the user must specify --sysconfdir if they
want configuration outside $prefix.

Use AC_PATH_PROG() to determine $xbin value.

Fix init script to work with LSB-standard chkconfig.

Move IPC socket and PID file to proper location in /var/run, not in
/var or /var/lib.

entrance_login belongs in sbin.  entrance_wrapper belongs in bin.
NEITHER belongs in /usr/lib, though /usr/libexec might be acceptable.

Re-enabled verbose mode for debugging.

Added -debug option to force launching of Xnest instead of the
configured X server.

FYI, this version fixes the messed up startup size, at least for me.
----------------------------------------------------------------------

===================================================================
RCS file: /cvs/e/e17/apps/entrance/src/daemon/Entranced.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- Entranced.h 1 Aug 2006 04:38:19 -0000       1.16
+++ Entranced.h 13 Mar 2007 23:19:39 -0000      1.17
@@ -20,10 +20,10 @@
 #define ENTRANCED_DEBUG 1
 
 #define DEFAULT_X_SERVER X_BINARIES "/X -quiet -nolisten tcp" ENTRANCE_VT_ARG
-//#define X_SERVER "/usr/X11R6/bin/Xnest -full"
+#define DEBUG_X_SERVER X_BINARIES "/Xnest"
 #define X_DISP ":0"             /* only used if DISPLAY variable is NOT set */
-#define ENTRANCE PACKAGE_LIB_DIR "/" PACKAGE "/entrance_wrapper"
-#define PIDFILE "/var/run/entranced.pid"
+#define ENTRANCE PACKAGE_BIN_DIR "/entrance_wrapper"
+#define PIDFILE PACKAGE_STATE_DIR "/entranced.pid"
 
 /* display->status possible values */
 #define NOT_RUNNING 0
===================================================================
RCS file: /cvs/e/e17/apps/entrance/src/daemon/Makefile.am,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- Makefile.am 13 Aug 2006 04:18:28 -0000      1.24
+++ Makefile.am 13 Mar 2007 23:19:39 -0000      1.25
@@ -3,10 +3,8 @@
 
 INCLUDES = @X_CFLAGS@ @ECORE_CFLAGS@
 
-entrancelibdir = $(libdir)/$(PACKAGE)
-
 sbin_PROGRAMS = entranced
-entrancelib_SCRIPTS = entrance_wrapper
+bin_SCRIPTS = entrance_wrapper
 
 entranced_SOURCES = \
        Entranced.h \
===================================================================
RCS file: /cvs/e/e17/apps/entrance/src/daemon/spawner.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- spawner.c   26 Oct 2006 08:05:56 -0000      1.36
+++ spawner.c   13 Mar 2007 23:19:39 -0000      1.37
@@ -41,20 +41,15 @@
    /* This should probably in a separate usage function, but bleh */
    printf("Entranced - Launcher for the Entrance Display Manager\n");
    printf("Usage: %s [OPTION] ...\n\n", name);
-   printf
-      
("--------------------------------------------------------------------------\n");
+   
printf("--------------------------------------------------------------------------\n");
    printf("  -c CONFIG          Specify config file for greeter\n");
    printf("  -d DISPLAY         Connect to an existing X server\n");
    printf("  -help              Display this help message\n");
-   /* printf(" -verbose Display extra debugging info\n"); */
-   printf
-      ("  -nodaemon          Don't fork to background (useful for init 
scripts)\n");
-   printf
-      
("==========================================================================\n\n");
-   printf
-      ("Note: if you're launching Entrance from within an existing X session, 
don't\n");
-   printf
-      ("try to use entranced or you may get unexpected results. Instead, 
launch\n");
+   printf("  -verbose           Display extra debugging info\n");
+   printf("  -nodaemon          Don't fork to background (useful for init 
scripts)\n");
+   
printf("==========================================================================\n\n");
+   printf("Note: if you're launching Entrance from within an existing X 
session, don't\n");
+   printf("try to use entranced or you may get unexpected results. Instead, 
launch\n");
    printf("entrance directly by typing \"entrance\".\n\n");
    exit(0);
 }
@@ -77,6 +72,7 @@
       {"help", 0, 0, 'h'},
       {"disable-xauth", 0, 0, 'a'},
       {"verbose", 0, 0, 'v'},
+      {"debug", 0, 0, 'D'},
       {0, 0, 0, 0}
    };
    pid_t entranced_pid = getpid();
@@ -99,7 +95,7 @@
    /* Parse command-line options */
    while (1)
    {
-      c = getopt_long_only(argc, argv, "c:d:nhv", d_opt, NULL);
+      c = getopt_long_only(argc, argv, "c:d:nhvD", d_opt, NULL);
       if (c == -1)
          break;
       switch (c)
@@ -118,8 +114,14 @@
            break;
         case 'h':
            usage(argv[0]);
-           /* case 'v': config.debuglevel = 1; */
-
+           break;
+        case 'v':
+           entranced_debug_flag = 1;
+           entranced_debug("Verbose output active.\n");
+           break;
+        case 'D':
+           d->xprog = DEBUG_X_SERVER;
+           break;
       }
    }
 
@@ -135,7 +137,6 @@
 
    entranced_debug("entranced: main: display number is %d\n", d->dispnum);
 
-
    entranced_pid = getpid();
    if (nodaemon)
    {
@@ -143,7 +144,9 @@
       {
          syslog(LOG_CRIT, "%d is the pid, but I couldn't write to %s.",
                 entranced_pid, PIDFILE);
-         exit(1);
+         if (! entranced_debug_flag) {
+             exit(1);
+         }
       }
    }
    else
@@ -154,14 +157,17 @@
    /* Check to make sure entrance binary is executable */
    if (access(ENTRANCE, X_OK))
    {
-      syslog(LOG_CRIT,
-             "Fatal Error: Unable to launch entrance binary. Aborting.");
-      exit(1);
+       entranced_debug("Execute permission denied for " ENTRANCE " binary.\n");
+       syslog(LOG_CRIT, "Fatal Error:  Unable to launch entrance binary.");
+       exit(1);
    }
 
    /* Init IPC */
-   if (!entranced_ipc_init(getpid()))
-      exit(1);
+   if (!entranced_ipc_init(getpid())) {
+       entranced_debug("Unable to initialize IPC.  Aborting.\n");
+       syslog(LOG_CRIT, "Fatal Error:  Unable to initialize IPC.");
+       exit(1);
+   }
 
    /* Daemonize */
    if (!nodaemon)
@@ -175,16 +181,11 @@
    }
 
    /* Event filter */
-   _e_filter =
-      ecore_event_filter_add(_filter_cb_start, _filter_cb_loop,
-                             _filter_cb_end, NULL);
+   _e_filter = ecore_event_filter_add(_filter_cb_start, _filter_cb_loop, 
_filter_cb_end, NULL);
 
    /* Set up event handlers */
-   _e_handler =
-      ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _event_cb_exited, d);
-   _d_handler =
-      ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _event_cb_signal_exit,
-                              NULL);
+   _e_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _event_cb_exited, 
d);
+   _d_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, 
_event_cb_signal_exit, NULL);
 /*    _sigusr1_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER, 
_sigaction_cb_sigusr, NULL); */
 
    /* Manually add signal handler for SIGUSR1 */
@@ -201,8 +202,7 @@
    {
       free(d);
       syslog(LOG_CRIT, "Could not start X server.");
-      fprintf(stderr,
-              "Entrance could not start the X server. Please check your 
config.\n");
+      fprintf(stderr, "Entrance could not start the X server. Please check 
your config.\n");
       exit(1);
    }
 
===================================================================
RCS file: /cvs/e/e17/apps/entrance/src/daemon/util.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- util.c      26 Oct 2006 08:05:56 -0000      1.3
+++ util.c      13 Mar 2007 23:19:39 -0000      1.4
@@ -3,12 +3,14 @@
 
 /* extern Entranced_Config config; */
 
+int entranced_debug_flag = 0;
+
 void
 entranced_debug(char *fmt, ...)
 {
 /*   if (config.debuglevel > 0) */
-#ifdef DEBUG
-   if (ENTRANCED_DEBUG)
+#ifdef ENTRANCED_DEBUG
+   if (entranced_debug_flag)
    {
       va_list args;
 
===================================================================
RCS file: /cvs/e/e17/apps/entrance/src/daemon/util.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- util.h      22 Mar 2004 15:03:58 -0000      1.1
+++ util.h      13 Mar 2007 23:19:39 -0000      1.2
@@ -2,6 +2,7 @@
 #define __ENTRANCED_UTIL_H
 
 void entranced_debug (char *fmt, ...);
+extern int entranced_debug_flag;
 
 #endif
 



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to