]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Configure the location of cgrulesengd socket v0.34
authorJan Safranek <jsafrane@redhat.com>
Tue, 30 Jun 2009 12:29:19 +0000 (14:29 +0200)
committerDhaval Giani <dhaval@linux.vnet.ibm.com>
Wed, 1 Jul 2009 15:04:50 +0000 (20:34 +0530)
This patch allows users to configure location of cgrulesengd socket before
compilation:

./configure --enable-cgred-socket=/var/run/cgred.socket

In addition, /var/run/cgred.socket is now default location of the socket - this
sounds LSB compliant to me. Feel free to suggest better one.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
config.h.in
configure.in
include/libcgroup.h

index 12d2fdd48037af2b1e433b19c3ae42511752cea0..f2b42787e998d557a4637ef6ba991eb2c6f96259 100644 (file)
@@ -3,6 +3,9 @@
 /* Define to enable extra debugging output. */
 #undef CGROUP_DEBUG
 
+/* Cgrulesengd socket path */
+#undef CGRULE_CGRED_SOCKET_PATH
+
 /* Define to 1 if your system has a working `chown' function. */
 #undef HAVE_CHOWN
 
index d6b28d39f09aa2b28c1310ac3a7513242c9ea09f..8e2a40a98c19bf7693f7950e71a234e7e85b5eff 100644 (file)
@@ -76,6 +76,20 @@ AC_ARG_ENABLE([daemon],
        [with_daemon=true])
 AM_CONDITIONAL([WITH_DAEMON], [test x$with_daemon = xtrue])
 
+socket_path="/var/run/cgred.socket"
+AC_ARG_ENABLE([cgred-socket],
+       [AC_HELP_STRING([--enable-cgred-socket=PATH],
+               specify location of cgrulesengd communication socket
+               (default=/var/run/cgred.socket))],
+       [
+               if test "x$enableval" = xno -o "x$enableval" = xyes; then
+                       AC_MSG_ERROR([Provide valid path with --enable-cgred-socket option.])
+               else
+                       socket_path="$enableval"
+               fi
+       ], [])
+AC_DEFINE_UNQUOTED([CGRULE_CGRED_SOCKET_PATH],"$socket_path", [Cgrulesengd socket path])
+
 # Checks for programs.
 AC_PROG_CXX
 AC_PROG_CC
index 8a86cb7eed824e39c7561815ca7025cf89a3db86..3d5660c156ac766ba0643d7b31f2c74e09e094cb 100644 (file)
@@ -52,8 +52,6 @@ __BEGIN_DECLS
 #define CGRULE_INVALID (-1)
 #define CGRULE_WILD (-2)
 
-/* FIXME: Change the temporary file to configurable one. */
-#define CGRULE_CGRED_SOCKET_PATH       "/tmp/cgred"
 #define CGRULE_SUCCESS_STORE_PID       "SUCCESS_STORE_PID"
 
 /* Flags for cgroup_change_cgroup_uid_gid() */