Just learned that you can detect if your Linux server needs a restart, by checking your /var/run directory. My Ubuntu 22.04 server calls the directory as needrestart. I ran sudo shutdown -r 0 and, voilĂ , the directory disappears.