Skip to content

create_pid errors are not logged #610

@italovalcy

Description

@italovalcy

If you try to start Kytos and there is a PIDFILE left behind from previous execution, Kytosd will failed and print the following error to stderr:

Web update - Web UI was not updated
2026-03-19 14:17:09,269 - INFO [kytos.core.db] (MainThread) Starting DB connection
2026-03-19 14:17:09,272 - INFO [kytos.core.db] (MainThread) Trying to run 'hello' command on MongoDB...
2026-03-19 14:17:09,377 - INFO [kytos.core.db] (MainThread) Ran 'hello' command on MongoDB successfully. It's ready!
2026-03-19 14:17:09,379 - INFO [kytos.core.controller] (MainThread) //var/run/kytos
PID file //var/run/kytos/kytosd.pid exists. Delete it if Kytos is not running. Aborting.
Shutting down Kytos...
Terminated

Although this seems reasonable for many cases, when running Kytosd from tmux or in background, this may become very complicated to troubleshoot.

Please add this error message into self.log.error additionally to sys.exit

sys.exit(error_msg.format(self.options.pidfile))

and

sys.exit(error_msg.format(self.options.pidfile, exception))

Metadata

Metadata

Assignees

No one assigned

    Labels

    2026.1Kytos-ng 2026.1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions