Discussion:
[p4] Server is unexpectedly restarting but nothing in logs?
Michael Mirman
2016-06-26 17:04:45 UTC
Permalink
Did you look in p4d.log - how the server was stopped?
If there is nothing at all in that regard in p4d.log, then it might be that the system killed the server the hard way.

Here's what I would do:

Make sure the server is started with a command (or a simple script) that redirects all output (stdout as well as stderr) to a file. This way, not only there might be some errors, which wouldn't get otherwise to p4d.log, but also you will have a time stamp on that file, which will tell you when last time p4d said anything.

Did the whole system restart/reboot? Is there anything that would make the system go into some kind of hibernation? The bottom line is, if there is nothing in the p4d log, it looks like "something" kills the server, and we need to identify the killer.

You can also have a script that spits out the time stamp before and after starting p4d - something simple like
#! /bin/sh
echo "Starting p4d" `date` >> logfile
p4d whatever >> logfile 2>&1 (without -d)
echo "p4d ended" `date` >> logfile
and the init.d setting would make this script to start during the reboot.
The content of logfile may help diagnose the problem.
--
Michael Mirman
MathWorks, Inc.
508-647-7555


-----Original Message-----
From: perforce-user [mailto:perforce-user-***@perforce.com] On Behalf Of Jibberish
Sent: Sunday, June 26, 2016 10:20 AM
To: perforce-***@perforce.com
Subject: [p4] Server is unexpectedly restarting but nothing in logs?

Posted on behalf of forum user 'Jibberish'.

So I've got a Perforce server up and running on a Linux box, but for some
reason p4d is not running whenever I log on to the system every morning? It
seems to start up just fine, but I can't find any errors in the
syslog.��I'm sorta new to Linux and Perforce, any idea where else
I should look? Are there any perforce specific logs I should be checking?

This isn't in production yet, so I've got some time to figure it out.

Thanks in advance!
--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/4840-server-is-unexpectedly-restarting-but-nothing-in-logs
_______________________________________________
perforce-user mailing list - perforce-***@perforce.com
http://maillist.p
Michael Mirman
2016-06-26 22:08:02 UTC
Permalink
It's not p4.log.
It is the server log file you use in the -L option when you start.
I called it "p4d log" because it's a log of p4d.
How do you start p4d?
--
Michael Mirman
MathWorks, Inc.
508-647-7555


-----Original Message-----
From: perforce-user [mailto:perforce-user-***@perforce.com] On Behalf Of Jibberish
Sent: Sunday, June 26, 2016 5:35 PM
To: perforce-***@perforce.com
Subject: Re: [p4] Server is unexpectedly restarting but nothing in logs?

Posted on behalf of forum user 'Jibberish'.

I executed the following command and got nothing in return
sudo find / -mount -name 'p4.log' I also tried setting the environment
variable P4LOG="/tmp" and it never populated the directory with
anything.
The directory /tmp does exist
--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/4840-server-is-unexpectedly-restarting-but-nothing-in-logs
_______________________________________________
perforce-user mailing list - perforce-***@perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user
_______________________________________________
perforce-user mailing list - perforce-***@perforce.com
http://maillist.perforce.com/mailman/li
Michael Mirman
2016-06-26 23:22:14 UTC
Permalink
For all intents and purposes, I prefer to run "p4 -p P4PORT info".
If it comes back happy, the server is running.
If it fails... then ps makes sense to me to further isolate the problem.
--
Michael Mirman
MathWorks, Inc.
508-647-7555


-----Original Message-----
From: perforce-user [mailto:perforce-user-***@perforce.com] On Behalf Of Jibberish
Sent: Sunday, June 26, 2016 6:55 PM
To: perforce-***@perforce.com
Subject: Re: [p4] Server is unexpectedly restarting but nothing in logs?

Posted on behalf of forum user 'Jibberish'.

Well I think I may have figured out what the problem is.��To figure
out if the server was running, I was issuing the following statement
if [[ $(ps | grep -q p4d; echo $?) -eq 0 ]] &&
[[ $(p4 info | grep -q "Server uptime"; echo $?) -eq
0 ]] Which appears to work, except that for reasons I simply don't
understand (Again noob here...) p4d disappears from ps and only can be found
in ps aux
So I think I may have been fooling myself on this one, and the server was always
running.

Is there a better way to check if p4d is running other than greping the ps aux
output?



Quote
How do you start p4d? I simply issue the command
p4d -d >> ${log_file} I have simply been setting my p4 variables in
/etc/environment instead of specifying them when I launch p4d.
Should I be doing this a different way?
--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/4840-server-is-unexpectedly-restarting-but-nothing-in-logs
_______________________________________________
perforce-user mailing list - perforce-***@perforce.com
http://maillist.perforce.com/mailman/l
Loading...