LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   sshd not creating PID file [CentOS5] (https://www.linuxquestions.org/questions/linux-server-73/sshd-not-creating-pid-file-%5Bcentos5%5D-690916/)

neocookie 12-16-2008 05:04 AM

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?

robertjinx 12-16-2008 05:37 AM

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.

neocookie 12-16-2008 06:20 AM

Quote:

Originally Posted by robertjinx (Post 3377196)
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.

anomie 12-16-2008 04:58 PM

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

neocookie 12-17-2008 07:36 AM

Putting the PidFile path in the config and a cheeky restart of the box sorted the issue.

Thanks!


All times are GMT -5. The time now is 06:27 PM.