LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-20-2009, 10:25 AM   #1
cipher7836
Member
 
Registered: Dec 2008
Posts: 35

Rep: Reputation: 15
Services


Version: Cent OS 5.2
Service: TimeTrex


Scenario:

The other day the power went down, and the TimeTrex server had to reboot. For some odd reason it didn't start the

TimeTrex service. Found out why the service did not start up.

Here is its rc.local entry:

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/usr/bin/sudo -u postgres /var/lib/pgsql/TimeTrex/start



Is there a general area where I could see why some services didn't start up? I checked specifically for a log for this

program, but couldn't find one. But I was wondering if there was an initlog that logged the results of startup. It

didn't seem as if there was one unless you created it. Does anyone have an idea as to what to do next?
 
Old 07-20-2009, 12:17 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
Quote:
Originally Posted by cipher7836 View Post
The other day the power went down, and the TimeTrex server had to reboot. For some odd reason it didn't start the TimeTrex service. Found out why the service did not start up.
When a service is shut down it'll try to do this as safe as possible making sure any clients are disconnected properly, data is flushed out to disk and the application is stopped like it should. Using an UPS may help allowing for just enough time to shut down properly. Some services may revolt or refuse to start when previously interrupted. If no verbose or debug output (ore related errors) are available from /var/log/messages (see /etc/syslog.conf) you best look for application-specific logging configuration (also see timetrex.ini.php ?). Reading the log or egrepping it for '-ie "(error|warning|fail|fatal)"' might reveal what went on, else 'tail -F /var/log/postgresql' might show more when you try to restart the app (with or without setting "log_error_verbosity" to verbose ?).


* Since you're new here a short remark about thread titles. Members will often check if they can or want to chip in a reply or answer from looking at a thread title. Your thread title "services" seems to be lacking detail. Basically nobody knows what it's about until they read it. Now your thread is for a specific distribution, a specific service, a specific situation (startup prob) with a specific cause (pwr fail). I hope you see that a thread title like "TimeTrex on Centos: service startup problem due to power failure" or the more terse "TimeTrex startup after power failure" would be way better.
 
Old 07-21-2009, 09:54 AM   #3
cipher7836
Member
 
Registered: Dec 2008
Posts: 35

Original Poster
Rep: Reputation: 15
I looked in each log area, and didn't find anything related to that particular application. Yesterday we put the machine onto a UPS. We allowed for some time to shut down, however, even with a graceful shutdown the server didn;t restart the application.
 
Old 07-21-2009, 10:05 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Is rc.local enabled in all runlevels? You should have:
Code:
$ ls -l /etc/rc.d/rc?.d/*local
lrwxrwxrwx 1 root root 11 Apr  2 10:27 /etc/rc.d/rc2.d/S99local -> ../rc.local
lrwxrwxrwx 1 root root 11 Apr  2 10:27 /etc/rc.d/rc3.d/S99local -> ../rc.local
lrwxrwxrwx 1 root root 11 Apr  2 10:27 /etc/rc.d/rc4.d/S99local -> ../rc.local
lrwxrwxrwx 1 root root 11 Apr  2 10:27 /etc/rc.d/rc5.d/S99local -> ../rc.local
What if you redirect the stdout and stderr to a file? Also add a simple command to see if rc.local is actually executed:
Code:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/bin/date >> /tmp/rc.local.log 2>&1
/usr/bin/sudo -u postgres /var/lib/pgsql/TimeTrex/start >> /tmp/rc.local.log 2>&1
 
Old 07-21-2009, 10:07 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
is /etc/rc.local executable?
 
Old 07-21-2009, 06:00 PM   #6
jeromeNP7
Member
 
Registered: Jun 2009
Posts: 101

Rep: Reputation: 19
/etc/rc.local is a shell script and it usually has the execution bits set, even though scripts in general can (under certain circumstances) be launched without the exec bits set.

Linux

Last edited by jeromeNP7; 09-04-2009 at 10:21 PM.
 
Old 07-22-2009, 09:41 AM   #7
cipher7836
Member
 
Registered: Dec 2008
Posts: 35

Original Poster
Rep: Reputation: 15
ls -l /etc/rc.d/rc?.d/*local gives me the same output as above. And rc.local is executable. We tried this as well:

touch /var/lock/subsys/local
/bin/date >> /tmp/rc.local.log 2>&1
/usr/bin/sudo -u postgres /var/lib/pgsql/TimeTrex/start >> /tmp/rc.local.log 2>&1


But without the: /bin/date >> /tmp/rc.local.log 2>&1. (This had already been done before I posted. This would tell me if it was executing on startup, right?)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
services-admin/Services deardron Ubuntu 7 09-22-2006 09:32 PM
Media Services on Linux platform similar to Windows Media Services happyok Linux - Software 3 05-27-2006 05:36 PM
Services... wardialer Linux - Security 9 04-23-2005 01:44 PM
Necessary Services? nistelrooy Linux - Security 5 02-25-2005 09:25 AM
TightVNC Ver terminal Services.. also looking for terminal Services for linux 2782d4 Linux - Security 3 05-20-2004 03:30 AM


All times are GMT -5. The time now is 06:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration