lxc_cgroup.c revision 51cab6315f1500af5105cfbf56cc03b2ceefa0d9
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * lxc: linux Container library
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * (C) Copyright IBM Corp. 2007, 2008
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * Daniel Lezcano <dlezcano at fr.ibm.com>
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * This library is free software; you can redistribute it and/or
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * modify it under the terms of the GNU Lesser General Public
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * License as published by the Free Software Foundation; either
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * version 2.1 of the License, or (at your option) any later version.
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * This library is distributed in the hope that it will be useful,
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * but WITHOUT ANY WARRANTY; without even the implied warranty of
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * Lesser General Public License for more details.
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * You should have received a copy of the GNU Lesser General Public
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * License along with this library; if not, write to the Free Software
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn fprintf(stderr, "%s <subsystem> [value]\n", basename(cmd));
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn fprintf(stderr, "\t -n <name> : name of the container\n");
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn fprintf(stderr, "\t[-o <logfile>] : path of the log file\n");
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn fprintf(stderr, "\t[-l <logpriority>]: log level priority\n");
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn char *name = NULL, *subsystem = NULL, *value = NULL;
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn const char *log_file = NULL, *log_priority = NULL;
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn while ((opt = getopt(argc, argv, "n:o:l:")) != -1) {
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn if (lxc_log_init(log_file, log_priority, basename(argv[0])))
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn ERROR("failed to assign '%s' value to '%s' for '%s'\n",
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn if (lxc_cgroup_get(name, subsystem, buffer, len)) {
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn ERROR("failed to retrieve value of '%s' for '%s'\n",