[p4] p4d -- able to survive long "laptop sleep"?
jab at pobox.com
Thu Mar 17 06:00:13 PST 2005
There is another way.
Look at "p4d -i" as an alternate route, in which you can have an
"p4d" started by inetd ONLY when a TCP request comes into port 1666.
way, "p4d" is running only when it's processing a command, and
server isn't just inactive - it isn't running.
For a lightly used server, on a laptop or the like, this works
If memory serves, I needed to touch: /etc/services, /etcinetd.conf, and
to write a small shell script that ran "p4d -i" with the right
My entry for /etc/inetd.conf is:
p4-1666 stream tcp nowait root /usr/local/bin/p4inet p4d p4-1666
My entry for /etc/services is:
My version of /usr/local/bin/p4inet was:
> export P4DEBUG
> case $1 in
> p4-1666) R=/p4/p4-root; S=/p4/p4-root/p4d ;;
> p4-1777) R=/p4/p4-playpen; S=/p4/p4-playpen/p4d ;;
> *) exit ;;
> export P4ROOT=$R
> exec $S -v$P4DEBUG -i 2>> $P4ROOT/LOG
PLEASE don't take this as a complete set of instructions; read the
But this strategy's been really handy for me, for years, on Unix/Linux
And I haven't found a better Unix laptop than my Apple Powerbook.
On Mar 17, 2005, at 12:06 AM, Peter Steiner wrote:
> 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
> $ 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
> # Perforce Server
> . /etc/rc.common
> /usr/local/bin/p4d -q -J /data/perforce/journal \
> -L /data/perforce/log -r /data/perforce &
> killall "p4d"
> StartService ()
> ConsoleMessage "Starting Perforce Server"
> StopService ()
> ConsoleMessage "Stopping Perforce Server"
> RestartService ()
> ConsoleMessage "Restarting Perforce Server"
> sleep 1
> 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
> Come to the 2005 Perforce User Conference, April 14 & 15 in Las Vegas.
> Learn more: http://www.perforce.com/conf
> perforce-user mailing list - perforce-user at perforce.com
More information about the perforce-user