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 -l
Edit the cron config file
Crontab -e
Example of cronjob that runs every 5 minutes
* / 5 * * * * /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 LinuxChatScript64; Then
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 -A
Lists current processes (also allows to see the PID number of the process in order to stop it by a kill -9 “PID”)