[p4] p4d -- able to survive long "laptop sleep"?

Peter Steiner peter.steiner at hugwi.ch
Thu Mar 17 00:06:56 PST 2005


On Wed, 16 Mar 2005 11:17:53 -0800, Mark Harrison wrote:

> I'm setting up p4 for somebody whose primary hardware
> platform will be an apple powerbook.
> 
> p4d will be fun from init.d at startup.

Does the powerbook run OS X? Then you should perhaps consider using a 
StartupItem. My very simple setup (a more sophisticated one is on 
http://www.piap.com/faq/p4_setup.html):

$ ls -l /Library/StartupItems/Perforce/
total 16
-rwxrwxr--  1 root  admin  489 20 Nov  2003 Perforce
-rw-rw-r--  1 root  admin  154 20 Nov  2003 StartupParameters.plist

/Library/StartupItems/Perforce/Perforce:
==================
#!/bin/sh

##
# Perforce Server
##

. /etc/rc.common


start_p4d()
{
     /usr/local/bin/p4d -q -J /data/perforce/journal \
         -L /data/perforce/log -r /data/perforce &
}

stop_p4d()
{
     killall "p4d"
}

StartService ()
{
     ConsoleMessage "Starting Perforce Server"
     start_p4d
}

StopService ()
{
     ConsoleMessage "Stopping Perforce Server"
     stop_p4d
}

RestartService ()
{
     ConsoleMessage "Restarting Perforce Server"
     stop_p4d
     sleep 1
     start_p4d
}
==================

/Library/StartupItems/Perforce/StartupParameters.plist
==================
{
   Description     = "Perforce server";
   Provides        = ("Perforce Server");
   Requires        = ("Disks", "Network");
   OrderPreference = "None";
}
==================


> 
> The powerbook will sleep whenever the screen is closed.
> Will this cause any kind of known problems for p4d?

I have a p4d running on my powerbook for more than a year and p4d never 
failed me. And I almost never shut the powerbook down, I usually just 
close the lid...

Regards, Peter
-- 
    _   _        Peter Steiner <peter.steiner at hugwi.ch>
  / /_/ /        Hug-Witschi AG <http://www.hugwi.ch/>
 /  _  /         Electronic Engineering
/_/ /_/  _   _   Auriedstrasse 10
   / / / / / /   CH-3178 Boesingen
  / /_/ /_/ /    Tel  +41 31 740 44 44
 /_ _ _ _ _/     Fax  +41 31 740 44 45




More information about the perforce-user mailing list