mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-24 22:35:39 +02:00
- (bal) Fixed up init.d symlink issue and piddir stuff. Patches by
Zoran Milojevic <Zoran.Milojevic@SS8.com> and j.petersen@msh.de
This commit is contained in:
parent
368211ee47
commit
f2366b5a7d
@ -1,3 +1,7 @@
|
|||||||
|
20011019
|
||||||
|
- (bal) Fixed up init.d symlink issue and piddir stuff. Patches by
|
||||||
|
Zoran Milojevic <Zoran.Milojevic@SS8.com> and j.petersen@msh.de
|
||||||
|
|
||||||
20011012
|
20011012
|
||||||
- (djm) OpenBSD CVS Sync
|
- (djm) OpenBSD CVS Sync
|
||||||
- markus@cvs.openbsd.org 2001/10/10 22:18:47
|
- markus@cvs.openbsd.org 2001/10/10 22:18:47
|
||||||
@ -6721,4 +6725,4 @@
|
|||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1608 2001/10/12 21:52:39 mouring Exp $
|
$Id: ChangeLog,v 1.1609 2001/10/19 20:36:23 mouring Exp $
|
||||||
|
@ -24,6 +24,7 @@ make install-nokeys DESTDIR=$FAKE_ROOT
|
|||||||
## Fill in some details, like prefix and sysconfdir
|
## Fill in some details, like prefix and sysconfdir
|
||||||
ETCDIR=`grep "^sysconfdir=" Makefile | sed 's/sysconfdir=//'`
|
ETCDIR=`grep "^sysconfdir=" Makefile | sed 's/sysconfdir=//'`
|
||||||
PREFIX=`grep "^prefix=" Makefile | cut -d = -f 2`
|
PREFIX=`grep "^prefix=" Makefile | cut -d = -f 2`
|
||||||
|
PIDDIR=`grep "^piddir=" Makefile | cut -d = -f 2`
|
||||||
cd $FAKE_ROOT
|
cd $FAKE_ROOT
|
||||||
|
|
||||||
## Setup our run level stuff while we are at it.
|
## Setup our run level stuff while we are at it.
|
||||||
@ -37,12 +38,14 @@ mkdir -p $FAKE_ROOT/etc/rc2.d
|
|||||||
## setup our initscript correctly
|
## setup our initscript correctly
|
||||||
sed -e "s#%%configDir%%#$ETCDIR#g" \
|
sed -e "s#%%configDir%%#$ETCDIR#g" \
|
||||||
-e "s#%%openSSHDir%%#$PREFIX#g" \
|
-e "s#%%openSSHDir%%#$PREFIX#g" \
|
||||||
|
-e "s#%%pidDir%%#$PIDDIR#g" \
|
||||||
../opensshd.in > $FAKE_ROOT/etc/init.d/opensshd
|
../opensshd.in > $FAKE_ROOT/etc/init.d/opensshd
|
||||||
chmod 711 $FAKE_ROOT/etc/init.d/opensshd
|
chmod 711 $FAKE_ROOT/etc/init.d/opensshd
|
||||||
|
|
||||||
ln -s $FAKE_ROOT/etc/init.d/opensshd $FAKE_ROOT/etc/rcS.d/K30opensshd
|
ln -s ../init.d/opensshd $FAKE_ROOT/etc/rcS.d/K30opensshd
|
||||||
ln -s $FAKE_ROOT/etc/init.d/opensshd $FAKE_ROOT/etc/rc1.d/K30opensshd
|
ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc0.d/K30opensshd
|
||||||
ln -s $FAKE_ROOT/etc/init.d/opensshd $FAKE_ROOT/etc/rc2.d/S98opensshd
|
ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc1.d/K30opensshd
|
||||||
|
ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc2.d/S98opensshd
|
||||||
|
|
||||||
|
|
||||||
## Ok, this is outright wrong, but it will work. I'm tired of pkgmk
|
## Ok, this is outright wrong, but it will work. I'm tired of pkgmk
|
||||||
|
@ -5,14 +5,16 @@
|
|||||||
|
|
||||||
AWK=/usr/bin/awk
|
AWK=/usr/bin/awk
|
||||||
CAT=/usr/bin/cat
|
CAT=/usr/bin/cat
|
||||||
EGREP=/usr/bin/egrep
|
|
||||||
KILL=/usr/bin/kill
|
KILL=/usr/bin/kill
|
||||||
PS=/usr/bin/ps
|
PS=/usr/bin/ps
|
||||||
|
XARGS=/usr/bin/xargs
|
||||||
|
|
||||||
prefix=%%openSSHDir%%
|
prefix=%%openSSHDir%%
|
||||||
etcdir=%%configDir%%
|
etcdir=%%configDir%%
|
||||||
|
piddir=%%pidDir%%
|
||||||
|
|
||||||
SSHD=$prefix/sbin/sshd
|
SSHD=$prefix/sbin/sshd
|
||||||
|
PIDFILE=$piddir/sshd.pid
|
||||||
SSH_KEYGEN=$prefix/bin/ssh-keygen
|
SSH_KEYGEN=$prefix/bin/ssh-keygen
|
||||||
HOST_KEY_RSA1=$etcdir/ssh_host_key
|
HOST_KEY_RSA1=$etcdir/ssh_host_key
|
||||||
HOST_KEY_DSA=$etcdir/ssh_host_dsa_key
|
HOST_KEY_DSA=$etcdir/ssh_host_dsa_key
|
||||||
@ -21,28 +23,28 @@ HOST_KEY_RSA=$etcdir/ssh_host_rsa_key
|
|||||||
killproc() {
|
killproc() {
|
||||||
_procname=$1
|
_procname=$1
|
||||||
_signal=$2
|
_signal=$2
|
||||||
${PGREP} ${_procname} | ${HEAD} -1 | ${XARGS} -t -I {} ${KILL} -${_signal} {}
|
${PS} -u root | ${AWK} '/'"$_procname"'$/ {print $1}' | ${XARGS} ${KILL}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
checkkeys() {
|
checkkeys() {
|
||||||
if [ ! -f $HOST_KEY_RSA1 ]; then
|
if [ ! -f $HOST_KEY_RSA1 ]; then
|
||||||
$SSH_KEYGEN -t rsa1 -f $HOST_KEY_RSA1 -N ""
|
${SSH_KEYGEN} -t rsa1 -f ${HOST_KEY_RSA1} -N ""
|
||||||
fi
|
fi
|
||||||
if [ ! -f $HOST_KEY_DSA ]; then
|
if [ ! -f $HOST_KEY_DSA ]; then
|
||||||
$SSH_KEYGEN -t dsa -f $HOST_KEY_DSA -N ""
|
${SSH_KEYGEN} -t dsa -f ${HOST_KEY_DSA} -N ""
|
||||||
fi
|
fi
|
||||||
if [ ! -f $HOST_KEY_RSA ]; then
|
if [ ! -f $HOST_KEY_RSA ]; then
|
||||||
$SSH_KEYGEN -t rsa -f $HOST_KEY_RSA -N ""
|
${SSH_KEYGEN} -t rsa -f ${HOST_KEY_RSA} -N ""
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_service() {
|
stop_service() {
|
||||||
if [ -r $PIDFILE -a ! -z ${PIDFILE} ]; then
|
if [ -r $PIDFILE -a ! -z ${PIDFILE} ]; then
|
||||||
PID=`cat ${PIDFILE}`
|
PID=`${CAT} ${PIDFILE}`
|
||||||
fi
|
fi
|
||||||
if [ ${PID:=0} -gt 1 -a ! "X$PID" = "X " ]; then
|
if [ ${PID:=0} -gt 1 -a ! "X$PID" = "X " ]; then
|
||||||
$KILL $PID
|
${KILL} ${PID}
|
||||||
else
|
else
|
||||||
echo "Unable to read PID file, killing using alternate method"
|
echo "Unable to read PID file, killing using alternate method"
|
||||||
killproc sshd TERM
|
killproc sshd TERM
|
||||||
|
Loading…
x
Reference in New Issue
Block a user