Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to start with resolvectl error #267

Closed
psyray opened this issue Jan 6, 2024 · 4 comments
Closed

Failed to start with resolvectl error #267

psyray opened this issue Jan 6, 2024 · 4 comments

Comments

@psyray
Copy link

psyray commented Jan 6, 2024

According to your latest change 44bfd1d

If a system use init.d instead of systemd Responder failed to start.
I think you should check before if resolvectl is installed, and if not, fallback to resolv.conf

For example, Exegol is using init.d instead of systemd

Responder.py --interface "$INTERFACE" -w
                                         __
  .----.-----.-----.-----.-----.-----.--|  |.-----.----.
  |   _|  -__|__ --|  _  |  _  |     |  _  ||  -__|   _|
  |__| |_____|_____|   __|_____|__|__|_____||_____|__|
                   |__|

           NBT-NS, LLMNR & MDNS Responder 3.1.4.0

  To support this project:
  Github -> https://github.com/sponsors/lgandx
  Paypal  -> https://paypal.me/PythonResponder

  Author: Laurent Gaffie (laurent.gaffie@gmail.com)
  To kill this script hit CTRL-C

[+] You don't have an IPv6 address assigned.
Traceback (most recent call last):
  File "/opt/tools/Responder/Responder.py", line 63, in <module>
    settings.Config.populate(options)
  File "/opt/tools/Responder/settings.py", line 338, in populate
    DNS = subprocess.check_output(["resolvectl", "status"])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.7/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.7/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.7/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/root/.pyenv/versions/3.11.7/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'resolvectl'

Commenting the resolvectl line and replacing with resolv.conf works

@lgandx
Copy link
Owner

lgandx commented Jan 6, 2024 via email

@psyray
Copy link
Author

psyray commented Jan 6, 2024

The subprocess call should have a specific process to catch error no ?
Maybe this can help (stderr ?)
https://stackoverflow.com/a/35633457

@lgandx
Copy link
Owner

lgandx commented Jan 6, 2024

Solved in 1a2f2fd

Thanks

@psyray
Copy link
Author

psyray commented Jan 6, 2024

Tested and working
Thanks 😉

@psyray psyray closed this as completed Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants