Page 1 of 1

Programmatically restart server?

PostPosted: Fri Mar 26, 2021 11:55 am
by rhanson
Looking for a way to programmatically restart the indigo server. Not the mac, but just the equivalent of doing a server shutdown and restart, but unattended.

When my network goes into WAN failover, all the existing network connections are severed. Most plugins get hung up on this. Even the reflector client gets snagged until it restarts itself. Some are able to gracefully re-connect, others endlessly complain about not being able to connect to things (even LAN hosts). Command line shows that everything is indeed accessible.

The most reliable solution is just to shut down the server process and restart it (via the indigo gui), which cleans everything out and reloads all plugins. How do we accomplish this via indigo script/api or macOS command line functions?

I tried just sending a sigterm, waiting a bit for it to gracefully shutdown (which is does nicely) and reload? But it complains that it can't find the client. What's the full command line to reload it so that it behaves like the client initiated it?

Re: Programmatically restart server?

PostPosted: Fri Mar 26, 2021 12:18 pm
by FlyingDiver
Code: Select all
jkeenan@Kraken ~ % ls -l /usr/local/indigo
total 72
-rwxrwx---  1 root  admin  4534 Dec 22 18:02 indigo-clean-and-zip-plugin
-rwxrwx---  1 root  admin  5511 Dec 22 18:02 indigo-host
-rwxrwx---  1 root  admin  6269 Dec 22 18:02 indigo-restart-plugin
-rwxrwx---  1 root  admin  2484 Dec 22 18:02 indigo-start
-rwxrwx---  1 root  admin  5195 Dec 22 18:02 indigo-stop


I suspect a shell script that runs /usr/local/indigo/stop then /usr/local/indigo/start will work, but I haven't tested it.

Re: Programmatically restart server?

PostPosted: Sat Mar 27, 2021 1:02 pm
by matt (support)
FlyingDiver wrote:
I suspect a shell script that runs /usr/local/indigo/stop then /usr/local/indigo/start will work, but I haven't tested it.

Yep, that should work.

Re: Programmatically restart server?

PostPosted: Sat May 27, 2023 4:57 pm
by ryanbuckner
I just stumbled upon this old thread before creating a feature request for a "Restart Server" menu item.

Here's what mine looks like. Although it works from the command line, nothing happens when I execute it from an Action Group.

restart.png
restart.png (27.86 KiB) Viewed 964 times


UPDATE: Further reading this thread looks like this may not be possible

Re: Programmatically restart server?

PostPosted: Tue May 30, 2023 2:44 pm
by glt
One option is to have a crontab entry check for a touch file. Action Group creates the touch file & external script removes it before performing the deactivation & activation.