Failed to start with resolvectl error
psyray opened this issue · 4 comments
psyray commented
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 commented
Shouldn't raise an exception in that try/except.
Will investigate.
…On Sat, Jan 6, 2024 at 2:01 PM Psyray ***@***.***> wrote:
According to your latest change 44bfd1d
<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 <https://github.com/ThePorgs/Exegol> is using with
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 ***@***.***)
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
—
Reply to this email directly, view it on GitHub
<#267>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC5Q2D5HVVPN4URIEG2I33YNF7PZAVCNFSM6AAAAABBPVQFOOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA3DQNZSGQZDOMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
psyray commented
The subprocess call should have a specific process to catch error no ?
Maybe this can help (stderr ?)
https://stackoverflow.com/a/35633457
psyray commented
Tested and working
Thanks 😉