[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r6794 - in GNUnet: . src/util/os
From: |
gnunet |
Subject: |
[GNUnet-SVN] r6794 - in GNUnet: . src/util/os |
Date: |
Sat, 10 May 2008 17:30:47 -0600 (MDT) |
Author: grothoff
Date: 2008-05-10 17:30:44 -0600 (Sat, 10 May 2008)
New Revision: 6794
Modified:
GNUnet/AUTHORS
GNUnet/src/util/os/osconfig.c
Log:
1335
Modified: GNUnet/AUTHORS
===================================================================
--- GNUnet/AUTHORS 2008-05-10 12:00:31 UTC (rev 6793)
+++ GNUnet/AUTHORS 2008-05-10 23:30:44 UTC (rev 6794)
@@ -22,6 +22,7 @@
Igor Wronsky <address@hidden>
Ioana Patrascu <address@hidden>
<address@hidden>
+Jake Dust <address@hidden>
James Blackwell <address@hidden>
Jean-Luc Cooke <address@hidden> [ SHA-512]
Jussi Eloranta <address@hidden>
Modified: GNUnet/src/util/os/osconfig.c
===================================================================
--- GNUnet/src/util/os/osconfig.c 2008-05-10 12:00:31 UTC (rev 6793)
+++ GNUnet/src/util/os/osconfig.c 2008-05-10 23:30:44 UTC (rev 6794)
@@ -24,6 +24,7 @@
* @brief functions to read or change the OS configuration
* @author Nils Durner
* @author Heikki Lindholm
+ * @author Jake Dust
*/
#include "platform.h"
@@ -144,6 +145,12 @@
if (ACCESS ("/etc/init.d/", W_OK) == 0)
return GNUNET_YES;
}
+ /* Gentoo */
+ else if (ACCESS ("/sbin/rc-update", X_OK) == 0)
+ {
+ if (ACCESS ("/etc/init.d/", W_OK) == 0)
+ return GNUNET_YES;
+ }
return GNUNET_NO;
#else
#ifdef WINDOWS
@@ -303,11 +310,14 @@
/* Unix */
if ((ACCESS ("/usr/sbin/update-rc.d", X_OK) != 0))
{
- GNUNET_GE_LOG_STRERROR_FILE (ectx,
- GNUNET_GE_ERROR | GNUNET_GE_USER |
- GNUNET_GE_ADMIN | GNUNET_GE_IMMEDIATE,
- "access", "/usr/sbin/update-rc.d");
- return GNUNET_SYSERR;
+ if ((ACCESS ("/sbin/rc-update", X_OK) != 0))
+ {
+ GNUNET_GE_LOG_STRERROR_FILE (ectx,
+ GNUNET_GE_ERROR | GNUNET_GE_USER |
+ GNUNET_GE_ADMIN | GNUNET_GE_IMMEDIATE,
+ "access", "/usr/sbin/update-rc.d");
+ return GNUNET_SYSERR;
+ }
}
/* Debian */
@@ -382,29 +392,59 @@
if (STAT ("/etc/init.d/gnunetd", &buf) != -1)
{
errno = 0;
- ret = system ("/usr/sbin/update-rc.d gnunetd defaults");
- if (ret != 0)
+ if (ACCESS ("/usr/sbin/update-rc.d", W_OK) == 0)
{
- if (errno != 0)
+ ret = system ("/usr/sbin/update-rc.d gnunetd defaults");
+ if (ret != 0)
{
- GNUNET_GE_LOG_STRERROR_FILE (ectx,
- GNUNET_GE_WARNING |
- GNUNET_GE_USER |
- GNUNET_GE_ADMIN |
- GNUNET_GE_IMMEDIATE, "system",
- "/usr/sbin/update-rc.d");
+ if (errno != 0)
+ {
+ GNUNET_GE_LOG_STRERROR_FILE (ectx,
+ GNUNET_GE_WARNING |
+ GNUNET_GE_USER |
+ GNUNET_GE_ADMIN |
+ GNUNET_GE_IMMEDIATE,
"system",
+ "/usr/sbin/update-rc.d");
+ }
+ else
+ {
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_WARNING | GNUNET_GE_USER |
+ GNUNET_GE_ADMIN | GNUNET_GE_IMMEDIATE,
+ _
+ ("Command `%s' failed with error code
%u\n"),
+ "/usr/sbin/update-rc.d gnunetd defaults",
+ WEXITSTATUS (ret));
+ }
+ return GNUNET_SYSERR;
}
- else
+ }
+ else if (ACCESS ("/sbin/rc-update", W_OK) == 0)
+ {
+ ret = system ("/sbin/rc-update add gnunetd default");
+ if (ret != 0)
{
- GNUNET_GE_LOG (ectx,
- GNUNET_GE_WARNING | GNUNET_GE_USER |
- GNUNET_GE_ADMIN | GNUNET_GE_IMMEDIATE,
- _
- ("Command `%s' failed with error code %u\n"),
- "/usr/sbin/update-rc.d gnunetd defaults",
- WEXITSTATUS (ret));
+ if (errno != 0)
+ {
+ GNUNET_GE_LOG_STRERROR_FILE (ectx,
+ GNUNET_GE_WARNING |
+ GNUNET_GE_USER |
+ GNUNET_GE_ADMIN |
+ GNUNET_GE_IMMEDIATE,
"system",
+ "/sbin/rc-update");
+ }
+ else
+ {
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_WARNING | GNUNET_GE_USER |
+ GNUNET_GE_ADMIN | GNUNET_GE_IMMEDIATE,
+ _
+ ("Command `%s' failed with error code
%u\n"),
+ "/sbin/rc-update add gnunetd default",
+ WEXITSTATUS (ret));
+ }
+ return GNUNET_SYSERR;
}
- return GNUNET_SYSERR;
}
}
return GNUNET_YES;
@@ -420,13 +460,27 @@
return GNUNET_SYSERR;
}
errno = 0;
- if (-1 != system ("/usr/sbin/update-rc.d gnunetd remove"))
+ if (ACCESS ("/usr/sbin/update-rc.d", W_OK) == 0)
{
- GNUNET_GE_LOG_STRERROR_FILE (ectx,
- GNUNET_GE_WARNING | GNUNET_GE_USER |
- GNUNET_GE_ADMIN | GNUNET_GE_IMMEDIATE,
- "system", "/usr/sbin/update-rc.d");
- return GNUNET_SYSERR;
+ if (-1 != system ("/usr/sbin/update-rc.d gnunetd remove"))
+ {
+ GNUNET_GE_LOG_STRERROR_FILE (ectx,
+ GNUNET_GE_WARNING | GNUNET_GE_USER |
+ GNUNET_GE_ADMIN |
GNUNET_GE_IMMEDIATE,
+ "system", "/usr/sbin/update-rc.d");
+ return GNUNET_SYSERR;
+ }
+ }
+ else if (ACCESS ("/sbin/rc-update", W_OK) == 0)
+ {
+ if (-1 != system ("/sbin/rc-update del gnunetd"))
+ {
+ GNUNET_GE_LOG_STRERROR_FILE (ectx,
+ GNUNET_GE_WARNING | GNUNET_GE_USER |
+ GNUNET_GE_ADMIN |
GNUNET_GE_IMMEDIATE,
+ "system", "/sbin/rc-update");
+ return GNUNET_SYSERR;
+ }
}
return GNUNET_YES;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r6794 - in GNUnet: . src/util/os,
gnunet <=