4

I'm using tyrantmanager to manage several instances of Tokyo Tyrant. It's working fine.

I want to get it to start at boot, so I add the following command into /etc/rc.local:

/usr/local/bin/tyrantmanager start --home=/data/tyrant/

(this will be OK when doing from the command line)

Last week, my server hanged and I must hard reset. After booting, login to and check I see no Tokyo Tyrant instances running.

Is there any way to test to make sure it will start successfully at the next boot? Except of redirecting the output and error to a log file with >> /var/log/tyrantmanager.log 2>&1, what else can I do to 'debug' if it keep failing to start.

PS: I can write an init script for it but still want to examine the root cause for this case.


EDIT: I've tested on the dev server and got the same result. Below is the log file:

15:02:17  INFO : Starting test : ttserver -host 192.168.x.x -port 1978 -thnum 8 -tout 15 -dmn -pid /opt/tyrant/instances/test/test.pid -log /opt/tyrant/instances/test/log/test.log -le -ulog /opt/tyrant/instances/test/ulog -ulim 1g -rts /opt/tyrant/instances/test/test.rts /opt/tyrant/instances/test/data/test.tch#opts=ld#mode=wc
/usr/local/lib/ruby/gems/1.8/gems/logging-1.5.2/lib/logging/logger.rb:429: command not found:  ttserver -host 192.168.x.x -port 1978 -thnum 8 -tout 15 -dmn -pid /opt/tyrant/instances/test/test.pid -log /opt/tyrant/instances/test/log/test.log -le -ulog /opt/tyrant/instances/test/ulog -ulim 1g -rts /opt/tyrant/instances/test/test.rts /opt/tyrant/instances/test/data/test.tch#opts=ld#mode=wc 

I'm not familiar with Ruby, so I don't know why it through the "command not found" error from logger.rb. Maybe I will ask the question on stackoverflow.

quanta
  • 52,423

3 Answers3

8

No matter what distro I nowadays use, I have learnt my lesson: if I want to make sure something comes up at boot, I will reboot the server and see what happens. Just schedule a maintenance window for your server (if needed) and perform couple of test restarts at that time. See if it works.

In the past I've been sure that "this will start during next reboot", but then it will not.

4

[Quick Answer]


To run rc.local manually, go to rc.local path (cd /etc/) then do as the following:

$ sudo ./rc.local

If you have an error for execution, do it before that:

$ sudo chmod +x rc.local
1

Looks like either:

  • ttserver isn't in the path when /etc/rc.local runs. Make sure that the environment is set up correctly in /etc/rc.local. As you say, it works from the command line.
  • the ruby script is calling the entire command string as a single command without any parameters.

I suspect the first.

MikeyB
  • 40,079