diff options
author | David Wood <david@wood2.org.uk> | 2016-02-06 02:35:42 +0000 |
---|---|---|
committer | David Wood <david@wood2.org.uk> | 2016-02-06 02:35:42 +0000 |
commit | a99dc5218605387a6ed8bd387511aae7b848914e (patch) | |
tree | f25baee0b8c49ad1569d66ab728aa2c4631d4e09 /src/etc | |
parent | f54728df51ccb9fbffeb38b89f482f5a4269f7d5 (diff) | |
download | pfsense-a99dc5218605387a6ed8bd387511aae7b848914e.zip pfsense-a99dc5218605387a6ed8bd387511aae7b848914e.tar.gz |
Don't kill an sshd parent process on exit from /etc/rc.initial
This stops exiting a shell running in an SSH session from terminating the parent sshd process, which has the unwanted side effect of killing all other sessions running under that sshd process (including cloned shell sessions).
Diffstat (limited to 'src/etc')
-rwxr-xr-x | src/etc/rc.initial | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/etc/rc.initial b/src/etc/rc.initial index ae78375..572188f 100755 --- a/src/etc/rc.initial +++ b/src/etc/rc.initial @@ -171,7 +171,12 @@ case ${opmode} in fi ;; "") - kill $PPID ; exit + ps -o command='' -c -p $PPID | grep -E '^sshd$' > /dev/null + if [ $? -eq 0 ]; then + exit + else + kill $PPID ; exit + fi ;; esac |