]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Remove the kill container processes code
authordlezcano <dlezcano>
Mon, 17 Nov 2008 14:15:40 +0000 (14:15 +0000)
committerdlezcano <dlezcano>
Mon, 17 Nov 2008 14:15:40 +0000 (14:15 +0000)
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Remove the kill container processes code because it can be implemented with
a very few scripting lines

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/Makefile.am
src/lxc/kill.c [deleted file]
src/lxc/lxc.h
src/lxc/lxc_kill.c [deleted file]

index c099c250cd481e8b72087e496169a2d706b2016c..62871c5f4de1bf3398b17f54a43788902cbeb2aa 100644 (file)
@@ -18,7 +18,6 @@ liblxc_la_SOURCES = \
        start.c \
        stop.c \
        monitor.c monitor.h \
-       kill.c \
        freezer.c \
        checkpoint.c \
        restart.c \
@@ -54,7 +53,6 @@ bin_PROGRAMS = \
        lxc-monitor \
        lxc-wait \
        lxc-console \
-       lxc-kill \
        lxc-freeze \
        lxc-info \
        lxc-cgroup \
@@ -93,9 +91,6 @@ lxc_console_LDADD = liblxc.la
 lxc_info_SOURCES = lxc_info.c
 lxc_info_LDADD = liblxc.la
 
-lxc_kill_SOURCES = lxc_kill.c
-lxc_kill_LDADD = liblxc.la
-
 lxc_freeze_SOURCES = lxc_freeze.c
 lxc_freeze_LDADD = liblxc.la
 
diff --git a/src/lxc/kill.c b/src/lxc/kill.c
deleted file mode 100644 (file)
index f071dfb..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * lxc: linux Container library
- *
- * (C) Copyright IBM Corp. 2007, 2008
- *
- * Authors:
- * Daniel Lezcano <dlezcano at fr.ibm.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-#define _GNU_SOURCE
-#include <stdio.h>
-#undef _GNU_SOURCE
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <string.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <sys/param.h>
-
-#include <lxc/lxc.h>
-
-int lxc_kill(const char *name, int signum)
-{
-       char freezer[MAXPATHLEN], *signal = NULL;
-       int fd = -1, ret = -1;
-       
-       if (signum < SIGHUP || signum > SIGRTMAX) {
-               lxc_log_error("bad signal value %d", signum);
-               return -1;
-       }
-
-       snprintf(freezer, MAXPATHLEN, LXCPATH "/%s/nsgroup/freezer.kill", name);
-
-       if (!asprintf(&signal, "%d", signum)) {
-               lxc_log_syserror("not enough memory");
-               return -1;
-       }
-
-       fd = open(freezer, O_WRONLY);
-       if (fd < 0) {
-               lxc_log_syserror("failed to open %s for %s", freezer, name);
-               goto out;
-       }
-
-       if (write(fd, &signal, strlen(signal)) < 0) {
-               lxc_log_syserror("failed to write to %s", freezer);
-               goto out;
-       }
-
-       ret = 0;
-out:
-       close(fd);
-       free(signal);
-       return ret;
-}
index 04ccb5ee212bbc7dc2db1498943347ce29eec1cc..843fd45ec7ac87153da5d55077c4118e7ce48851 100644 (file)
@@ -146,16 +146,6 @@ extern int lxc_unfreeze(const char *name);
  */
 extern lxc_state_t lxc_state(const char *name);
 
-/*
- * Send a signal to all processes of the container. This is the same
- * behavior of the well-known 'killpg' command except it is related
- * to all tasks belonging to a container.
- * @name   : the name of the container
- * @signum : the signal number to be sent
- * Returns 0 on success, < 0 otherwise
- */
-extern int lxc_kill(const char *name, int signum);
-
 /*
  * Set a specified value for a specified subsystem. The specified
  * subsystem must be fully specified, eg. "cpu.shares"
diff --git a/src/lxc/lxc_kill.c b/src/lxc/lxc_kill.c
deleted file mode 100644 (file)
index b16b29f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * lxc: linux Container library
- *
- * (C) Copyright IBM Corp. 2007, 2008
- *
- * Authors:
- * Daniel Lezcano <dlezcano at fr.ibm.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#include <lxc/lxc.h>
-
-int main(int argc, char *argv[])
-{
-       return 0;
-}
-