Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sshd does not have a start function [now works but unsolved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cvweiss
n00b
n00b


Joined: 25 Apr 2005
Posts: 67
Location: Detroit!

PostPosted: Thu Mar 22, 2007 5:40 am    Post subject: sshd does not have a start function [now works but unsolved] Reply with quote

So today I realize I can't ssh into my machine, after some investigation it comes down to:

Code:

desktop init.d # ./sshd start
 * Caching service dependencies ...                                       [ ok ]
 * ERROR:  sshd does not have a start function.
desktop init.d # cat ./sshd
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
desktop init.d #


I tried to reemerge openssh, but it didn't replace the file with anything useful. What gives here? What happened to the contents of /etc/init.d/sshd ? It has probably been about 3 weeks since I've had to ssh into this machine, and I've done, maybe, 2 or 3 emerge --sync and emerge --uDN world since then. So whatever affected this has occured between 3 weeks ago and now.

Thanks for your help,
Clinton
_________________
If at first you don't suceed, try again does NOT apply to skydiving.


Last edited by cvweiss on Thu Mar 22, 2007 6:06 am; edited 1 time in total
Back to top
View user's profile Send private message
IQgryn
l33t
l33t


Joined: 05 Sep 2005
Posts: 764
Location: WI, USA

PostPosted: Thu Mar 22, 2007 5:51 am    Post subject: Reply with quote

Not sure what happened, but here's the contents of mine (sshd version 4.5p1):
Code:
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6,v 1.22 2007/02/23 10:51:48 uberlord Exp $

opts="reload"

depend() {
        use logger dns
        need net
}

SSHD_CONFDIR=${SSHD_CONFDIR:-/etc/ssh}
SSHD_PIDFILE=${SSHD_PIDFILE:-/var/run/${SVCNAME}.pid}
SSHD_BINARY=${SSHD_BINARY:-/usr/sbin/sshd}

checkconfig() {
        if [ ! -d /var/empty ] ; then
                mkdir -p /var/empty || return 1
        fi

        if [ ! -e "${SSHD_CONFDIR}"/sshd_config ] ; then
                eerror "You need an ${SSHD_CONFDIR}/sshd_config file to run sshd"
                eerror "There is a sample file in /usr/share/doc/openssh"
                return 1
        fi

        gen_keys || return 1

        "${SSHD_BINARY}" -t ${myopts} || return 1
}

gen_keys() {
        if [ ! -e "${SSHD_CONFDIR}"/ssh_host_key ] ; then
                einfo "Generating Hostkey..."
                /usr/bin/ssh-keygen -t rsa1 -b 1024 -f "${SSHD_CONFDIR}"/ssh_host_key -N '' || return 1
        fi
        if [ ! -e "${SSHD_CONFDIR}"/ssh_host_dsa_key ] ; then
                einfo "Generating DSA-Hostkey..."
                /usr/bin/ssh-keygen -d -f "${SSHD_CONFDIR}"/ssh_host_dsa_key -N '' || return 1
        fi
        if [ ! -e "${SSHD_CONFDIR}"/ssh_host_rsa_key ] ; then
                einfo "Generating RSA-Hostkey..."
                /usr/bin/ssh-keygen -t rsa -f "${SSHD_CONFDIR}"/ssh_host_rsa_key -N '' || return 1
        fi
        return 0
}

start() {
        local myopts=""
        [ "${SSHD_PIDFILE}" != "/var/run/sshd.pid" ] \
                && myopts="${myopts} -o PidFile=${SSHD_PIDFILE}"
        [ "${SSHD_CONFDIR}" != "/etc/ssh" ] \
                && myopts="${myopts} -f ${SSHD_CONFDIR}/sshd_config"

        checkconfig || return 1
        ebegin "Starting ${SVCNAME}"
        start-stop-daemon --start --exec "${SSHD_BINARY}" \
            --pidfile "${SSHD_PIDFILE}" \
            -- ${myopts} ${SSHD_OPTS}
        eend $?
}

stop() {
        ebegin "Stopping ${SVCNAME}"
        start-stop-daemon --stop --exec "${SSHD_BINARY}" \
            --pidfile "${SSHD_PIDFILE}" --quiet
        eend $?
}

reload() {
        ebegin "Reloading ${SVCNAME}"
        start-stop-daemon --stop --signal HUP --oknodo \
            --exec "${SSHD_BINARY}" --pidfile "${SSHD_PIDFILE}"
        eend $?
}
Back to top
View user's profile Send private message
cvweiss
n00b
n00b


Joined: 25 Apr 2005
Posts: 67
Location: Detroit!

PostPosted: Thu Mar 22, 2007 6:04 am    Post subject: Reply with quote

IQgryn wrote:
Not sure what happened, but here's the contents of mine (sshd version 4.5p1):


Thanks! That got my sshd back. It's a start, and I can synchronize with my local CVS server (whew).
_________________
If at first you don't suceed, try again does NOT apply to skydiving.
Back to top
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1155

PostPosted: Thu Mar 22, 2007 7:52 pm    Post subject: Reply with quote

Have you run etc-update lately?
_________________
Game! - Where the stick is mightier than the sword!
Back to top
View user's profile Send private message
cvweiss
n00b
n00b


Joined: 25 Apr 2005
Posts: 67
Location: Detroit!

PostPosted: Thu Mar 22, 2007 9:09 pm    Post subject: Reply with quote

Mad Merlin wrote:
Have you run etc-update lately?


It has been habit for me to run etc-update and revdep-rebuild after running emerge -uDN world. And yup, I've ran it. Since I don't typically edit the /etc files myself, I usually pick -3 for most /etc files. I don't recall it wanting to modify /etc/init.d/sshd tho.
_________________
If at first you don't suceed, try again does NOT apply to skydiving.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum