NoPorts Daemon Upgrade
Upgrade the sshnpd binary
Upgrading to the latest version of sshnpd follows the same process as installation, as the installer automatically replaces existing binaries with the new ones.
To upgrade, follow the installation guide up to Step 3, then return to this page to complete the process.
Verify the Upgrade
To check the current version of sshnpd installed on your machine, simply execute the binary:
$HOME/.local/bin/sshnpd
Or, if you installed as root:
/usr/local/bin/sshnpd
The first line of output should contain the version information:
Version : x.x.x
Reload the sshnpd service
After upgrading the sshnpd binary, we must restart the sshnpd service so that it runs using the new version. How you proceed is dependent upon the original installation method you used:
Systemd unit
The universal.sh
installer script will automatically restart the sshnpd.service
unit.
Any existing config will be preserved.
Tmux session
The installer automatically restarts your tmux session, no other steps required!
Headless (cron + nohup)
Retrieve the Process ID
To safely restart the headless service, we must be slightly more careful with the headless installation. First we must grab the process id of sshnpd:
pgrep -f "$(eval echo \"$( cat $HOME/.local/bin/sshnpd.sh | grep /sshnpd | awk '{$1=$1};1')\" )"
You should get a single number as output, this is the process ID of the sshnpd process.
Example:
atsign@sshnpd-test:~# pgrep -f "$(eval echo \"$( cat $HOME/.local/bin/sshnpd.sh | grep /sshnpd | awk '{$1=$1};1')\" )"
289
Verify the Process ID
Before we continue, it is good practice to make sure that we have the correct ID:
ps -fp <process ID>
Example:
atsign@sshnpd-test:~# ps -fp 289
UID PID PPID C STIME TTY TIME CMD
atsign 289 114 0 11:10 ? 00:00:00 /home/atsign/.local/bin/sshnpd -a @atsign_device -m @atsign_client -d mydevice -suv
As you can see, under CMD
we have /home/atsign/.local/bin/sshnpd -a @atsign_device -m @atsign_client -d mydevice -suv
. This is the command inside our sshnpd.sh service which used to start sshnpd. This is the correct process that we want to kill in order to restart sshnpd.
Killing the process
Now that we have retrieved and verified the process ID, we can use the kill command to kill the process:
kill -9 <process ID>
Example:
root@sshnpd-test:~# kill -9 289
Verify the Process has been killed
Use the same verification command from before:
ps -fp <process ID>
Example:
root@sshnpd-test:~# ps -fp 289
UID PID PPID C STIME TTY TIME CMD
As you can see, there are no entries anymore. This means process 289 has been killed, sshnpd should automatically restart under a new process ID.
Last updated