AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

How to automate the launch and restart of the ChatScript server?
 
 

I share this micro howto to specify part of the procedure presented in CLIENTS-AND-SERVER / ChatScript-Amazon-Server.pdf p.3.
You might be able to tell me if it’s okay before I share it more?


To automate the launch and restart of the ChatScript server :

It is necessary to install a script and make it executable in cron.

List cron rules

Crontab -

Edit the cron config file

Crontab -


Example of cronjob that runs every 5 minutes

* / * * * * /my/path/to/ChatScript/mycronjob 

Give correct rights to the file moncronjob

Sudo a x myconjob 

Example of conjob to test the server and restart it if necessary.

#! / Bin / sh
Echo "Ckeck ChatScript process"
If pidof LinuxChatScript64Then
Echo "ChatScript turn"
Else
 /
my/path/to/ChatScript/BINARIES/LinuxChatScript64
Echo "ChatScript not turn, process launch ..."
Fi 

Wait 5 minutes and check if the server is running

Ps -

Lists current processes (also allows to see the PID number of the process in order to stop it by a kill -9 “PID”)

 

 
  [ # 1 ]

In the LINUX folder there is a sample cron file to keep CS alive. You do not have to check if there is a running instance, you can just try to launch CS and if it is already running on that port your startup will exit immediately

 

 
  [ # 2 ]

OK, I have to update the substitution issues in my brain.
I just forgot that NON-WINDOWS NON-C also meant Linux red face

 

 
  login or register to react