LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-13-2005, 10:43 AM   #1
UglyWrangler
LQ Newbie
 
Registered: Jan 2005
Posts: 2

Rep: Reputation: 0
Init Script for p4d not working


I am trying to start p4d (the Perforce source code control server) with a script in init.d. My p4d startup script is listed below. I see the boot sequence try to start p4d and it indicates success: [OK], but when the login prompt appears the process is not running. From the command line the script works perfectly. What am I doing wrong?

# chkconfig: 345 90 20
# description: Perforce Server

P4ROOT=/var/local/perforce
P4JOURNAL=/var/local/perforce/journal
P4LOG=/var/local/perforce/logs/p4err
P4PORT=1666
P4USER=ggatling
P4PASSWD=****

case "$1" in
start)
p4d -r $P4ROOT -J $P4JOURNAL -L $P4LOG -p $P4PORT -d
;;
stop)
p4 -p$P4PORT -u$P4USER -P$P4PASSWD admin stop
;;
restart)
p4 -p$P4PORT -u$P4USER -P$P4PASSWD admin stop
p4d -r $P4ROOT -J $P4JOURNAL -L $P4LOG -p $P4PORT -d
;;
*)
printf "Usage: %s {start|stop|restart}\n" "$0"
exit 1
esac

exit 0
 
Old 01-15-2005, 08:05 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hi,

The problem is that during init process, PATH is not set...
so it try to launch p4d (can't find it) but as it did the start statement it returns 0 as exit code so for Linux that's OK even if the process doesn't run
to correct that, just add the complete path to p4d, for example: /usr/bin/p4d -r $P4ROOT -J $P4JOURNAL -L $P4LOG -p $P4PORT -d

Oliv'
 
Old 01-18-2005, 10:45 AM   #3
UglyWrangler
LQ Newbie
 
Registered: Jan 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Oliv'

Your suggestion worked perfectly and explains why the script would work from the command line. Thanks so much for your help!

George
 
  


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
homemade init script not working scylla Linux - General 2 01-21-2005 07:26 PM
can't get my init script working nukeu666 Linux - Newbie 4 12-16-2004 11:12 AM
help with init script output ierickson Linux - General 0 05-07-2004 12:05 PM
TOMCAT init script not working on startup -- tomcat 4.x / Mandrake Linux 8.0 jmartinph Mandriva 0 03-08-2004 01:31 AM
could use some help with my init.d script.... BrianK Linux - General 3 10-31-2002 07:21 PM


All times are GMT -5. The time now is 02:23 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration