Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 292843 - net-misc/openssh: sshd init script does not create a valid pid
Summary: net-misc/openssh: sshd init script does not create a valid pid
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 435668
  Show dependency tree
 
Reported: 2009-11-11 21:07 UTC by Daniel Pielmeier
Modified: 2013-04-27 08:43 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,3.68 KB, text/plain)
2009-11-11 21:08 UTC, Daniel Pielmeier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Pielmeier gentoo-dev 2009-11-11 21:07:44 UTC
At system boot I get this when starting sshd:

* Starting sshd...
* start-stop-daemon: did not create a valid pid in `/var/run/sshd.pid' [ !! ]
* ERROR: sshd failed to start

sshd itself is running but rc-status shows sshd is in stopped state. Start stop or restart sshd is not possible, so one has to kill sshd manually and zap the init script. After this starting sshd works fine.

/etc/init.d/sshd start
* Starting sshd...
* start-stop-daemon: /usr/sbin/sshd is already running [ !! ]
* ERROR: sshd failed to start

/etc/init.d/sshd stop
* WARNING: sshd is already stopped

killall sshd

/etc/init.d/sshd zap
* Manually resetting sshd to stopped state

/etc/init.d/sshd start
* Starting sshd... [ ok ]
Comment 1 Daniel Pielmeier gentoo-dev 2009-11-11 21:08:05 UTC
Created attachment 209952 [details]
emerge --info
Comment 2 SpanKY gentoo-dev 2009-11-11 22:12:41 UTC
i havent seen this on any of my systems, and i imagine more people would see & report if it were a common issue ... while you are mixing stable and unstable, i do the same on my x86 and it seems to work fine.

what is the pid of sshd once you've booted ?  and what is the pid in the sshd.pid in the run dir ?
Comment 3 Daniel Pielmeier gentoo-dev 2009-11-11 23:55:21 UTC
(In reply to comment #2)
> i havent seen this on any of my systems, and i imagine more people would see &
> report if it were a common issue ... while you are mixing stable and unstable,
> i do the same on my x86 and it seems to work fine.
> 
> what is the pid of sshd once you've booted ?  and what is the pid in the
> sshd.pid in the run dir ?
> 

I should have mentioned it before. The pid of the running sshd is the same as te one stored in the pidfile.

It looks like openrc is just not waiting long enough for the pid creation and errors out. I think I have seen bugs where this happened.
Comment 4 nico 2009-12-04 14:42:04 UTC
This seems to be a problem with openrc. It worked for me before 0.5.2 and it still happens with 0.5.3.
Comment 5 nico 2009-12-19 17:39:54 UTC
If you are using dhcpcd 5.x, try adding 'waitip' to /etc/dhcpcd.conf
Comment 6 Michael Hill 2010-05-01 20:14:48 UTC
(In reply to comment #2)
> i havent seen this on any of my systems, and i imagine more people would see &
> report if it were a common issue ...

I have been having the same problem for a while...  don't know when it started.  I usually wait a few weeks to report a bug rather than create a bug report right away...  and I try to keep reasonable uptimes, so don't usually observe the problem more than once a month at best.

> what is the pid of sshd once you've booted ?  and what is the pid in the
> sshd.pid in the run dir ?

For me, same as Daniel in #3; sshd starts correctly and its PID is in /var/run/sshd.pid .  As for #5, I use static addresses on this system, not DHCP.

$ emerge --info
Portage 2.1.8.3 (default/linux/x86/10.0/desktop, gcc-4.4.3, glibc-2.11.1-r0, 2.6.33-gentoo i686)
=================================================================
System uname: Linux-2.6.33-gentoo-i686-Intel-R-_Core-TM-2_Quad_CPU_Q9450_@_2.66GHz-with-gentoo-2.0.1
Timestamp of tree: Sat, 01 May 2010 12:30:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p5
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r1, 3.1.2-r2
dev-python/pycrypto: 2.1.0
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.1-r1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.8.5-r4, 1.9.6-r3, 1.10.3
sys-devel/binutils:  2.20.1
sys-devel/gcc:       3.4.6-r2, 4.3.4, 4.4.3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.33
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=nocona -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=nocona -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests buildpkg ccache collision-protect distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans"
GENTOO_MIRRORS="http://distfiles.gentoo.org/ http://www.gtlib.cc.gatech.edu/pub/gentoo/"
LDFLAGS="-Wl,-O1"
LINGUAS="en"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi additions aiglx alsa ao apache2 audacious audiofile bash-completion bcmath berkdb bindist branding bzip2 bzlib cairo calendar cdda cdinstall cdr cli consolekit cracklib crypt cups curl cxx dbase dbus dbx dedicated dga divx doc dovecot-sasl dri dts dv dvd dvdr emboss encode exif expat fam fame fbcon ffmpeg fftw firefox flac flatfile font-server fontforge gd gecko-sdk gif gimpprint ginac glitz glut gnuplot gnutls gpgme gpm gs gtk guidexml hal hardenedphp hou iconv id3tag imagemagick imlib inifile jack jpeg jpeg2k keyscrub latin1 lcms libnotify libsamplerate logrotate logwatch lzma mad mbox memlimit mikmod milter mime mmap mmx mng modplug modules mp3 mp4 mpeg mpm-prefork mudflap mysql ncurses no-suexec nocardbus nocd nodrm nomotif nowin nptl nptlonly nsplugin ofx ogg opengl pam pango pcntl pcre pda pdf perl php pie plotutils png posix ppds pppd python qt-bundled qt3support qt4 quotes readline realmedia reflection rtsp sasl sdl server session shared sharedmem simplexml skins smtp sndfile sockets sou spell spl sse sse2 ssl ssse3 startup-notification subtitles svg sysfs sysvipc tagwriting tcl tcpd threads tidy tiff timidity tk truetype ups usb userlocales vhosts videos vim-syntax vorbis wma wmp wv wxgtk1 wxwindows x264 x86 xcb xine xml xorg xpm xprint xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="ice1712" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vga nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 7 Daniel Pielmeier gentoo-dev 2010-12-01 17:25:44 UTC
Looks like I found the reason for this problem. Recently I switched from rc_parallel="YES" to rc_parallel="NO". Since then the problem did not occur anymore. Looks like there is a problem with services starting in parallel.
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-01-18 00:41:02 UTC
please retest.
Comment 9 Fabio Rossi 2013-02-09 22:31:14 UTC
On my system (stable amd64 in a virtual machine) the sshd service is reported as crashed after the boot is completed:

# /etc/init.d/sshd status
 * status: crashed

The server is instead correctly running, the PID file is present in /etc/sshd while it's not present in /var/run. I'm using the default configuration.

So during shutdown I get

* Stopping sshd...
* start-stop-daemon: fopen `/var/run/sshd.pid': No such file or directory [ ok ]
Comment 10 SpanKY gentoo-dev 2013-04-27 08:43:09 UTC
(In reply to comment #9)

already been fixed in latest versions