Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to run Perforce Server (p4d) as daemon.

so, I copied a /init.d/p4d file from /init.d/skeleton file and modified to run /usr/sbin/p4d -d

It is worked well by manually run it.

$ /etc/init.d/p4d start
Perforce Starting...

but It is not worked on boot automatically. (at Ubuntu 12.04.1 Desktop x64)

so, I have tried to run it at Ubuntu 12.04.1 Server x64

WOW! The same script, but it works on only Ubuntu Server.

What is it i missed?

(yes, of course, I did "sudo update-rc.d p4d defaults")

Any help will be greatly appreciated.

This is the script:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          p4d
# Required-Start:    $network $local_fs $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Example initscript
# Description:       This file should be used to construct scripts to be
#                    placed in /etc/init.d.
### END INIT INFO

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin
DESC="Perforce Service"
NAME=p4d
DAEMON=/usr/sbin/$NAME
DAEMON_ARGS="-d -r /home/devadmin/repo -p 1666"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
    start-stop-daemon --start --exec $DAEMON -- $DAEMON_ARGS
}

..here rest of the script is same with skeleton file..
share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.