Hi I am facing a issue on azure wherein the virtual machine automatically restarts because of maintenance from microsoft.
Because of this my application is going down. Also there is no confirmation as to when the restart/system updates will take place.
Even If I start Thin Server how do I keep it open for a specific port ie for port 3000,3001,3002,3003.or so on..Please let me know.
I have gone through various blogs and have made changes in init.d
to
make the thin server start automatically during restart.
user: root
group: webuser
pid: tmp/pids/thin.pid
timeout:30
wait:30
log: log/thin.log
max_conns:1024
require:[]
environment: production
max_persistent_conns:512
servers:1
threaded:true
no-epoll:true
daemonize:true
socket: tmp/sockets/thin.sock
chdir: webuser/app
tag: hey aux
I have tried the above but failed in it.
The below is my etc/init.d
thin
file:-
# Do NOT "set -e"
DAEMON=/usr/bin/thin
SCRIPT_NAME=/etc/init.d/thin# Exit if the package is not installed[-x "$DAEMON"]|| exit 0
run_action(){
ACTION="$1"if[-x /usr/bin/ruby1.8];then/usr/bin/ruby1.8 $DAEMON $ACTION --all /etc/thin1.8
fiif[-x /usr/bin/ruby1.9.1];then/usr/bin/ruby1.9.1 $DAEMON $ACTION --all /etc/thin1.9.1
fi}case"$1"in
start)
run_action start;;
stop)
run_action stop;;
restart|force-reload|reload)
run_action restart;;*)
echo "Usage: $SCRIPT_NAME {start|stop|restart}">&2
exit 3;;
esac:
I dont know if the script is right or wrong.But the code does not seem to work. Can anyone please help me with this. Thanks a lot in advance