Improve init script
This commit is contained in:
parent
ef264f503b
commit
d3542d5be8
@ -82,7 +82,7 @@
|
|||||||
|
|
||||||
# Do not forget to bump pam_ssh_agent_auth release if you rewind the main package release to 1
|
# Do not forget to bump pam_ssh_agent_auth release if you rewind the main package release to 1
|
||||||
%define openssh_ver 5.8p2
|
%define openssh_ver 5.8p2
|
||||||
%define openssh_rel 8
|
%define openssh_rel 9
|
||||||
%define pam_ssh_agent_ver 0.9.2
|
%define pam_ssh_agent_ver 0.9.2
|
||||||
%define pam_ssh_agent_rel 31
|
%define pam_ssh_agent_rel 31
|
||||||
|
|
||||||
@ -750,7 +750,7 @@ exit 0
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Jun 16 2011 Jan F. Chadima <jchadima@redhat.com> - 5.8p2-8 + 0.9.2-31
|
* Mon Jun 20 2011 Jan F. Chadima <jchadima@redhat.com> - 5.8p2-9 + 0.9.2-31
|
||||||
- Improve init script
|
- Improve init script
|
||||||
|
|
||||||
* Thu Jun 16 2011 Jan F. Chadima <jchadima@redhat.com> - 5.8p2-7 + 0.9.2-31
|
* Thu Jun 16 2011 Jan F. Chadima <jchadima@redhat.com> - 5.8p2-7 + 0.9.2-31
|
||||||
|
10
sshd.init
10
sshd.init
@ -42,7 +42,8 @@ SSHD=/usr/sbin/sshd
|
|||||||
RSA1_KEY=/etc/ssh/ssh_host_key
|
RSA1_KEY=/etc/ssh/ssh_host_key
|
||||||
RSA_KEY=/etc/ssh/ssh_host_rsa_key
|
RSA_KEY=/etc/ssh/ssh_host_rsa_key
|
||||||
DSA_KEY=/etc/ssh/ssh_host_dsa_key
|
DSA_KEY=/etc/ssh/ssh_host_dsa_key
|
||||||
PID_FILE=/var/run/sshd.pid
|
XPID_FILE=/var/run/sshd.pid
|
||||||
|
PID_FILE=/var/run/sshd-s.pid
|
||||||
|
|
||||||
runlevel=$(set -- $(runlevel); eval "echo \$$#" )
|
runlevel=$(set -- $(runlevel); eval "echo \$$#" )
|
||||||
|
|
||||||
@ -136,6 +137,7 @@ start()
|
|||||||
$SSHD $OPTIONS && success || failure
|
$SSHD $OPTIONS && success || failure
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
[ $RETVAL -eq 0 ] && touch $lockfile
|
[ $RETVAL -eq 0 ] && touch $lockfile
|
||||||
|
[ $RETVAL -eq 0 ] && cp -f $XPID_FILE $PID_FILE
|
||||||
echo
|
echo
|
||||||
return $RETVAL
|
return $RETVAL
|
||||||
}
|
}
|
||||||
@ -144,12 +146,12 @@ stop()
|
|||||||
{
|
{
|
||||||
|
|
||||||
echo -n $"Stopping $prog: "
|
echo -n $"Stopping $prog: "
|
||||||
if [ ! -f "$PIDFILE" ]; then
|
if [ ! -f "$PID_FILE" ]; then
|
||||||
# not running; per LSB standards this is "ok"
|
# not running; per LSB standards this is "ok"
|
||||||
action $"Stopping $prog: " /bin/true
|
action $"Stopping $prog: " /bin/true
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
PID=`cat "$PIDFILE"`
|
PID=`cat "$PID_FILE"`
|
||||||
if [ -n "$PID" ]; then
|
if [ -n "$PID" ]; then
|
||||||
/bin/kill "$PID" >/dev/null 2>&1
|
/bin/kill "$PID" >/dev/null 2>&1
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
@ -172,7 +174,7 @@ stop()
|
|||||||
trap TERM
|
trap TERM
|
||||||
fi
|
fi
|
||||||
[ $RETVAL -eq 0 ] && rm -f $lockfile
|
[ $RETVAL -eq 0 ] && rm -f $lockfile
|
||||||
rm -f "$PIDFILE"
|
rm -f "$PID_FILE"
|
||||||
return $RETVAL
|
return $RETVAL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user