Recent update breaks tigervncserver startup, sort of

Required Information

I am using version 9.5.1 on four separate devices. the devices are vintage (2007-2012) Macs, two Mac minis and two macbooks. I use these mainly for PiHole servers, but I also run other stuff on them. I run them remotely, and use vnc to access their desktops.

I generally update each once per week, using “apt update” and “apt upgrade”

I updated all 4 yesterday, noting that there were an unusual number of debian packages updated…like 40+. I did not add or change anything else. after the updates, three of the units are fine, but the fourth (one of the twin macbooks) fails to start my tigervncserver at boot. not at all sure why one would be different than the others, but that is the case.

here is the output of “journalctl -u vncserver.service”

Jun 30 08:54:49 mbp2012-dietpi systemd[1]: Started vncserver.service - VNC Server (DietPi).

Jun 30 08:54:49 mbp2012-dietpi (ncserver)[1351]: pam_unix(login:session): session opened for user root(uid=0) by (uid=0)

Jun 30 08:54:49 mbp2012-dietpi vncserver[1351]: [ OK ] TigerVNC detected

Jun 30 08:54:49 mbp2012-dietpi vncserver[1351]: [ INFO ] Starting virtual desktop at display :1 in 1280x720x16

Jun 30 08:54:49 mbp2012-dietpi vncserver[1396]: hostname: Name or service not known

Jun 30 08:54:49 mbp2012-dietpi vncserver[1351]: tigervncserver: Could not acquire fully qualified host name of this machine.

Jun 30 08:54:49 mbp2012-dietpi systemd[1]: vncserver.service: Main process exited, code=exited, status=1/FAILURE

Jun 30 08:54:49 mbp2012-dietpi systemd[1]: **vncserver.service: Failed with result ‘exit-code’.

startup appears to be failing because it cannot find/execute “hostname”. again, not a problem on the other three units. also, when I subsequently restart

systemctl restart vncserver

it works fine. something is amiss with the systemd startup which is not allowing or finding the hostname command. the hostname command works fine from the command line. I have uninstalled and reinstalled tigervnc (via dietpi-software) but that did not help. Thinking it might be a timing issue relative to network, I also tried inserting a custom service which forced a wait during startup until the network was proven active via a ping to an outside server. again, did not help. the failure is VERY consistent, through repeated restarts.

I know this is not strictly a dietpi issue, but I was hoping other users here might have seen similar or can suggest a potential fix. I am sure it is something simple…just not obvious to me.

-dvh

Check if hostname is installed at the same location on all of them. I’ve seen it in /bin/ but /usr/bin/ as well.

you can check if the package is installed still

dpkg -l hostname

And try to reinstall if needed

apt install --reinstall hostname

Thanks for the suggestions. as I said in my initial message, the hostname command works fine from the command line, so I think it is installed correctly. that said, I will pursue both of the comments here when I get home later today. it won’t hurt to reinstall in any case.

-dvh

hostname is installed in both /bin and /usr/bin. also something called hostnamectl in /usr/bin. exactly the same for the twin macbooks.

dpkg -l hostname results…

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
++±==============-============-============-================================================
ii hostname 3.23+nmu1 amd64 utility to set/show the host name or domain name

…looks like it is installed.

reinstalled anyway as Joulinar suggested. no change.

-dvh

fixed it!!!

I believe I caused the issue when trying to synchronize the local /etc/hosts file across my 4 machines. I use this file to add readable names to the network hosts on my networks, such that pihole can show me statistics using names instead of IP addresses. I updated /etc/hosts on one machine, then copied the updated parts to the others using cut/paste over multiple ssh sessions. in the case of the failed machine, I must have copied too much, which included the name defined for 127.0.1.1. this resulted in a mismatch between what my machine thought was the hostname (defined in /etc/hostname I think) and this /etc/hosts definition. correcting the hosts file on the failure machine to match hostname…works now!

sorry to bother all on this forum with my own fault…but hoping this might help someone else.

-dvh

This can be done using Pihole own functionality.

1 Like

I may have to look at that again. I don’t recall exactly why I chose the /etc/hosts method, but I know I did it consciously. in any case, thanks for the advice.

-dvh

just following up on the suggestion…using pihole internal to do what I want requires to use pihole as the network DHCP server, which overcomplicates what I need…but I am always grateful for the suggestions and help I find here

-dvh

No, PiHole only needs to be the DNS server only. You can use the ‘Local DNS records’ function. The order of the files/configurations used to resolve the local DNS records is also displayed there.

As you can see, /etc/hosts is not that bad if managed on DNS server side. However, same could be done using PiHole web interface.

1 Like

I am trying the local DNS option on pihole now. to me, the benefit is being able to use the pihole teleporter capability to propagate the configuration across my 4 servers. I stripped the equivalent info from /etc/hosts to accommodate the priority of resolution, forcing pihole to do the work. thank you for pointing me down that road. just started using, so still to be seen whether other complications arise from this, but right now I am hopeful.

-dvh

How many PiHole instances you have running? :see_no_evil:

four instances.

are they all in one location?

no. spread over three locations. location 1 (my primary with all critical systems) has 2 piholes, which in operation are selected, one or the other, by the network hosts. locations 2 and 3 have one each. but my locations are interconnected with wireguard tunnel, and locations 2 and 3 use location one servers for their redundancy.

My routers at each location (not the piholes) serve DHCP, and the DNS addresses they provide include local and remote pihole addresses, with the local being the first address server in the provided list. I know that network hosts do not typically limit themselves to the priority order of DNS provided by DHCP, so I see lots of cross-site usage.

-dvh

quite an interesting setup, thx for sharing

no problem at all. very grateful for both dietpi and pihole. the dietpi-software feature makes it easy to get the basic pihole/unbound combo installed and configured. Thank you.