Because I run a lot of VMs, many times behind other gateway VMs and vlans and it's easy to loose track on where can I ssh into a particular VM
First I tried printing from rc.local but the boot console is cleared. You have to remove "quiet" from grub and add
/etc/systemd/system/[email protected]/noclear.conf
[Service]
TTYVTDisallocate=no
But it still won't work because rc.local no longer starts last. So I added ifup-local to change /etc/issue but it won't run like that because of this: http://serverfault.com/questions/631899/centos-7-getting-interface-ip-numbers
In case it goes away:
I found the answer: the information is not available to the "ip" command until the network change (from the "sudo service network restart" or the reboot) is complete. Because the network change causes "/etc/sysconfig/network-scripts/ifup-post" to run before it is finished, which in-turn calls out to "/sbin/ifup-local" to run before it is finished, "ip" called within "/sbin/ifup-local" called automatically can never have that information. To solve this, I renamed the script from "/sbin/ifup-local" to "/sbin/update-issue", and created a new "/sbin/ifup-local" that calls "/sbin/update-issue" asynchronously. Now it works
So I applied the sollution from the serverfault link above, and it works (two other files represent the working solution, not my rant about systemd).