General :: Shutting Down PC Without Killing SSH Sessions?
Aug 10, 2010
I have some heavy, long processes running on remote Linux machines. I use my laptop to SSH to these machine and run the processes from my couch.
BUT, when I want to shutdown my laptop, I am in trouble since the remote processes are killed.
I did my research and found out that "screen" is a great solution for me, it is! (As long as I don't SHUTDOWN my laptop). Isn't there a way to "persist" the "screen" sessions so I can shut it down and then re-attach to a session?
I want to kill parent process after "fork()" method. but if I kill parent process with "exit(0)" method, main() thread is terminated as well so child prosess doesn't work anymore. Is there any way to kill only parent process without affecting to child process?
I want to capture PID of a program and kill it using the PID if the program is been executing beyond 5 seconds.The problem I'm facing is I have another copy of the same program running under different shell script, and the above code is killing both the process. How do I specifically kill the program which has started under the current running shell script.
I install the antivirus, ClamAV, onto a RedHat 4.8 box (yes it has to be that release of the OS to work with my other software needs) and after the install and giving the permissions to another user/group dedicated to this AV I get a ton of errors. After the install a few things pop up after a restart/logout. When trying to log back in the Gnome environment crashes so you cannot access any acct aside from using the text based environment. Two other error windows appear as well, one mentioning Bonobo has died and the other saying that Nautilus cannot be started due to Bonobo. I'm not too familiar with Bonobo can anyone fill me in on why those errors occured?
user@host$ killall -9 -u user Will it definitely kill all processes owned by user (including forkbombs)?
No new processes is spawned to user from other users. No user's processes are in D-sleep and unkillable.No processes are trying to detect and ptrace or terminate this started killall (but they can ptrace or do other things with each other) There is ulimit that prevents too much processes (but killall is already started and allocated it's memory)
E.g. if killall will finish untampered and successfully is it 100% that no processes are left with this uid? If no, how to do it properly (with standard commands and no root access). Will SysRq+I definitely kill all things (even replicating)?
I was looking into a shell script which had a line "kill -0 [pid]" , I would like to know what the -0 flag does as i found it is not killing the particular [pid] process.
Possible Duplicate: Leave bash script running on remote terminal while not logged in? I run a program, say ./a.out 10 from the shell prompt. Assume that there's a while(1) inside the program being run. Now if I try to close the shell, it warns me that it'll kill my running program too! So, how to kill the shell and still let my program continue running in the background?
I tried exec ./a.out 10 but the shell is still there. Another alternative is to simply double click my executable but then how will I pass command line parameters?
ok well i installed Ubuntu 10.10 like 2 weeks ago on my computer and I have Spent like A week and a half trying to shut down the X Server. I am trying to install an nvidia driver to my computer... all of the option and ways to do it would be helpfull... any more information needed i will give to you (NVIDIA-Linux-x86-260.19.44.run)
I am on an Aspire 5315 and i have Backtrack 5,32bit,Gnome (ubuntu)installed with Vista as a dual boot on hdd.I am currently having problem with my laptop overheating and shutting down. In Vista the software Epower controls the fan but in linux I have to install acer_fancontrol and I have installed it as per instructions. It works fine till i reboot and then i get a frozen screen with the BT5 background and in terminal i get 1gear and goes on till 3rdgear without me being able to use BT5.
I'm using Gnome 2.30.2 with Ubuntu 10.4 would like to shut down X Windows properly. Using sudo init 3 from console 1 or a terminal on the Gnome desktop results nothing. There are a bunch of ways of doing accomplishing this that I've seen, but the most recommended methods each cause the same errors. The methods that I've used are sudo service gdm stop, sudo stop gdm && sudo pkill X, and sudo /etc/init.d/gdm stop. After these commands are run I receive the following message: gdm stop/waiting.
Then I switch to console 7 & notice that the screen is frozen & has the following information:
There is a blinking cursor below this message & the terminal does not respond to any command including Ctrl z.
These are the same messages that are normally quickly displayed when linux normally boots.
I disabled the battery power option in & removed other unnecessary startup processes from System, Preferences, Startup Applications. I've tried running the gdm stop commands from terminals 1 & 2 as well as consoles in X Windows & it produces the same results. For some reason though, the gdm commands do work when I used the restart option.
When I shut down my computer I want to show some pending tasks that I have to do before leaving the office...
I did a local application to manage those tasks, so basically I just want to run a command, and shut down after I kill the app executed.
I have already tried with these options:
/etc/gdm/PostSession/Default --> this works only when I select LogOut option instead Shutdown. /etc/rc0.d/K01mycustomscript --> execute script after X is killed $HOME/.bash_logout --> This looks like does nothing. ./app-to-run && sudo shutdown -h now --> Don't like it for 2 reasons, prompts for sudo password, and can't use my laptop shutdown button.
I dual boot Ubuntu and Windows and sometimes I just want to switch between the partitions without loosing the state of the OS I was currently working with. Currently to do that I just hibernate that OS and, when the computer turns off, I restart it and select the correct partition.
I do not really want to have to press the on button again every time I want to switch between partitions. I figure that there must be a way to make the hibernate action restart instead of shutting down.
How do I make the hibernate action restart instead of shutting down on:
Windows, or Ubuntu
P.S. It is more important to me that I can do this in Ubuntu than Windows (because of the way I use the partitions) therefore if one answer says the Ubuntu way and the other says the Windows way then I will mark the Ubuntu one as the answer and give the Windows one an upvote and a big thankyou.
I am accessing a linux server remotely from my putty. I started the server and now I want to close the command line. when I do cntr+c or cntr+z it kills my server aswell. how will I close my terminal without closing my server? I tried cntr +d but it is not doing anything
Im running a Squid with transparent Dansguardian. It seems i cant shut down Dansguardian or else i will get an error message from firefox telling me it cant establish a connection with the proxy server.
Usually we require vnc to take remote sessions. There was one another i think it was called xdrp or xrdp. I am asking this out of curiosity, is there any way to take remote sessions using http. Like in web conferencing, we invite users to join the conference and then we are able to share desktop. Is there any way to do this on one-to-one basis ? is such a technology exists for linux (for any disto) ?
I have just installed Ubuntu 10.04 and it works fine. Next, I attempted to install Apache 2.2.16 server on the machine. I was able to get Apache installed but I cant't get it to start. The command I used to get it to start is "apachectl -k start" and got the response "command not found". Then I used the absolute path which is "/home/Administrator/Downloads/apache/bin/apachectl -k start" and got the response"httpd: could not reliably determine ther server's fully qualified domain name, using 127.0.1.1 for ServerName(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80.no listening to sockets available, shutting down". Please advise me on what to do. My eyes hurt from looking at the screen for so long trying different options and reading almost all the apache install instructions that exists. Just ready to have it up and running.
I am no longer working on the Linux-machine directly, but I'm using Windows puTTY to get a terminal-session. Within that puTTY window I want to switch (or maybe create first) several sessions between which I can switch arbitrarily. I have read about using Ctrl-Alt-Fn, which doesn't work, most likely due to the puTTY interface. I have tried chvt n, which doesn't do anything either (or that it seems). I have tried "bash &" and got bash in the background, which I could call forth using fg, but then had to stay with that and couldn't switch anywhere. Only option was "exit". So, what's the correct way to get several sessions in that puTTY window and switch between them?
If I ssh to a remote machine and then lose internet connectivity, the session freezes. I can't control-c or otherwise abort and go back to my local xterm or terminal prompt but if I wait several minutes it will do so. There must be some way to force it to abort the remote ssh session when connectivity is lost. I'm on a Mac but I believe this happens on cygwin or linux as well.
Firstly, what's the best way to execute commands on startup, cron? Can I use su in a shell script to switch between different users, if so how?
How do I create several detached screen sessions on startup? screen -A -m -d -S test ./script.sh seems like it should work but using it in a script started by cron doesn't show any screen sessions running after booting.
It looks like the screen session is closed after the command finishes executing, can I keep it open so I can see the output?
I'm running Slackware 13 - xfce4 and I got a new session in background. How could I see that session and use it? In backtrack I'm doing it via sessions in terminal but im Slackware 13 session command doesn't exist.