background-process

exiting shell script with background processes

馋奶兔 提交于 2019-11-28 03:41:26
问题 I need somehow to exit my script.sh (with return code - would be the best) which runs some other commands and other scripts in the background. I've tried to run commands via nohup myInScript.sh & also I've tried to use at the end of script.sh disown -a[r] and also I've tried to kill it kill $$ but the script just hangs after last command and won't quit. How to force it to exit after running its commands? please help. edit: To be more specific, I'm running the script remotely via ssh on the

How to prevent a Hangfire recurring job from restarting after 30 minutes of continuous execution

喜欢而已 提交于 2019-11-28 03:31:43
问题 I am working on an asp.net mvc-5 web application, and I am facing a problem in using Hangfire tool to run long running background jobs. the problem is that if the job execution exceed 30 minutes, then hangfire will automatically initiate another job, so I will end up having two similar jobs running at the same time. Now I have the following:- Asp.net mvc-5 IIS-8 Hangfire 1.4.6 Windows server 2012 Now I have defined a hangfire recurring job to run at 17:00 each day. The background job mainly

Ruby on Rails: How to run things in the background?

僤鯓⒐⒋嵵緔 提交于 2019-11-28 03:16:14
When a new resource is created and it needs to do some lengthy processing before the resource is ready, how do I send that processing away into the background where it won't hold up the current request or other traffic to my web-app? in my model: class User < ActiveRecord::Base after_save :background_check protected def background_check # check through a list of 10000000000001 mil different # databases that takes approx one hour :) if( check_for_record_in_www( self.username ) ) # code that is run after the 1 hour process is finished. user.update_attribute( :has_record ) end end end ujh You

iOS - Can an app running in the background send touch / gesture events to another app in the foreground?

ⅰ亾dé卋堺 提交于 2019-11-28 02:12:52
问题 I have been asked to develop an app that will record and later "play back" touches and gestures onto another app running in the foreground. From my experience and knowledge, this is not possible unless both apps are setup to send/receive data between them through notifications or other methods. Also, it would be a huge risk for apps and their data to be exposed to anybody. I am 99% sure this is not possible, but was just curious if anyone else has come across something similar (or

AudioPlayerAgent, timer and webservice

陌路散爱 提交于 2019-11-28 01:32:22
my application read a shoutcast. The meta data of the music played is collected from a webservice that return me a Json (so i don't have to decode the stream). I call the webservice every 20 seconds with a timer, this works in my application, but doesn't works in the AudioPlayer.cs //Timer private DispatcherTimer timer; /// <remarks> /// AudioPlayer instances can share the same process. /// Static fields can be used to share state between AudioPlayer instances /// or to communicate with the Audio Streaming agent. /// </remarks> public AudioPlayer() { if (!_classInitialized) { _classInitialized

AudioQueueStart fail -12985

自古美人都是妖i 提交于 2019-11-28 00:29:57
问题 I made a streaming music player and it works fine in the foreground. But in the background iOS4, it doesn't play the next song automatically. ( remote control works ) The reason is AudioQueueStart return -12985 . I already check the audio session. it just fine. I use AudioQueueStart when it start to play the music. How can you remove AudioQueueStart ? - (void)play { [self setupAudioQueueBuffers]; // calcluate the size to use for each audio queue buffer, and calculate the // number of packets

What happens to an AsyncTask when the launching activity is stopped/destroyed while it is still running?

ぐ巨炮叔叔 提交于 2019-11-27 21:47:50
问题 I've seen few questions nearly identical to mine, but I couldn't find a complete answer that satisfies all my doubts.. so here I am.. Suppose that you have an activity with an inner class that extends the AsyncTask class like this: public class MyActivity extends Activity { private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> { protected Bitmap doInBackground(String... urls) { return DownloadImage(urls[0]); } protected void onPostExecute(Bitmap result) { ImageView img =

How to launch and run external script in background? [duplicate]

淺唱寂寞╮ 提交于 2019-11-27 20:59:42
问题 This question already has answers here : How to start a background process in Python? (7 answers) Closed 6 years ago . I tried these two methods: os.system("python test.py") subprocess.Popen("python test.py", shell=True) Both approaches need to wait until test.py finishes which blocks main process. I know "nohup" can do the job. Is there a Python way to launch test.py or any other shell scripts and leave it running in background? Suppose test.py is like this: for i in range(0, 1000000): print

Simple approach to launching background task in Django

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 20:29:29
I have a Django website, and one page has a button (or link) that when clicked will launch a somewhat long running task. Obviously I want to launch this task as a background task and immediately return a result to the user. I want to implement this using a simple approach that will not require me to install and learn a whole new messaging architecture like Celery for example. I do not want to use Celery! I just want to use a simple approach that I can set up and get running over the next half hour or so. Isn't there a simple way to do this in Django without having to add (yet another) 3rd

WP7 Invalid cross-thread access - ScheduledTaskAgent

和自甴很熟 提交于 2019-11-27 20:14:49
In WP7 app I am calling some code to update a live tile from the onInvoke method on the ScheduledAgent class. Getting an invalid cross-thread error. The line it is failing on is var fontForeground = new SolidColorBrush(Colors.White); I understand that there are limitations ans API's that I cannot call from within this background task, but I am only trying to setup some stuff to generate my own image to display on the Live tile. Is there something obvious I am doing wrong here. thanks Update... I have discovered this question How can I render text on a WriteableBitmap on a background thread, in