Tag Info

Hot answers tagged

22

The best way to do this is using screen, which keeps the session open in a persistent way even if the connection dies (and if you want to start using it again you can do a screen -r and it will open it up again). Prefixing whatever command you want to run with screen (eg. ssh -t user@host screen command) should do the job. If you want it to run in the ...


9

It's important to note that while some processes take CTRL+Z to mean background, the default behavior is STOP, which does not continue execution. The safest way is to run the command with an & at the end, then run "disown" to force it to the background completely. You will not be able to foreground it again, however. If you want an easy way to keep an ...


8

Answer found. For BASH, this depends on the huponexit shell option, which can be viewed and/or set using the built-in shopt command. Looks like this options is off by default, at least on RedHat-based systems. More info on the BASH man page: The shell exits by default upon receipt of a SIGHUP. Before exiting, an interactive shell resends the SIGHUP to ...


6

As mentioned early, screen can do all the trick. But not only what you need. I've use screen for the years and now use it every time I've login into systems. Try to install screen and create ~/.screenrc with such config: sessionname vcflists startup_message off deflogin off vbell off msgminwait 0 msgwait 10 log ...


4

The usual way is jobs. However, jobs doesn't see background processes which have been disowned, because they aren't attached to your shell any more. For those, you'll have to look at ps in some form or another, perhaps ps -u, depending.


3

If your process can source whichever of /etc/profile or /etc/bash.bashrc and their respective $HOME files, then this might work for you: screen -d -m bash --init-file background-shell-script When "background-shell-script" exits, the screen session will be sitting waiting for you at a shell prompt when you reattach with screen -r. If you reattach before ...


3

When you fork a process into the background it will still be the child process from the shell executing it. All child processes running under a shell are sent a SIGHUP upon exit. Performance varies slightly depending upon the exact situation, which is detailed verbosely in bash's manpage. Other shells likely have similar descriptions. Apache, and other ...


3

screen -L -dmS somename ruby app.rb This will start a screen process with the name of 'somename', with all output from the program being logged to screenlog.0 in the current working directory. If you ever want to get back the application's console for some reason, you can do screen -r somename.


2

Deploying a service is more than being able to get it up and running, it's being able to keep it up and running and being able to automate processes. Humans entering stuff via a web UI is not scalable; insufficient access to the hosting to be able to check crontab is a sign that automation as a whole will be difficult. The developer might be so good that ...


2

You can use the command nohup to launch the command and redirect output into a nohup output file. From the nohup man page: nohup - run a command immune to hangups, with output to a non-tty The other option is to use the screen command. The benefit of using screen is that you can reconnect to the process later.


2

Known issue, however this should have been resolved in SP1: The "Desktop Wallpaper" Group Policy setting is not applied in Windows 7 or in Windows Server 2008 R2 http://support.microsoft.com/kb/977944 https://blogs.technet.com/b/deploymentguys/archive/2009/11/20/windows-7-rtm-issue-with-group-policy-enforced-wallpaper.aspx


2

Yeah... I have been in this same situation. I ended up writing a Windows service that would check for disconnected sessions using the API exposed in wtsapi32.dll, and then for each disconnected session, if the process I wanted wasn't running in that session, I'd use that person's token (which I can steal without needing to know that person's password, the ...


1

Yes, cygwin has a very good ssh server for windows. First you should download and install this. After you can log into your windows machine with command line ssh, you can use ssh-keygen to make this passwordless and automatic. The third thing were to install python on your windows machine, which you can get from http://www.python.org/getit/windows/ . It ...


1

Hm. If you're lucky, the ScreenHeight and ScreenWidth properties of the Win32_DesktopMonitor WMI class will be filled out on the client, which means you can easily use a VB script or Powershell script to determine the computer's desktop resolution. Get-WMIObject Win32_DesktopMonitor Now that you know the computer's resolution, you can set the appropriate ...


1

Try perl, the Swiss Army Chainsaw. Here's me finding the PID that holds port 80 open, then listing all the children: [me@lory ~]$ sudo netstat -apn|grep -w 80|grep LISTEN tcp 0 0 :::80 :::* LISTEN 8308/httpd [me@lory ~]$ ps -ef|perl -n -e '@j=split / */; print "@j" if ( @j[2]==8308) ...


1

I would recommend running programs like scp in screen. The reason is that by putting the command in the background, it will dump output into your current terminal and you can't easily disconnect from an ssh session and reconnect to it in the middle of your job. Run screen. You'll get new terminal in front of you. Run your process. Now press "ctrl-a d" and ...


1

I have a severe opposition to allowing sudo level privilege escalation for your setup... Anywho: Toss 'sudo shutdown -h' into a script file. Then run at (scheduler) at -f /shutdown/script `date +%H:%M --date "now + 5 minutes"` Since you're using PHP it might make more sense to do the time calculation in PHP: $time = date('H:i', strtotime('+5 ...



Only top voted, non community-wiki answers of a minimum length are eligible