spec file

Damien Miller djm at mindrot.org
Tue Mar 7 21:36:49 EST 2000


On Tue, 7 Mar 2000, Nigel Metheringham wrote:

> > Also, the %post stanza for the server package, starts sshd.  But what
> > if the upgrade is done in single user mode?  The sysV initscript does
> > not check if networking is up---it just seems to start the service no
> > matter what. 
> 
> I'm unhappy about this - its a complete pain if you are installing ssh 
> as part of your machine build.  You may also happen to be missing 
> decent entropy etc under these conditions.  I personally modify the 
> spec & init.d files to do the key generation within the start part of 
> the init.d file.  I guess if sshd *was* running then starting it again 
> is reasonable, otherwise do not start it.

RTFS:

%post server
/sbin/chkconfig --add sshd
if [ ! -f /etc/ssh/ssh_host_key -o ! -s /etc/ssh/ssh_host_key ]; then
        /usr/bin/ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N '' >&2
fi
if test -r /var/run/sshd.pid
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
then
        /etc/rc.d/init.d/sshd restart >&2
fi

-d

--
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm at mindrot.org (home) -or- djm at ibs.com.au (work)








More information about the openssh-unix-dev mailing list