LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-16-2008, 05:04 AM   #1
neocookie
Member
 
Registered: Apr 2004
Location: Leeds, UK
Distribution: FC1, FC2, Debian
Posts: 308

Rep: Reputation: 30
sshd not creating PID file [CentOS5]


sshd on my CentOS5 box is not creating a PID file on startup, which is causing problems when trying to monitor the daemon. I've searched the system in case the file isn't made in /var/run, but came up empty.

There's nothing in /var/log/messages to say why it can't create the file. Running `/var/sbin/sshd -t` doesn't throw any errors. I've tried forcing the output by putting "PidFile /var/run/sshd.pid" in /etc/ssh/ssh_config, but no luck there.

Any suggestions on where I can look next?
 
Old 12-16-2008, 05:37 AM   #2
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 747

Rep: Reputation: 73
First of all you shouldnt do this: /var/sbin/sshd -t. In CentOS is /usr/sbin/sshd -t.

You can try find it 2 ways: which sshd|xargs ls -la or if this doesnt work then: find /usr -name "sshd" -type f -exec ls -la {} \;

Also you could try to monitor all the logs, by modified syslog configuration:

Add this line in syslog.conf

nano /etc/syslog.conf

go to end of the file and add:

*.debug /var/log/syslog.out

save file

restart syslog: /etc/init.d/syslog restart

then: tail -f /var/log/syslog.out

open a new console (sshd sessions) and try /usr/sbin/sshd or /etc/init.d/sshd start

and see what errors might accrue.
 
Old 12-16-2008, 06:20 AM   #3
neocookie
Member
 
Registered: Apr 2004
Location: Leeds, UK
Distribution: FC1, FC2, Debian
Posts: 308

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by robertjinx View Post
First of all you shouldnt do this: /var/sbin/sshd -t. In CentOS is /usr/sbin/sshd -t.
Sorry, typo.

Thanks, I'll give the rest a try.
 
Old 12-16-2008, 04:58 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by neocookie
Any suggestions on where I can look next?
$ ls -ld /var/run

??

Also, to start/stop sshd:

# service sshd start/stop
 
Old 12-17-2008, 07:36 AM   #5
neocookie
Member
 
Registered: Apr 2004
Location: Leeds, UK
Distribution: FC1, FC2, Debian
Posts: 308

Original Poster
Rep: Reputation: 30
Putting the PidFile path in the config and a cheeky restart of the box sorted the issue.

Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
reading pid from pid file in C language shifter Programming 1 05-14-2008 10:49 AM
Starting sshd: /etc/init.d/sshd: line 113: /usr/sbin/sshd: Permission denied sumanc Linux - Server 5 03-28-2008 04:59 AM
How can I find my sshd pid on connect? Termina Linux - Networking 2 12-05-2006 07:30 PM
ERROR: Couldn't write pid to pid file lawrencegoodman Linux - Newbie 2 02-13-2004 08:05 PM
sshd at startup and pid questions :) breakerfall Linux - General 4 09-28-2003 08:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration