You are not logged in.
First the why:
OpenSSH on Debian automatically logs out users when you reboot or halt the server over SSH. This is rather nice, as it frees the terminal you ran ssh in for other jobs, instead of just waiting for respond from the server that has gone down.
How they did it I don't know, I have been unable to find any hints on it anyway.
Anyway, OpenSSH on Arch does not act this friendly and a Debian client hang for about 20 min before giving up. Debian's fault I think as an Arch client gives up long before that. Well you don't get it all with Debian...
Then the how:
After searching for a solution I ran into 'skill' that shout do the trick with this string:
# skill -KILL -v pts/*
However, it didn't work...
I could logout each user on his own with:
# skill -KILL -u [user]
But not very helpful either as a solution.
But remembering some sniplet I found on this forum for searching the license-string in installed packages, I made it find the users logged into the system with 'who' and throw them out:
who | cut -d " " -f1 | uniq | xargs skill -KILL -u
If you add this to /etc/rc.local.shutdown it will logout all users before the system goes down due to reboot or halt.
It works quite well on a desktop-system too...
I hope someone finds this helpful.
C
Offline
Thanks CBJ!
This is still working in 11/11 8-)
I added it to the "Tips and Tricks" section of the SSH wiki page: https://wiki.archlinux.org/index.php/Se … s_shutdown
Offline
Maybe you can do
users | xargs skill -KILL -u
or something like this.
[karol@black ~]$ who
test2 tty2 2011-11-18 19:38
karol tty1 2011-11-16 23:34
[karol@black ~]$ who | cut -d " " -f1
test2
karol
[karol@black ~]$ users
karol test2
Offline
These tools are probably obsolete and unportable. The command syntax is poorly defined. Consider using the killall, pkill, and pgrep commands instead.
pkill -KILL -u
updated wiki for you
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
man skill wrote:These tools are probably obsolete and unportable. The command syntax is poorly defined. Consider using the killall, pkill, and pgrep commands instead.
pkill -KILL -u
updated wiki for you
Does it work for you? It does not work for me:
[karol@black ~]$ users
karol test1 test2
[karol@black ~]$ sudo pkill -KILL -u test1 test2
[karol@black ~]$ users
karol test1 test2
[karol@black ~]$ sudo skill -KILL -u test1 test2
[karol@black ~]$ users
karol
Offline
What happens when you do pkill -KILL -u test1 ?
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
What happens when you do pkill -KILL -u test1 ?
It works, but I'm wondering why specifying multiple users does not.
[karol@black ~]$ users
karol test1
[karol@black ~]$ sudo pkill -KILL -u test1
[karol@black ~]$ users
karol
Offline
Who says it does not?
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
solution is to add in rc.conf NETWORK_PERSIST="yes". the idea is that networking is stopped and it doesn't kill the ssh connections and instead clients will timeout.
Give what you have. To someone, it may be better than you dare to think.
Offline
:confused:
Is wondering implying that one does NOT need this tweak in /etc/rc.local.shutdown if one sets the NETWORK_PERSIST="yes" in /etc/rc.conf?
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
exactly
Give what you have. To someone, it may be better than you dare to think.
Offline
Thanks wonder. I'll edit the wiki page but is there a reason why this isn't an Arch default?
Last edited by graysky (2011-11-19 11:50:18)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline