0

i have this startup script under fedora running fine

#!/bin/sh -e

export P4JOURNAL=/var/log/perforce/journal
export P4LOG=/var/log/perforce/p4err
export P4ROOT=/var/local/perforce
export P4PORT=1666

PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"

p4start="p4d  -d"
p4stop="p4  admin stop"
p4user=perforce


case "$1" in
start)

#NOTE: in original, havent found RedHat equiv or source to include
# Havent found . /lib/lsb/init-functions
#log_action_begin_msg "Starting Perforce Server"
echo "starting perforce server from script..."
$p4start;
;;

stop)
# see above
#log_action_begin_msg "Stopping Perforce Server"
echo "stoping perforce server from script"
$p4stop;
;;

restart)
 $p4stop;
 $p4start;
;;

*)
echo "Usage: /etc/init.d/perforce (start|stop|restart)"
exit 1
;;

esac

but it won't work at ubuntu, not sure what went wrong.(p4d and p4 are both in /usr/local/bin)

Any help will be appreciated.

i got this using sh -x

starting perforce server from script...
+ p4d -d
+ exit 0

the result seems right, but p4d not running.

3
  • Does it error? What happens if you run it with 'sh -x'? That should show you what is happening step-by-step. Sep 16, 2010 at 22:25
  • Well, it looks like there is nothing wrong with your script. Does "p4d -d" work the way you are expecting when you run it by hand? If so, then my guess is that some environment variables or path information doesn't have enough information for p4d to do the right thing (or has the wrong information). Sep 16, 2010 at 23:31
  • Great. I'm going to repost that last comment as an answer. Thanks. Sep 17, 2010 at 2:02

1 Answer 1

1

It looks like there is nothing wrong with your script. Does "p4d -d" work the way you are expecting when you run it by hand? If so, then my guess is that some environment variables or path information doesn't have enough information for p4d to do the right thing (or has the wrong information).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .