0

I deployed my project on a Shared Hosting that has Root access the Server in picture is CENTOS

now although I have defined the service to start on boot it not getting started

chkconfig --level 35 thin.startup on

chkconfig --list | grep 'thin'
thin.startup    0:off   1:off   2:off   3:on    4:off   5:on    6:off

Here the script look like the script is stored under /etc/init.d/thin.startup

#!/bin/sh
#
#
# network Bring thin server up
#
# chkconfig: 35 20 80
# description: Starts and stops the thin Server and 
#
# 
# See how we were called.

thin -C /home/perwe100/public_html/1001/fedena-v2.3-bundle-linux/config/fedena.yml start

Not sure what is going wrong since I can find anything in boot.log and chkservd.log

am I missing something

Btw I can see the symlink present in /etc/rc3.d/ and /etc/rc5.d/ S20thin.startup@

Any one has an idea what I'm doing wrong

I want the script to start server on REBOOT

Viren
  • 171
  • 1
  • 2
  • 10

2 Answers2

1

A couple of things you might need to check -

1 - you enabled thin for run levels 35, make sure your server is running in either run level 3 or 5. If not you might need to enable it for additional run levels. Although a CentOS server is most likely to run in run level 3 or 5, just double check it. runlevel

2 - Specify the full path to the thin binary.

something like this -

DAEMON=/fullpathhere-to-binary-here/bin/thin

$DAEMON -C /yml-path-here/.yml start

3 - Before adding it to a start up script, confirm that the script works fine from the command line -

  thin -C /home/perwe100/public_html/1001/fedena-v2.3-bundle-linux/config/fedena.yml start
Daniel t.
  • 9,061
  • 1
  • 32
  • 36
0

Init scripts are a bit more complex than your script. Check out here: http://werxltd.com/wp/2012/01/05/simple-init-d-script-template/

If you didn't want to write a complex init script than you can put your stuff into /etc/rc.d/rc.local see: http://www.centos.org/docs/5/html/5.1/Installation_Guide/s1-boot-init-shutdown-run-boot.html

Stone
  • 6,941
  • 1
  • 19
  • 33
  • Good to know this but I cant see it working either not working added the script `/usr/local/bin/thin -C /home/perwe100/public_html/1001/fedena-v2.3-bundle-linux/config/fedena.yml start` when added in `/etc/rc.d/rc.local` any other solution my friend – Viren Feb 01 '13 at 13:51
  • Try /etc/rc.local – Stone Feb 01 '13 at 14:07
  • `/etc/rc.local -> rc.d/rc.local*` symlink already added as mention above – Viren Feb 01 '13 at 14:09
  • You should have the simplink /etc/rc?.d/S99local to ../rc.local on your desired runlevel. It is not by default. See the answer at: http://serverfault.com/questions/475568/centos6-etc-rc-d-rc-local-not-running-at-boot-why – Stone Feb 05 '13 at 11:38