Improve init script
This commit is contained in:
parent
6bd5ca2e17
commit
ef264f503b
@ -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 7
|
%define openssh_rel 8
|
||||||
%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,6 +750,9 @@ exit 0
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jun 16 2011 Jan F. Chadima <jchadima@redhat.com> - 5.8p2-8 + 0.9.2-31
|
||||||
|
- 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
|
||||||
- Add possibility to compile openssh without downstream patches
|
- Add possibility to compile openssh without downstream patches
|
||||||
|
|
||||||
|
28
sshd.init
28
sshd.init
@ -142,13 +142,28 @@ start()
|
|||||||
|
|
||||||
stop()
|
stop()
|
||||||
{
|
{
|
||||||
|
|
||||||
echo -n $"Stopping $prog: "
|
echo -n $"Stopping $prog: "
|
||||||
if [ -n "`pidfileofproc $SSHD`" ] ; then
|
if [ ! -f "$PIDFILE" ]; then
|
||||||
killproc $SSHD
|
# not running; per LSB standards this is "ok"
|
||||||
else
|
action $"Stopping $prog: " /bin/true
|
||||||
failure $"Stopping $prog"
|
return 0
|
||||||
|
fi
|
||||||
|
PID=`cat "$PIDFILE"`
|
||||||
|
if [ -n "$PID" ]; then
|
||||||
|
/bin/kill "$PID" >/dev/null 2>&1
|
||||||
|
RETVAL=$?
|
||||||
|
if [ $RETVAL -eq 0 ]; then
|
||||||
|
RETVAL=1
|
||||||
|
action $"Stopping $prog: " /bin/false
|
||||||
|
else
|
||||||
|
action $"Stopping $prog: " /bin/true
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# failed to read pidfile
|
||||||
|
action $"Stopping $prog: " /bin/false
|
||||||
|
RETVAL=4
|
||||||
fi
|
fi
|
||||||
RETVAL=$?
|
|
||||||
# if we are in halt or reboot runlevel kill all running sessions
|
# if we are in halt or reboot runlevel kill all running sessions
|
||||||
# so the TCP connections are closed cleanly
|
# so the TCP connections are closed cleanly
|
||||||
if [ "x$runlevel" = x0 -o "x$runlevel" = x6 ] ; then
|
if [ "x$runlevel" = x0 -o "x$runlevel" = x6 ] ; then
|
||||||
@ -157,7 +172,8 @@ stop()
|
|||||||
trap TERM
|
trap TERM
|
||||||
fi
|
fi
|
||||||
[ $RETVAL -eq 0 ] && rm -f $lockfile
|
[ $RETVAL -eq 0 ] && rm -f $lockfile
|
||||||
echo
|
rm -f "$PIDFILE"
|
||||||
|
return $RETVAL
|
||||||
}
|
}
|
||||||
|
|
||||||
reload()
|
reload()
|
||||||
|
Loading…
Reference in New Issue
Block a user