Commit 7ba5d23f authored by Swann Perarnau's avatar Swann Perarnau

Argo Containers V1

Judicael's code, unchanged, extracted from the master branch of pre-ECP
NodeOS repository.

This is not a filter-branch, just a cp -r. We are not losing anything
important in the git history, as it was only 3 commits long, without any
details on the history of the code.
parents
# Object files
*.o
*.ko
*.obj
*.elf
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
1- Back-to-back invocation of argo_nodeos_config for container manipulation
could fail. This is due to the cgroup filesystem (sysfs in general) taking
some time to do its processing. It is recommended to use sync or put some
sleep between the invocations.
2- While altering a container, argo_nodeos_config is not particularly forgiving
of "mindless" user inputs. Here are a few examples:
-If one tries to add to a container a resource that it already has, the
operation will fail (with an explicit error message). The same happens for a
resource being removed. This should be changed to exhibit an idempotent
behavior instead (with respect to the particular hardware resource being
added or removed).
Basically, if a container has the cpus cores {0,1,4,5}; an "alter_container"
command that tries to add {0,1,8,9} will fail because of the attempt to
"re-add" {0,1}. Ideally, the operation should actually succeed and lead the
container to now possess {0,1,4,5,8,9}.
3- alter_service_os is partially implemented (and is not working yet). Instead,
the user can delete and recreate (in the meantime).
4- json files as input was planned from the beginning; but is not implemented
(didn't see this as a high priority feature).
#DFLAGS= #Debug flags. Meant to be specified outside when invoking make
CFLAGS= -Wall -ggdb -O0
CC=gcc $(DFLAGS)
CXXFLAGS= -Wall -I./jsonxx -ggdb -O0
#CXXFLAGS= -Wall #-I./jsonxx -ggdb -O0
CXX=g++ -std=c++11 $(DFLAGS)
BIN=argo_nodeos_config
C_SOURCES=zounm_utils.c
C_HEADERS=zounm_utils.h
CXX_SOURCES=argo_nodeos_config.cpp config_reader.cpp node_settup_changer.cpp \
node_setup_reader.cpp argo_container.hpp container_manager.cpp \
utils.cpp acl.hpp ilogger.cpp stderrlogger.cpp fileflogger.cpp \
syslogger.cpp aggregatelogger.cpp log_option_parser.cpp \
resource_locker.cpp trace.cpp \
iresource_controller.cpp\
iresource_controller_status.cpp\
string_parser.cpp\
int_list_parser.cpp\
nodeos_exceptions.cpp\
jsonxx.cc
CXX_HEADERS=config_reader.hpp node_setup_changer.hpp node_setup_reader.hpp \
argo_container.hpp container_manager.hpp utils.hpp acl.cpp \
common.hpp defaults.hpp ilogger.hpp stderrlogger.hpp filelogger.hpp \
syslogger.hpp aggregatelogger.hpp headers.hpp log_option_parser.hpp \
trace.hpp resource_locker.hpp \
iresource_controller.hpp\
iresource_controller.hpp\
resource_controller_type.hpp\
string_parser.hpp\
int_list_parser.hpp\
nodeos_exceptions.hpp\
resource_ownership.hpp\
jsonxx.h
OBJECTS=argo_nodeos_config.o config_reader.o node_settup_changer.o node_setup_reader.o \
argo_container.o utils.o container_manager.o acl.o ilogger.o stderrlogger.o\
syslogger.o filelogger.o aggregatelogger.o log_option_parser.o \
resource_locker.o trace.o \
iresource_controller.cpp\
iresource_controller_status.cpp\
string_parser.o\
int_list_parser.o\
nodeos_exceptions.o\
jsonxx.o
%.o: %.c %.h
$(CC) $(CFLAGS) -c $<
%.o: %.cpp %.cc $(CXX_HEADERS)
$(CXX) $(CXXFLAGS) -c $<
#depend:
# makedepend -- $(CXXFLAGS) -- $(CXX_SOURCES)
$(BIN): $(OBJECTS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJECTS)
chmod u+s $(BIN)
clean:
rm -f *.o $(BIN)
# DO NOT DELETE
argo_nodeos_config.o: headers.hpp acl.hpp utils.hpp /usr/include/sys/types.h
argo_nodeos_config.o: /usr/include/features.h /usr/include/stdc-predef.h
argo_nodeos_config.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
argo_nodeos_config.o: /usr/include/gnu/stubs.h /usr/include/bits/types.h
argo_nodeos_config.o: /usr/include/bits/typesizes.h /usr/include/time.h
argo_nodeos_config.o: /usr/include/endian.h /usr/include/bits/endian.h
argo_nodeos_config.o: /usr/include/bits/byteswap.h
argo_nodeos_config.o: /usr/include/bits/byteswap-16.h
argo_nodeos_config.o: /usr/include/sys/select.h /usr/include/bits/select.h
argo_nodeos_config.o: /usr/include/bits/sigset.h /usr/include/bits/time.h
argo_nodeos_config.o: /usr/include/sys/sysmacros.h
argo_nodeos_config.o: /usr/include/bits/pthreadtypes.h /usr/include/unistd.h
argo_nodeos_config.o: /usr/include/bits/posix_opt.h
argo_nodeos_config.o: /usr/include/bits/environments.h
argo_nodeos_config.o: /usr/include/bits/confname.h /usr/include/getopt.h
argo_nodeos_config.o: /usr/include/fcntl.h /usr/include/bits/fcntl.h
argo_nodeos_config.o: /usr/include/bits/fcntl-linux.h
argo_nodeos_config.o: /usr/include/bits/stat.h /usr/include/stdint.h
argo_nodeos_config.o: /usr/include/bits/wchar.h /usr/include/errno.h
argo_nodeos_config.o: /usr/include/bits/errno.h /usr/include/linux/errno.h
argo_nodeos_config.o: /usr/include/asm/errno.h
argo_nodeos_config.o: /usr/include/asm-generic/errno.h
argo_nodeos_config.o: /usr/include/asm-generic/errno-base.h
argo_nodeos_config.o: /usr/include/string.h /usr/include/xlocale.h
argo_nodeos_config.o: /usr/include/pthread.h /usr/include/sched.h
argo_nodeos_config.o: /usr/include/bits/sched.h /usr/include/bits/setjmp.h
argo_nodeos_config.o: common.hpp /usr/include/sys/stat.h defaults.hpp
argo_nodeos_config.o: /usr/include/syslog.h /usr/include/sys/syslog.h
argo_nodeos_config.o: /usr/include/bits/syslog-path.h nodeos_exceptions.hpp
argo_nodeos_config.o: argo_container.hpp resource_type.hpp string_parser.hpp
argo_nodeos_config.o: container_manager.hpp resource_ownership.hpp
argo_nodeos_config.o: ilogger.hpp resource_ownership_set.hpp syslogger.hpp
argo_nodeos_config.o: stderrlogger.hpp filelogger.hpp aggregatelogger.hpp
argo_nodeos_config.o: log_option_parser.hpp resource_locker.hpp
argo_nodeos_config.o: /usr/include/stdio.h /usr/include/libio.h
argo_nodeos_config.o: /usr/include/_G_config.h /usr/include/wchar.h
argo_nodeos_config.o: /usr/include/bits/stdio_lim.h
argo_nodeos_config.o: /usr/include/bits/sys_errlist.h
argo_container.o: utils.hpp /usr/include/sys/types.h /usr/include/features.h
argo_container.o: /usr/include/stdc-predef.h /usr/include/sys/cdefs.h
argo_container.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
argo_container.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
argo_container.o: /usr/include/time.h /usr/include/endian.h
argo_container.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
argo_container.o: /usr/include/bits/byteswap-16.h /usr/include/sys/select.h
argo_container.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
argo_container.o: /usr/include/bits/time.h /usr/include/sys/sysmacros.h
argo_container.o: /usr/include/bits/pthreadtypes.h /usr/include/unistd.h
argo_container.o: /usr/include/bits/posix_opt.h
argo_container.o: /usr/include/bits/environments.h
argo_container.o: /usr/include/bits/confname.h /usr/include/getopt.h
argo_container.o: /usr/include/fcntl.h /usr/include/bits/fcntl.h
argo_container.o: /usr/include/bits/fcntl-linux.h /usr/include/bits/stat.h
argo_container.o: /usr/include/stdint.h /usr/include/bits/wchar.h
argo_container.o: /usr/include/errno.h /usr/include/bits/errno.h
argo_container.o: /usr/include/linux/errno.h /usr/include/asm/errno.h
argo_container.o: /usr/include/asm-generic/errno.h
argo_container.o: /usr/include/asm-generic/errno-base.h /usr/include/string.h
argo_container.o: /usr/include/xlocale.h /usr/include/pthread.h
argo_container.o: /usr/include/sched.h /usr/include/bits/sched.h
argo_container.o: /usr/include/bits/setjmp.h common.hpp
argo_container.o: /usr/include/sys/stat.h defaults.hpp /usr/include/syslog.h
argo_container.o: /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h
argo_container.o: nodeos_exceptions.hpp resource_type.hpp string_parser.hpp
container_manager.o: container_manager.hpp utils.hpp /usr/include/sys/types.h
container_manager.o: /usr/include/features.h /usr/include/stdc-predef.h
container_manager.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
container_manager.o: /usr/include/gnu/stubs.h /usr/include/bits/types.h
container_manager.o: /usr/include/bits/typesizes.h /usr/include/time.h
container_manager.o: /usr/include/endian.h /usr/include/bits/endian.h
container_manager.o: /usr/include/bits/byteswap.h
container_manager.o: /usr/include/bits/byteswap-16.h
container_manager.o: /usr/include/sys/select.h /usr/include/bits/select.h
container_manager.o: /usr/include/bits/sigset.h /usr/include/bits/time.h
container_manager.o: /usr/include/sys/sysmacros.h
container_manager.o: /usr/include/bits/pthreadtypes.h /usr/include/unistd.h
container_manager.o: /usr/include/bits/posix_opt.h
container_manager.o: /usr/include/bits/environments.h
container_manager.o: /usr/include/bits/confname.h /usr/include/getopt.h
container_manager.o: /usr/include/fcntl.h /usr/include/bits/fcntl.h
container_manager.o: /usr/include/bits/fcntl-linux.h /usr/include/bits/stat.h
container_manager.o: /usr/include/stdint.h /usr/include/bits/wchar.h
container_manager.o: /usr/include/errno.h /usr/include/bits/errno.h
container_manager.o: /usr/include/linux/errno.h /usr/include/asm/errno.h
container_manager.o: /usr/include/asm-generic/errno.h
container_manager.o: /usr/include/asm-generic/errno-base.h
container_manager.o: /usr/include/string.h /usr/include/xlocale.h
container_manager.o: /usr/include/pthread.h /usr/include/sched.h
container_manager.o: /usr/include/bits/sched.h /usr/include/bits/setjmp.h
container_manager.o: common.hpp /usr/include/sys/stat.h defaults.hpp
container_manager.o: /usr/include/syslog.h /usr/include/sys/syslog.h
container_manager.o: /usr/include/bits/syslog-path.h nodeos_exceptions.hpp
container_manager.o: argo_container.hpp resource_type.hpp string_parser.hpp
container_manager.o: resource_ownership.hpp ilogger.hpp
container_manager.o: resource_ownership_set.hpp /usr/include/sys/mount.h
container_manager.o: /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h
container_manager.o: /usr/include/asm/ioctls.h
container_manager.o: /usr/include/asm-generic/ioctls.h
container_manager.o: /usr/include/linux/ioctl.h /usr/include/asm/ioctl.h
container_manager.o: /usr/include/asm-generic/ioctl.h
container_manager.o: /usr/include/bits/ioctl-types.h
container_manager.o: /usr/include/sys/ttydefaults.h /usr/include/ftw.h
container_manager.o: /usr/include/libgen.h int_list_parser.hpp
container_manager.o: /usr/include/signal.h /usr/include/bits/signum.h
container_manager.o: /usr/include/bits/siginfo.h
container_manager.o: /usr/include/bits/sigaction.h
container_manager.o: /usr/include/bits/sigcontext.h
container_manager.o: /usr/include/bits/sigstack.h /usr/include/sys/ucontext.h
container_manager.o: /usr/include/bits/sigthread.h
utils.o: utils.hpp /usr/include/sys/types.h /usr/include/features.h
utils.o: /usr/include/stdc-predef.h /usr/include/sys/cdefs.h
utils.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
utils.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
utils.o: /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h
utils.o: /usr/include/bits/byteswap.h /usr/include/bits/byteswap-16.h
utils.o: /usr/include/sys/select.h /usr/include/bits/select.h
utils.o: /usr/include/bits/sigset.h /usr/include/bits/time.h
utils.o: /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h
utils.o: /usr/include/unistd.h /usr/include/bits/posix_opt.h
utils.o: /usr/include/bits/environments.h /usr/include/bits/confname.h
utils.o: /usr/include/getopt.h /usr/include/fcntl.h /usr/include/bits/fcntl.h
utils.o: /usr/include/bits/fcntl-linux.h /usr/include/bits/stat.h
utils.o: /usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/errno.h
utils.o: /usr/include/bits/errno.h /usr/include/linux/errno.h
utils.o: /usr/include/asm/errno.h /usr/include/asm-generic/errno.h
utils.o: /usr/include/asm-generic/errno-base.h /usr/include/string.h
utils.o: /usr/include/xlocale.h /usr/include/pthread.h /usr/include/sched.h
utils.o: /usr/include/bits/sched.h /usr/include/bits/setjmp.h common.hpp
utils.o: /usr/include/sys/stat.h defaults.hpp /usr/include/syslog.h
utils.o: /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h
utils.o: nodeos_exceptions.hpp /usr/include/ctype.h /usr/include/limits.h
utils.o: /usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h
utils.o: /usr/include/linux/limits.h /usr/include/bits/posix2_lim.h
utils.o: /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
utils.o: /usr/include/wchar.h /usr/include/bits/stdio_lim.h
utils.o: /usr/include/bits/sys_errlist.h ilogger.hpp syslogger.hpp
utils.o: filelogger.hpp stderrlogger.hpp aggregatelogger.hpp
acl.o: utils.hpp /usr/include/sys/types.h /usr/include/features.h
acl.o: /usr/include/stdc-predef.h /usr/include/sys/cdefs.h
acl.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
acl.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
acl.o: /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h
acl.o: /usr/include/bits/byteswap.h /usr/include/bits/byteswap-16.h
acl.o: /usr/include/sys/select.h /usr/include/bits/select.h
acl.o: /usr/include/bits/sigset.h /usr/include/bits/time.h
acl.o: /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h
acl.o: /usr/include/unistd.h /usr/include/bits/posix_opt.h
acl.o: /usr/include/bits/environments.h /usr/include/bits/confname.h
acl.o: /usr/include/getopt.h /usr/include/fcntl.h /usr/include/bits/fcntl.h
acl.o: /usr/include/bits/fcntl-linux.h /usr/include/bits/stat.h
acl.o: /usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/errno.h
acl.o: /usr/include/bits/errno.h /usr/include/linux/errno.h
acl.o: /usr/include/asm/errno.h /usr/include/asm-generic/errno.h
acl.o: /usr/include/asm-generic/errno-base.h /usr/include/string.h
acl.o: /usr/include/xlocale.h /usr/include/pthread.h /usr/include/sched.h
acl.o: /usr/include/bits/sched.h /usr/include/bits/setjmp.h common.hpp
acl.o: /usr/include/sys/stat.h defaults.hpp /usr/include/syslog.h
acl.o: /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h
acl.o: nodeos_exceptions.hpp
ilogger.o: ilogger.hpp common.hpp /usr/include/sys/types.h
ilogger.o: /usr/include/features.h /usr/include/stdc-predef.h
ilogger.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
ilogger.o: /usr/include/gnu/stubs.h /usr/include/bits/types.h
ilogger.o: /usr/include/bits/typesizes.h /usr/include/time.h
ilogger.o: /usr/include/endian.h /usr/include/bits/endian.h
ilogger.o: /usr/include/bits/byteswap.h /usr/include/bits/byteswap-16.h
ilogger.o: /usr/include/sys/select.h /usr/include/bits/select.h
ilogger.o: /usr/include/bits/sigset.h /usr/include/bits/time.h
ilogger.o: /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h
ilogger.o: /usr/include/sys/stat.h /usr/include/bits/stat.h defaults.hpp
ilogger.o: /usr/include/string.h /usr/include/xlocale.h /usr/include/errno.h
ilogger.o: /usr/include/bits/errno.h /usr/include/linux/errno.h
ilogger.o: /usr/include/asm/errno.h /usr/include/asm-generic/errno.h
ilogger.o: /usr/include/asm-generic/errno-base.h /usr/include/syslog.h
ilogger.o: /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h
ilogger.o: /usr/include/stdint.h /usr/include/bits/wchar.h utils.hpp
ilogger.o: /usr/include/unistd.h /usr/include/bits/posix_opt.h
ilogger.o: /usr/include/bits/environments.h /usr/include/bits/confname.h
ilogger.o: /usr/include/getopt.h /usr/include/fcntl.h
ilogger.o: /usr/include/bits/fcntl.h /usr/include/bits/fcntl-linux.h
ilogger.o: /usr/include/pthread.h /usr/include/sched.h
ilogger.o: /usr/include/bits/sched.h /usr/include/bits/setjmp.h
ilogger.o: nodeos_exceptions.hpp /usr/include/stdio.h /usr/include/libio.h
ilogger.o: /usr/include/_G_config.h /usr/include/wchar.h
ilogger.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
ilogger.o: /usr/include/stdlib.h /usr/include/bits/waitflags.h
ilogger.o: /usr/include/bits/waitstatus.h /usr/include/alloca.h
ilogger.o: /usr/include/bits/stdlib-float.h
stderrlogger.o: stderrlogger.hpp ilogger.hpp common.hpp
stderrlogger.o: /usr/include/sys/types.h /usr/include/features.h
stderrlogger.o: /usr/include/stdc-predef.h /usr/include/sys/cdefs.h
stderrlogger.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
stderrlogger.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
stderrlogger.o: /usr/include/time.h /usr/include/endian.h
stderrlogger.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
stderrlogger.o: /usr/include/bits/byteswap-16.h /usr/include/sys/select.h
stderrlogger.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
stderrlogger.o: /usr/include/bits/time.h /usr/include/sys/sysmacros.h
stderrlogger.o: /usr/include/bits/pthreadtypes.h /usr/include/sys/stat.h
stderrlogger.o: /usr/include/bits/stat.h defaults.hpp /usr/include/string.h
stderrlogger.o: /usr/include/xlocale.h /usr/include/errno.h
stderrlogger.o: /usr/include/bits/errno.h /usr/include/linux/errno.h
stderrlogger.o: /usr/include/asm/errno.h /usr/include/asm-generic/errno.h
stderrlogger.o: /usr/include/asm-generic/errno-base.h /usr/include/syslog.h
stderrlogger.o: /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h
stderrlogger.o: /usr/include/stdint.h /usr/include/bits/wchar.h trace.hpp
stderrlogger.o: /usr/include/stdio.h /usr/include/libio.h
stderrlogger.o: /usr/include/_G_config.h /usr/include/wchar.h
stderrlogger.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
stderrlogger.o: utils.hpp /usr/include/unistd.h /usr/include/bits/posix_opt.h
stderrlogger.o: /usr/include/bits/environments.h /usr/include/bits/confname.h
stderrlogger.o: /usr/include/getopt.h /usr/include/fcntl.h
stderrlogger.o: /usr/include/bits/fcntl.h /usr/include/bits/fcntl-linux.h
stderrlogger.o: /usr/include/pthread.h /usr/include/sched.h
stderrlogger.o: /usr/include/bits/sched.h /usr/include/bits/setjmp.h
stderrlogger.o: nodeos_exceptions.hpp
syslogger.o: syslogger.hpp ilogger.hpp common.hpp /usr/include/sys/types.h
syslogger.o: /usr/include/features.h /usr/include/stdc-predef.h
syslogger.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
syslogger.o: /usr/include/gnu/stubs.h /usr/include/bits/types.h
syslogger.o: /usr/include/bits/typesizes.h /usr/include/time.h
syslogger.o: /usr/include/endian.h /usr/include/bits/endian.h
syslogger.o: /usr/include/bits/byteswap.h /usr/include/bits/byteswap-16.h
syslogger.o: /usr/include/sys/select.h /usr/include/bits/select.h
syslogger.o: /usr/include/bits/sigset.h /usr/include/bits/time.h
syslogger.o: /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h
syslogger.o: /usr/include/sys/stat.h /usr/include/bits/stat.h defaults.hpp
syslogger.o: /usr/include/string.h /usr/include/xlocale.h
syslogger.o: /usr/include/errno.h /usr/include/bits/errno.h
syslogger.o: /usr/include/linux/errno.h /usr/include/asm/errno.h
syslogger.o: /usr/include/asm-generic/errno.h
syslogger.o: /usr/include/asm-generic/errno-base.h /usr/include/syslog.h
syslogger.o: /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h
syslogger.o: /usr/include/stdint.h /usr/include/bits/wchar.h utils.hpp
syslogger.o: /usr/include/unistd.h /usr/include/bits/posix_opt.h
syslogger.o: /usr/include/bits/environments.h /usr/include/bits/confname.h
syslogger.o: /usr/include/getopt.h /usr/include/fcntl.h
syslogger.o: /usr/include/bits/fcntl.h /usr/include/bits/fcntl-linux.h
syslogger.o: /usr/include/pthread.h /usr/include/sched.h
syslogger.o: /usr/include/bits/sched.h /usr/include/bits/setjmp.h
syslogger.o: nodeos_exceptions.hpp trace.hpp /usr/include/stdio.h
syslogger.o: /usr/include/libio.h /usr/include/_G_config.h
syslogger.o: /usr/include/wchar.h /usr/include/bits/stdio_lim.h
syslogger.o: /usr/include/bits/sys_errlist.h
aggregatelogger.o: aggregatelogger.hpp ilogger.hpp common.hpp
aggregatelogger.o: /usr/include/sys/types.h /usr/include/features.h
aggregatelogger.o: /usr/include/stdc-predef.h /usr/include/sys/cdefs.h
aggregatelogger.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
aggregatelogger.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
aggregatelogger.o: /usr/include/time.h /usr/include/endian.h
aggregatelogger.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
aggregatelogger.o: /usr/include/bits/byteswap-16.h /usr/include/sys/select.h
aggregatelogger.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
aggregatelogger.o: /usr/include/bits/time.h /usr/include/sys/sysmacros.h
aggregatelogger.o: /usr/include/bits/pthreadtypes.h /usr/include/sys/stat.h
aggregatelogger.o: /usr/include/bits/stat.h defaults.hpp
aggregatelogger.o: /usr/include/string.h /usr/include/xlocale.h
aggregatelogger.o: /usr/include/errno.h /usr/include/bits/errno.h
aggregatelogger.o: /usr/include/linux/errno.h /usr/include/asm/errno.h
aggregatelogger.o: /usr/include/asm-generic/errno.h
aggregatelogger.o: /usr/include/asm-generic/errno-base.h
aggregatelogger.o: /usr/include/syslog.h /usr/include/sys/syslog.h
aggregatelogger.o: /usr/include/bits/syslog-path.h /usr/include/stdint.h
aggregatelogger.o: /usr/include/bits/wchar.h syslogger.hpp stderrlogger.hpp
aggregatelogger.o: filelogger.hpp
log_option_parser.o: log_option_parser.hpp common.hpp
log_option_parser.o: /usr/include/sys/types.h /usr/include/features.h
log_option_parser.o: /usr/include/stdc-predef.h /usr/include/sys/cdefs.h
log_option_parser.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
log_option_parser.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
log_option_parser.o: /usr/include/time.h /usr/include/endian.h
log_option_parser.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
log_option_parser.o: /usr/include/bits/byteswap-16.h
log_option_parser.o: /usr/include/sys/select.h /usr/include/bits/select.h
log_option_parser.o: /usr/include/bits/sigset.h /usr/include/bits/time.h
log_option_parser.o: /usr/include/sys/sysmacros.h
log_option_parser.o: /usr/include/bits/pthreadtypes.h /usr/include/sys/stat.h
log_option_parser.o: /usr/include/bits/stat.h defaults.hpp
log_option_parser.o: /usr/include/string.h /usr/include/xlocale.h
log_option_parser.o: /usr/include/errno.h /usr/include/bits/errno.h
log_option_parser.o: /usr/include/linux/errno.h /usr/include/asm/errno.h
log_option_parser.o: /usr/include/asm-generic/errno.h
log_option_parser.o: /usr/include/asm-generic/errno-base.h
log_option_parser.o: /usr/include/syslog.h /usr/include/sys/syslog.h
log_option_parser.o: /usr/include/bits/syslog-path.h /usr/include/stdint.h
log_option_parser.o: /usr/include/bits/wchar.h utils.hpp
log_option_parser.o: /usr/include/unistd.h /usr/include/bits/posix_opt.h
log_option_parser.o: /usr/include/bits/environments.h
log_option_parser.o: /usr/include/bits/confname.h /usr/include/getopt.h
log_option_parser.o: /usr/include/fcntl.h /usr/include/bits/fcntl.h
log_option_parser.o: /usr/include/bits/fcntl-linux.h /usr/include/pthread.h
log_option_parser.o: /usr/include/sched.h /usr/include/bits/sched.h
log_option_parser.o: /usr/include/bits/setjmp.h nodeos_exceptions.hpp
resource_locker.o: resource_locker.hpp /usr/include/stdio.h
resource_locker.o: /usr/include/features.h /usr/include/stdc-predef.h
resource_locker.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
resource_locker.o: /usr/include/gnu/stubs.h /usr/include/bits/types.h
resource_locker.o: /usr/include/bits/typesizes.h /usr/include/libio.h
resource_locker.o: /usr/include/_G_config.h /usr/include/wchar.h
resource_locker.o: /usr/include/bits/stdio_lim.h
resource_locker.o: /usr/include/bits/sys_errlist.h utils.hpp
resource_locker.o: /usr/include/sys/types.h /usr/include/time.h
resource_locker.o: /usr/include/endian.h /usr/include/bits/endian.h
resource_locker.o: /usr/include/bits/byteswap.h
resource_locker.o: /usr/include/bits/byteswap-16.h /usr/include/sys/select.h
resource_locker.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
resource_locker.o: /usr/include/bits/time.h /usr/include/sys/sysmacros.h
resource_locker.o: /usr/include/bits/pthreadtypes.h /usr/include/unistd.h
resource_locker.o: /usr/include/bits/posix_opt.h
resource_locker.o: /usr/include/bits/environments.h
resource_locker.o: /usr/include/bits/confname.h /usr/include/getopt.h
resource_locker.o: /usr/include/fcntl.h /usr/include/bits/fcntl.h
resource_locker.o: /usr/include/bits/fcntl-linux.h /usr/include/bits/stat.h
resource_locker.o: /usr/include/stdint.h /usr/include/bits/wchar.h
resource_locker.o: /usr/include/errno.h /usr/include/bits/errno.h
resource_locker.o: /usr/include/linux/errno.h /usr/include/asm/errno.h
resource_locker.o: /usr/include/asm-generic/errno.h
resource_locker.o: /usr/include/asm-generic/errno-base.h
resource_locker.o: /usr/include/string.h /usr/include/xlocale.h
resource_locker.o: /usr/include/pthread.h /usr/include/sched.h
resource_locker.o: /usr/include/bits/sched.h /usr/include/bits/setjmp.h
resource_locker.o: common.hpp /usr/include/sys/stat.h defaults.hpp
resource_locker.o: /usr/include/syslog.h /usr/include/sys/syslog.h
resource_locker.o: /usr/include/bits/syslog-path.h nodeos_exceptions.hpp
resource_locker.o: ilogger.hpp /usr/include/sys/file.h trace.hpp
trace.o: trace.hpp /usr/include/stdio.h /usr/include/features.h
trace.o: /usr/include/stdc-predef.h /usr/include/sys/cdefs.h
trace.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
trace.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
trace.o: /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h
trace.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
string_parser.o: string_parser.hpp utils.hpp /usr/include/sys/types.h
string_parser.o: /usr/include/features.h /usr/include/stdc-predef.h
string_parser.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
string_parser.o: /usr/include/gnu/stubs.h /usr/include/bits/types.h
string_parser.o: /usr/include/bits/typesizes.h /usr/include/time.h
string_parser.o: /usr/include/endian.h /usr/include/bits/endian.h
string_parser.o: /usr/include/bits/byteswap.h /usr/include/bits/byteswap-16.h
string_parser.o: /usr/include/sys/select.h /usr/include/bits/select.h
string_parser.o: /usr/include/bits/sigset.h /usr/include/bits/time.h
string_parser.o: /usr/include/sys/sysmacros.h
string_parser.o: /usr/include/bits/pthreadtypes.h /usr/include/unistd.h
string_parser.o: /usr/include/bits/posix_opt.h
string_parser.o: /usr/include/bits/environments.h
string_parser.o: /usr/include/bits/confname.h /usr/include/getopt.h
string_parser.o: /usr/include/fcntl.h /usr/include/bits/fcntl.h
string_parser.o: /usr/include/bits/fcntl-linux.h /usr/include/bits/stat.h
string_parser.o: /usr/include/stdint.h /usr/include/bits/wchar.h
string_parser.o: /usr/include/errno.h /usr/include/bits/errno.h
string_parser.o: /usr/include/linux/errno.h /usr/include/asm/errno.h
string_parser.o: /usr/include/asm-generic/errno.h
string_parser.o: /usr/include/asm-generic/errno-base.h /usr/include/string.h
string_parser.o: /usr/include/xlocale.h /usr/include/pthread.h
string_parser.o: /usr/include/sched.h /usr/include/bits/sched.h
string_parser.o: /usr/include/bits/setjmp.h common.hpp
string_parser.o: /usr/include/sys/stat.h defaults.hpp /usr/include/syslog.h
string_parser.o: /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h
string_parser.o: nodeos_exceptions.hpp int_list_parser.hpp
int_list_parser.o: int_list_parser.hpp utils.hpp /usr/include/sys/types.h
int_list_parser.o: /usr/include/features.h /usr/include/stdc-predef.h
int_list_parser.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
int_list_parser.o: /usr/include/gnu/stubs.h /usr/include/bits/types.h
int_list_parser.o: /usr/include/bits/typesizes.h /usr/include/time.h
int_list_parser.o: /usr/include/endian.h /usr/include/bits/endian.h
int_list_parser.o: /usr/include/bits/byteswap.h
int_list_parser.o: /usr/include/bits/byteswap-16.h /usr/include/sys/select.h
int_list_parser.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
int_list_parser.o: /usr/include/bits/time.h /usr/include/sys/sysmacros.h
int_list_parser.o: /usr/include/bits/pthreadtypes.h /usr/include/unistd.h
int_list_parser.o: /usr/include/bits/posix_opt.h
int_list_parser.o: /usr/include/bits/environments.h
int_list_parser.o: /usr/include/bits/confname.h /usr/include/getopt.h
int_list_parser.o: /usr/include/fcntl.h /usr/include/bits/fcntl.h
int_list_parser.o: /usr/include/bits/fcntl-linux.h /usr/include/bits/stat.h
int_list_parser.o: /usr/include/stdint.h /usr/include/bits/wchar.h
int_list_parser.o: /usr/include/errno.h /usr/include/bits/errno.h
int_list_parser.o: /usr/include/linux/errno.h /usr/include/asm/errno.h
int_list_parser.o: /usr/include/asm-generic/errno.h
int_list_parser.o: /usr/include/asm-generic/errno-base.h
int_list_parser.o: /usr/include/string.h /usr/include/xlocale.h
int_list_parser.o: /usr/include/pthread.h /usr/include/sched.h
int_list_parser.o: /usr/include/bits/sched.h /usr/include/bits/setjmp.h
int_list_parser.o: common.hpp /usr/include/sys/stat.h defaults.hpp
int_list_parser.o: /usr/include/syslog.h /usr/include/sys/syslog.h
int_list_parser.o: /usr/include/bits/syslog-path.h nodeos_exceptions.hpp
jsonxx.o: jsonxx.h /usr/include/stdio.h /usr/include/features.h
jsonxx.o: /usr/include/stdc-predef.h /usr/include/sys/cdefs.h
jsonxx.o: /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h
jsonxx.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
jsonxx.o: /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h
jsonxx.o: /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
A-Daemon mode (--daemon, needs a client)
-Beacause the startup might be a bit heavy; the deamon mode is recommended
when the config is expected to keep changing. The daemon is expected to run
on the serviceOS
B- Each new supported resource controller leads to the implementation of two
interfaces:
-IResource_controller: A container aggregates some of this
-IResource_controller_state: the container manager aggregates these and
keeps acocunting and all
1-)Build with make
Be root while building (or make sure that the final binary is owned by root)
2-)Execute ./argo_nodeos_config --help="misc help_sections"; read the message and
start aving fun. The full help can be displayed by simply executing
./argo_nodeos_config --help
-Update process hosting in cgroups with cpuset.procs instead of tasks
-Update so the argo_reserved_mems knob could be manipulated from user-space
-Add support for mask-based mem_exclusive instead of the current ALL or NOTHING situation
create_container
delete_container
alter_container
attach //attach a process or a set of processes
detach //detach a process or a set of processes
#include "acl.hpp"
#include "utils.hpp"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <cstdlib>
Acl::Acl(string config_file, uid_t uid):
_config_file(config_file)
{
if(uid == INVALID_UID)
_uid = ruid;
else
_uid = uid;
check_config_file();
_syslog_disable_info = DEFAULT_ACL_CONTROL;
_syslog_disable_warning = DEFAULT_ACL_CONTROL;
_syslog_disable_warning = DEFAULT_ACL_CONTROL;
_syslog_enable_debug = DEFAULT_ACL_CONTROL;
}
Acl::~Acl()
{
}
void Acl::check_config_file()
{
struct stat stat_buf;
if(stat(_config_file.c_str(), &stat_buf) == -1)
return;
if(stat_buf.st_uid != 0)
argo_exit(EXIT_FAILURE, "The ACL config file must be owned by root");
if((stat_buf.st_mode&S_IWGRP || stat_buf.st_mode& S_IWOTH))
argo_exit(EXIT_FAILURE,
"The ACL config file must be writable only for root. " +
string(APP_NAME) + " cannot use it! ");
}
bool Acl::is_allowed(Acl_token token)
{
if(_uid == 0)
return true; //always allowed for root
map<Acl_token, bool>::const_iterator it =
_single_value_privileges.find(token);
if(it == _single_value_privileges.end())
return DEFAULT_ACL_CONTROL;
return it->second;
}
#ifndef __ACL_H__
#define __ACL_H__
#include "utils.hpp"
#include "defaults.hpp"
#include <map>
using std::map;
#define INVALID_UID 0xffffffff
#ifndef DEFAULT_ACL_CONTROL
#define DEFAULT_ACL_CONTROL true; //for tests
#endif
enum Acl_token
{
ACL_DUMMY,
ACL_ENABLE_SYSLOG_DEBUG,
ACL_DISABLE_SYSLOG_INFO,
ACL_DISABLE_SYSLOG_WARNING,
ACL_DISABLE_SYSLOG_ERROR,
ACL_REMOVE_PROCESS, //from a container
ACL_ADD_PROCESS, //to a container
};
class Acl
{
private:
string _config_file;
uid_t _uid;
map<Acl_token, bool> _single_value_privileges;
bool _syslog_enable_debug;
bool _syslog_disable_info;
bool _syslog_disable_warning;
bool _syslog_disable_error;
//These below are not meant to be used
Acl(const Acl& orig){}
Acl& operator = (const Acl& orig){ return *this;}
void check_config_file();
public:
/*uid=-1 means the real uid of the process will be used*/
Acl(string config_path=DEFAULT_ACL_CONFIG, uid_t uid=INVALID_UID);
~Acl();
inline uid_t get_uid() const {return _uid;}
bool is_allowed(Acl_token token);
template <typename T>
bool is_allowed_on(Acl_token token, T& args);
};
template <typename T>
bool Acl::is_allowed_on(Acl_token token, T& args)
{
return false;
}
#endif //__ACL_H__
#include "aggregatelogger.hpp"
Aggregatelogger::Aggregatelogger(uid_t ruid):
ILogger(ruid, LOG_DEST_DEV_NULL)
{
}
Aggregatelogger::~Aggregatelogger()
{
}
void Aggregatelogger::log(Log_type type, const string& message, int errnum)
{
for(int i=0; i<(int)_loggers.size(); i++)
_loggers[i]->log(type, message, errnum);
}
void Aggregatelogger::add_logger(ILogger* logger)
{
for(int i=0; i<(int)_loggers.size(); i++)
{
if(_loggers[i]->log_destination() == logger->log_destination())
{
_loggers[i] = logger;
return;
}
}
_log_dest |= logger->log_destination();
_loggers.push_back(logger);
}
#ifndef __AGGREGATELOGGER_HPP__
#define __AGGREGATELOGGER_HPP__
#include "ilogger.hpp"
#include "syslogger.hpp"
#include "stderrlogger.hpp"
#include "filelogger.hpp"
class Aggregatelogger: public ILogger
{
Log_dest _log_dest;
vector<ILogger*> _loggers;
public:
Aggregatelogger(uid_t ruid);
~Aggregatelogger();
virtual void log(Log_type type, const string& message, int errnum = 0);
virtual inline Log_dest log_destination() const {return _log_dest;}
/*A maximum of 1 instance of each type of logger. If a type of logger
* is added that already existed, it is overwritten.