Module Import alias Import alias Import alias Import alias identifier ImportFrom alias Import alias Import alias Import alias Import alias ImportFrom alias identifier ImportFrom alias alias alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Assign NameStore Num Assign NameStore Num Assign NameStore Num FunctionDef arguments args NameParam defaults body TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad body Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr If CompareNotEq NameLoad Num body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Assign NameStore BinOpMod Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Raise Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad body Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr If CompareNotEq NameLoad Num body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Assign NameStore BinOpMod Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Raise Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Assign NameStore ListComp NameLoad comprehension NameStore AttributeLoad NameLoad attr Call NameLoad NameLoad AttributeLoad NameLoad attr For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad NameLoad body Expr Str If BoolOpAnd CompareIs NameLoad NameLoad CompareIs NameLoad NameLoad body Return If CompareNotEq Call AttributeLoad NameLoad attr Num body Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Raise Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr ListLoad handlers ExceptHandler type NameLoad body Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Raise Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad TryExcept body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body TryExcept body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Return NameLoad handlers ExceptHandler type NameLoad body Return decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Return NameLoad Assign NameStore BinOpMod Str NameLoad TryExcept body With Call NameLoad NameLoad Str NameStore body Assign NameStore Call AttributeLoad NameLoad attr Return BoolOpAnd CompareIn AttributeLoad NameLoad attr NameLoad BoolOpOr UnaryOpNot AttributeLoad NameLoad attr CompareIn AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad Str NameLoad NameLoad NameLoad NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr IfExp CompareIsNot NameLoad NameLoad Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr If CompareGt NameLoad Num body Expr Call AttributeLoad NameLoad attr Num handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Expr Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr For NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr With Call NameLoad AttributeLoad NameLoad attr Str NameStore body Assign NameStore IfExp CompareIs AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore IfExp CompareIs AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore IfExp CompareIs AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str If BoolOpAnd CompareIsNot AttributeLoad NameLoad attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Call NameLoad Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Expr Call NameLoad Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A atexit N/A fcntl N/A grp N/A logging std_logging logging handlers N/A os N/A pwd N/A signal N/A sys oslo_log log logging neutron._i18n _ _LE _LI neutron.common exceptions N/A LOG N/A N/A logging getLogger __name__ N/A DEVNULL N/A object N/A STDIN_FILENO 0 N/A STDOUT_FILENO 1 N/A STDERR_FILENO 2 setuid N/A N/A user_id_or_name N/A N/A N/A N/A N/A new_uid N/A int user_id_or_name N/A N/A N/A N/A TypeError ValueError N/A N/A new_uid N/A N/A N/A pwd getpwnam user_id_or_name pw_uid N/A N/A new_uid 0 N/A N/A N/A N/A N/A N/A os setuid new_uid N/A N/A N/A OSError N/A N/A msg N/A N/A _ Failed to set uid %s new_uid N/A N/A N/A LOG critical msg N/A N/A N/A exceptions FailToDropPrivilegesExit msg N/A setgid N/A N/A group_id_or_name N/A N/A N/A N/A N/A new_gid N/A int group_id_or_name N/A N/A N/A N/A TypeError ValueError N/A N/A new_gid N/A N/A N/A grp getgrnam group_id_or_name gr_gid N/A N/A new_gid 0 N/A N/A N/A N/A N/A N/A os setgid new_gid N/A N/A N/A OSError N/A N/A msg N/A N/A _ Failed to set gid %s new_gid N/A N/A N/A LOG critical msg N/A N/A N/A exceptions FailToDropPrivilegesExit msg N/A unwatch_log N/A N/A N/A N/A N/A Replace WatchedFileHandler handlers by FileHandler ones.

    Neutron logging uses WatchedFileHandler handlers but they do not
    support privileges drop, this method replaces them by FileHandler
    handlers supporting privileges drop.
     N/A log_root N/A N/A N/A logging getLogger None logger N/A to_replace N/A h N/A h N/A log_root handlers N/A isinstance h N/A handlers WatchedFileHandler N/A handler to_replace N/A N/A new_handler N/A N/A std_logging FileHandler N/A handler baseFilename mode N/A handler mode encoding N/A handler encoding N/A N/A N/A log_root removeHandler handler N/A N/A N/A log_root addHandler new_handler N/A drop_privileges N/A N/A user group N/A None None N/A N/A Drop privileges to user/group privileges. N/A N/A N/A user None N/A group None N/A N/A N/A N/A N/A N/A os geteuid 0 N/A N/A msg N/A _ Root permissions are required to drop privileges. N/A N/A N/A LOG critical msg N/A N/A N/A exceptions FailToDropPrivilegesExit msg N/A N/A group None N/A N/A N/A N/A N/A N/A os setgroups N/A N/A N/A N/A OSError N/A N/A msg N/A _ Failed to remove supplemental groups N/A N/A N/A LOG critical msg N/A N/A N/A exceptions FailToDropPrivilegesExit msg N/A N/A setgid group N/A N/A user None N/A N/A N/A setuid user N/A N/A N/A LOG info N/A _LI Process runs with uid/gid: %(uid)s/%(gid)s N/A uid gid N/A N/A os getuid N/A N/A os getgid N/A Pidfile N/A object N/A __init__ N/A N/A self pidfile procname uuid N/A None N/A N/A N/A self pidfile pidfile N/A N/A self procname procname N/A N/A self uuid uuid N/A N/A N/A N/A self fd N/A N/A os open pidfile N/A N/A os O_CREAT N/A os O_RDWR N/A N/A N/A fcntl flock N/A self fd N/A N/A fcntl LOCK_EX N/A fcntl LOCK_NB N/A N/A N/A IOError N/A N/A N/A N/A LOG exception N/A _LE Error while handling pidfile: %s pidfile N/A N/A N/A sys exit 1 N/A __str__ N/A N/A self N/A N/A N/A N/A self pidfile N/A unlock N/A N/A self N/A N/A N/A N/A N/A fcntl flock N/A self fd N/A fcntl LOCK_UN N/A write N/A N/A self pid N/A N/A N/A N/A N/A os ftruncate N/A self fd 0 N/A N/A N/A os write N/A self fd N/A %d pid N/A N/A N/A os fsync N/A self fd N/A read N/A N/A self N/A N/A N/A N/A N/A pid N/A int N/A N/A os read N/A self fd 128 N/A N/A N/A os lseek N/A self fd 0 N/A os SEEK_SET N/A pid N/A N/A N/A ValueError N/A N/A N/A is_running N/A N/A self N/A N/A N/A pid N/A N/A self read N/A N/A pid N/A N/A False N/A cmdline N/A /proc/%s/cmdline pid N/A N/A N/A N/A open cmdline r f N/A N/A exec_out N/A N/A f readline N/A N/A N/A N/A self procname exec_out N/A N/A N/A self uuid N/A N/A self uuid exec_out N/A N/A N/A IOError N/A N/A False N/A N/A Daemon N/A object N/A N/A A generic daemon class.

    Usage: subclass the Daemon class and override the run() method
     __init__ N/A N/A self pidfile stdin stdout stderr procname uuid user group watch_log N/A DEVNULL DEVNULL DEVNULL python None None None True N/A N/A Note: pidfile may be None. N/A N/A self stdin stdin N/A N/A self stdout stdout N/A N/A self stderr stderr N/A N/A self procname procname N/A N/A self pidfile N/A N/A pidfile None N/A Pidfile pidfile procname uuid None N/A N/A self user user N/A N/A self group group N/A N/A self watch_log watch_log N/A _fork N/A N/A self N/A N/A N/A N/A N/A pid N/A N/A os fork N/A N/A pid 0 N/A N/A N/A N/A os _exit 0 N/A N/A N/A OSError N/A N/A N/A N/A LOG exception N/A _LE Fork failed N/A N/A N/A sys exit 1 N/A daemonize N/A N/A self N/A N/A N/A Daemonize process by doing Stevens double fork. N/A N/A N/A self stdout DEVNULL N/A N/A N/A N/A N/A self stdout flush N/A N/A N/A self stderr DEVNULL N/A N/A N/A N/A N/A self stderr flush N/A f N/A N/A sys stdout N/A sys stderr N/A N/A N/A N/A f flush N/A N/A N/A self _fork N/A N/A N/A os chdir / N/A N/A N/A os setsid N/A N/A N/A os umask 0 N/A N/A N/A self _fork N/A N/A open N/A os devnull w+ devnull N/A N/A stdin N/A N/A N/A self stdin DEVNULL devnull N/A self stdin N/A stdout N/A N/A N/A self stdout DEVNULL devnull N/A self stdout N/A stderr N/A N/A N/A self stderr DEVNULL devnull N/A self stderr N/A N/A N/A os dup2 N/A N/A stdin fileno STDIN_FILENO N/A N/A N/A os dup2 N/A N/A stdout fileno STDOUT_FILENO N/A N/A N/A os dup2 N/A N/A stderr fileno STDERR_FILENO N/A N/A N/A self pidfile None N/A N/A N/A N/A atexit register N/A self delete_pid N/A N/A N/A signal signal N/A signal SIGTERM N/A self handle_sigterm N/A N/A N/A N/A self pidfile write N/A N/A os getpid N/A delete_pid N/A N/A self N/A N/A N/A N/A N/A self pidfile None N/A N/A N/A N/A os remove N/A str N/A self pidfile N/A handle_sigterm N/A N/A self signum frame N/A N/A N/A N/A N/A sys exit 0 N/A start N/A N/A self N/A N/A N/A Start the daemon. N/A N/A N/A N/A self pidfile None N/A N/A N/A self pidfile is_running N/A N/A N/A N/A N/A self pidfile unlock N/A N/A N/A LOG error N/A _LE Pidfile %s already exist. Daemon already running? N/A self pidfile N/A N/A N/A sys exit 1 N/A N/A N/A self daemonize N/A N/A N/A self run N/A run N/A N/A self N/A N/A N/A Override this method and call super().run when subclassing Daemon.

        start() will call this method after the process has daemonized.
         N/A N/A N/A self watch_log N/A N/A N/A unwatch_log N/A N/A drop_privileges N/A self user N/A self group N/A N/A