Skip to content

Not able to run as non-root. /var/log/openbaton Permission Denied! #5

@mathiasbrito

Description

@mathiasbrito

The error

When running a VNFM implemented with the SDK, the following error occurs if you run as a regular user:

Traceback (most recent call last):
File "/vagrant/openiotfog-vnfm/oif_vnfm/main.py", line 41, in
main()
File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/vagrant/openiotfog-vnfm/oif_vnfm/main.py", line 37, in main
start_vnfm_instances(OIFVNFManager, config_file, 5)
File "/usr/local/lib/python3.5/dist-packages/openbaton/vnfm.py", line 673, in start_vnfm_instances
l = VnfmListener(vnfm_klass, config_file_path, kwargs)
File "/usr/local/lib/python3.5/dist-packages/openbaton/vnfm.py", line 83, in init
os.makedirs(logging_dir)
File "/usr/lib/python3.5/os.py", line 241, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/var/log/openbaton/'

Process finished with exit code 1

Workaraound

If we create the following directory and give the user permissions to write, the error is gone.

Expected behaviour

If the user have no permission to setup the log in /var/log, the log should be created locally, in the users Home and a warning log message shown to let him know that the log is not in the default location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions