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

hddtemp: remove deprecated telnetlib dependency (fixes #2261) #2262

Merged
merged 4 commits into from
Oct 22, 2024

Conversation

valdur55
Copy link
Contributor

No description provided.

Copy link
Contributor

@lasers lasers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need NOT_INSTALLED post_config_hook exception for netcat or is that overkill?

@valdur55
Copy link
Contributor Author

At first I had trouble to get hddtemp answering at telnet interface. Maybe we should add note to enable hddtemp daemon?
Used arch wiki to resolve issue: https://wiki.archlinux.org/title/Hddtemp#Daemon

Copy link
Contributor

@lasers lasers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We can add note. Please and thank you.

@@ -133,9 +135,11 @@ def post_config_hook(self):
self.keys = ["path", "name", "temperature", "unit"]
self.cache_names = {}
self.thresholds_init = self.py3.get_color_names_list(self.format_hdd)
if not self.py3.check_commands("netcat"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to first line under post_config_hook?

I'm looking up differences between netcat, ncat/nc... I think ncat/nc is better... More active development... Honestly, we can add support for both netcat + ncat/nc, but meh... Overkill.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, nc is symblink to netcat. (manjaro/archlinux).
In debian systems they are linked to alternatives.
valdur@x /bin> ls -lah ncat nc netcat lrwxrwxrwx 1 root root 20 juuli 12 2020 nc -> /etc/alternatives/nc* -rwxr-xr-x 1 root root 221K jaan 30 2023 ncat* lrwxrwxrwx 1 root root 24 juuli 12 2020 netcat -> /etc/alternatives/netcat*
valdur@x :/etc/alternatives $ ls -lah nc netcat lrwxrwxrwx 1 root root 20 juuli 12 2020 nc -> /bin/nc.openbsd lrwxrwxrwx 1 root root 20 juuli 12 2020 netcat -> /bin/nc.openbsd
I didn't even know that ncat exists.
For me it looks like netcat/nc is more commonly installed that ncat.

Changed nc to netcat because if you google just nc you wont get far.

Copy link
Contributor

@lasers lasers Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I'm using Fedora i3 Spin VM to sometimes deal with py3status on macOS.

Netcat (classic) is not installed, but nc / ncat (nmap) is...

lasers@fedora:~$ rpm -qf $(which nc)
nmap-ncat-7.92-2.fc40.aarch64

lasers@fedora:~$ rpm -qf $(which ncat)
nmap-ncat-7.92-2.fc40.aarch64

lasers@fedora:~$ rpm -qf $(which netcat)
/usr/bin/which: no netcat in (/home/lasers/.local/bin:/home/lasers/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
rpm: no arguments given for query

I think you had it right the first time.... Most linux distributions probably set up symlinks pointing to nc for most thing... so we could just point it to nc too... and just skip STRING_NOT_FOUND entirely.

I can't test hddtemp too because of VM (Got vda instead of sda).

Copy link
Contributor

@lasers lasers Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, my bad. I still would like to check for nc. Let's just check and use nc and be done with that.

@ultrabug ultrabug merged commit 51e7d8f into ultrabug:master Oct 22, 2024
7 checks passed
@ultrabug
Copy link
Owner

Thanks a lot!

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

Successfully merging this pull request may close these issues.

3 participants