[ANSWERED]Stop Indigo Server

Posted on
Mon Feb 16, 2015 11:03 am
Decker offline
Posts: 22
Joined: Jun 13, 2013

[ANSWERED]Stop Indigo Server

Hello,
Is there a simple applescript that can nicely shut down the indigo server app?

I'm trying to have my server restart once a week since it seems to clear up some plugin issues.

I've tried the following script and it enters "Quitting Indigo Server - received quit event" but doesn't actually shut it down.

Code: Select all
tell application "IndigoServer"
   quit
end tell
delay 30
tell application "Finder"
   restart
end tell


I also tried the Indigo ServerStop script found here but it does not seem to nicely shut things down. It abruptly shuts things down and I notice some changes were not saved on a schedule I recently edited in Indigo.

Thanks,

James

Posted on
Mon Feb 16, 2015 6:49 pm
jay (support) offline
Site Admin
User avatar
Posts: 18225
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Stop Indigo Server

Just do Mac restart - it will tell the IndigoServer process to gracefully shut down.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Feb 16, 2015 7:43 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: [ANSWERED]Stop Indigo Server

If it isn't shutting down then you might have a script or plugin that is causing it to hang or not shutdown.

The IndigoServer stop script does have it politely shutdown at first, but if it takes too long then it does a force quit.

Image

Posted on
Tue Mar 03, 2015 4:52 pm
dejees offline
Posts: 13
Joined: Apr 07, 2013
Location: Copley, OH

Re: [ANSWERED]Stop Indigo Server

For what it's worth, I have an applescript that I run daily as a CRON job.

Code: Select all
try
   tell application "Indigo 6"
      quit
   end tell
end try
try
   tell application "IndigoServer"
      quit
   end tell
   delay 300
   run application "Indigo 6"
   delay 120
   tell application "Indigo 6"
      quit
   end tell
end try

Posted on
Wed Mar 04, 2015 8:08 am
jalves offline
Posts: 747
Joined: Jun 16, 2013

Re: [ANSWERED]Stop Indigo Server

dejees wrote:
For what it's worth, I have an applescript that I run daily as a CRON job.

Code: Select all
try
   tell application "Indigo 6"
      quit
   end tell
end try
try
   tell application "IndigoServer"
      quit
   end tell
   delay 300
   run application "Indigo 6"
   delay 120
   tell application "Indigo 6"
      quit
   end tell
end try


I guess I don't understand Applescript (no surprise). Can you tell me in layman's terms what this is doing? I see three things happening, but don't know when/why.

Also, how do you include this as a chron job?

Running Indigo 2023.2 on a 24" iMac M1), OS X 14.4
Jeff

Posted on
Wed Mar 04, 2015 1:01 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: [ANSWERED]Stop Indigo Server

The script tries to politely close Indigo 6 (the client), then the indigo server. Then it waits 5 minutes. Then it starts the Indigo client (which I guess starts the local server as well?). Then it waits 2 minutes. Then it closes the indigo client, but leaves the server running.

Not sure about setting it as cron.

Posted on
Wed Mar 04, 2015 2:26 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: [ANSWERED]Stop Indigo Server

just for my understanding... why
- do you shut down indigo every day.. (any issues that are reset that way ?)
- and then wait 5 minutes before you restart

thx
Karl

Posted on
Sat Mar 14, 2015 10:20 am
dejees offline
Posts: 13
Joined: Apr 07, 2013
Location: Copley, OH

Re: [ANSWERED]Stop Indigo Server

jalves wrote:
dejees wrote:
For what it's worth, I have an applescript that I run daily as a CRON job.

Code: Select all
try
   tell application "Indigo 6"
      quit
   end tell
end try
try
   tell application "IndigoServer"
      quit
   end tell
   delay 300
   run application "Indigo 6"
   delay 120
   tell application "Indigo 6"
      quit
   end tell
end try


I guess I don't understand Applescript (no surprise). Can you tell me in layman's terms what this is doing? I see three things happening, but don't know when/why.

Also, how do you include this as a chron job?


howarth described it perfectly. There are multiple steps being accomplished in the applescript. It runs on the same MAC as the Indigo Server, first it closes the Indigo 6 client, just in case I left it running previously, then it politely tries to quit Indigo 6 Server, then waits 5 minutes just to be sure everything shuts down, then restarts my local client on the Mac, which in turn starts the server if it is not currently running, which should be the case since earlier in the script we shout it all down. Next we wait 2 more minutes, giving more than enough time for everything to start, and close the client portion leaving the Indigo server active.

Since this script lives outside of Indigo and is designed to stop/restart it, I used a CRON job to schedule it to run. You can read about CRON on Mac's at the following article at Maclife
http://www.maclife.com/article/columns/terminal_101_creating_cron_jobs

Posted on
Sat Mar 14, 2015 10:29 am
dejees offline
Posts: 13
Joined: Apr 07, 2013
Location: Copley, OH

Re: [ANSWERED]Stop Indigo Server

kw123 wrote:
just for my understanding... why
- do you shut down indigo every day.. (any issues that are reset that way ?)
- and then wait 5 minutes before you restart

thx
Karl


You can schedule the CRON job any way you want, I do have it execute daily. As for why, I have a variety of plugins running, some not as efficient as others. For example, in my scenario after several days it appears one or more plugins suffer some memory leak issues as available memory continues to decrease over time. Another plugin I use seems to suck a bunch of steady CPU cycles and thus my Mac mini runs hotter than I would prefer. By restarting Indigo server automatically daily, both issues mentioned resolve themselves, cooler mini and resetting of the memory leaks as things free up once Indigo and it's plugins restart. As for the 5 minutes, simply my choice of duration just to be sure everything has more than enough time to gracefully shutdown and exit before beginning the restart process. The plugins with the issues work for me and do their job even with their unique issues, so we are all happy in the long run.

Posted on
Sat Mar 14, 2015 9:23 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: [ANSWERED]Stop Indigo Server

Have tried to just restart all plugins? That's pretty simple And should fix the memory leaks too.


Sent from my iPhone using Tapatalk

Posted on
Sun Mar 15, 2015 2:56 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: [ANSWERED]Stop Indigo Server

kw123 wrote:
Have tried to just restart all plugins? That's pretty simple And should fix the memory leaks too.


Sent from my iPhone using Tapatalk

But can this be done programmatically in order for it to be CRON'd?

Posted on
Sun Mar 15, 2015 7:46 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: [ANSWERED]Stop Indigo Server

Code: Select all
ID = "com.nathansheldon.indigoplugin.NOAAWeatherPlus"
ID = indigo.server.getPlugin(ID)
ID.restart(waitUntilDone=True)


here is how i restart the NOAA plugin
put these line into a scheduled action script

It should work for any plugin, just replace the line ID= "..."

Karl

Posted on
Sun Mar 15, 2015 9:49 am
dejees offline
Posts: 13
Joined: Apr 07, 2013
Location: Copley, OH

Re: [ANSWERED]Stop Indigo Server

kw123 wrote:
Code: Select all
ID = "com.nathansheldon.indigoplugin.NOAAWeatherPlus"
ID = indigo.server.getPlugin(ID)
ID.restart(waitUntilDone=True)


here is how i restart the NOAA plugin
put these line into a scheduled action script

It should work for any plugin, just replace the line ID= "..."

Karl


How do you discover a plugin's ID?

Posted on
Sun Mar 15, 2015 11:32 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

[ANSWERED]Stop Indigo Server

Last edited by kw123 on Sun Mar 15, 2015 11:35 am, edited 1 time in total.

Posted on
Sun Mar 15, 2015 11:35 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: [ANSWERED]Stop Indigo Server

In the indigo directory: preferences/plugins. The names of the files are the strings you should use in ID=....

And use waitUntilDone=False if you just want to restart.


Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 25 guests

cron