LINUX command to launch new stdiscosrv

I’ve upgraded from discosrv (0.13.x) to the new 0.14 stdiscosrv on my VPS (Ubuntu 14.04 - 32 bit). I have already configured port, certificate, key, and permissions.

Being a Windows-centric person, I am struggling with a simple LINUX command to launch stdiscosrv using putty, and keeping the server running when I close putty.

Here’s the command I am using:

sudo stdiscosrv -listen=":8443" -cert /usr/local/bin/stdiscosrvkeys/cert.pem -key /usr/local/bin/stdiscosrvkeys/key.pem & disown

In the putty console, stdiscosrv launches but the server ID fails to be broadcast, and then my other devices fail to connect to discovery. If I launch without “& disown”, I get the ID broadcast, all devices are discovered, but I stop the server when I close putty.

Any suggestions how I can exit putty after the ID is broadcast and keep the discovery server running?

Thanks.

The best bet is to start it as a service, using whatever system your distro provides for creating services. That way it will be restarted if your system restarts, etc.

Thanks @canton7.

I once created an Upstart Script (stop, start, exec) on the VPS, and I’ll see if I can find the .conf file on the VPS and use it as a template to create a new service for the discovery server. It’s worth a shot …

Is it reasonable to assume that the “exec” line in the script would look like this?

exec /usr/local/bin/stdiscosrv -listen=":8443" -cert /usr/local/bin/stdiscosrvkeys/cert.pem -key /usr/local/bin/stdiscosrvkeys/key.pem

For those who might find it helpful, this worked:

(1) sudo nano/etc/init/stdiscosrv.conf and I created the script:

description “stdiscosrv discovery service”

start on startup

stop on shutdown

respawn

script

exec /usr/local/bin/stdiscosrv -listen=":8443" -cert /usr/local/bin/stdiscosrvkeys/cert.pem -key /usr/local/bin/stdiscosrvkeys/key.pem

end script

(2) Save and close the file

(3) sudo initctl start stdiscosrv - will start the service, and it should auto restart when you reboot the VPN.

There are probably more elegant scripts, feel free to jump in if you have suggestions.

While for sure a good move for the future, I just want to add for other readers that the code is the same at this point and you don’t have to upgrade 0.13 disco servers for 0.14 clients.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.