Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
5
votes
4
answers
4127
views
How to attach a listener to sysfs files?
How to watch for `sysfs` file changes (like `/sys/class/net/eth0/statistics/operstate`) and execute a command on content change? - `inotify` does not work on `sysfs` - I don't want to poll. I want to set a listener with a callback routine once
How to watch for
sysfs
file changes (like /sys/class/net/eth0/statistics/operstate
) and execute a command on content change?
- inotify
does not work on sysfs
- I don't want to poll. I want to set a listener with a callback routine once
Zeta.Investigator
(1190 rep)
Jul 2, 2021, 01:10 PM
• Last activity: Mar 14, 2025, 12:16 PM
1
votes
1
answers
96
views
Open v4l2loopback device with O_NONBLOCK
I'm writing a python library called [linuxpy](https://github.com/tiagocoutinho/linuxpy) which supports V4L2. One of the features is being able to open de V4L2 device in non blocking mode (`O_NONBLOCK`) to be cooperative with python `async`/`await`. I tried with several real cameras and everything se...
I'm writing a python library called [linuxpy](https://github.com/tiagocoutinho/linuxpy) which supports V4L2.
One of the features is being able to open de V4L2 device in non blocking mode (
O_NONBLOCK
) to be cooperative with python async
/await
.
I tried with several real cameras and everything seems to work properly.
But when I test v4l2loopback device it blocks waiting for the first frame if I open the v4l2loopback device with O_NONBLOCK
.
Does anyone know if v4l2loopback supports O_NONBLOCK
?
Tiago Coutinho
(111 rep)
Jul 9, 2024, 04:01 PM
• Last activity: Nov 11, 2024, 12:13 AM
208
votes
8
answers
113505
views
Can I watch the progress of a `sync` operation?
I've copied a large file to a USB disk mounted on a Linux system with async. This returns to a command prompt relatively quickly, but when I type `sync`, of course, it all has to go to disk, and that takes a long time. I understand that it's going to be slow, but is there somewhere where I can watch...
I've copied a large file to a USB disk mounted on a Linux system with async. This returns to a command prompt relatively quickly, but when I type
sync
, of course, it all has to go to disk, and that takes a long time.
I understand that it's going to be slow, but is there somewhere where I can watch a counter go down to zero? Watching buffers
in top
doesn't help.
mattdm
(41207 rep)
Sep 15, 2012, 02:09 AM
• Last activity: Feb 23, 2024, 12:40 PM
0
votes
1
answers
125
views
how to get file descriptors of PTY inside of a child?
https://man7.org/linux/man-pages/man7/pty.7.html in the "UNIX 98 pseudoterminals" it is said that `ptsname` can be used (and then `open`), but this function accepts file descriptor. i tried to put 0 (STDIN) and 1 (STDOUT) in there, but it fails with "Inappropriate ioctl for device". im running my pr...
https://man7.org/linux/man-pages/man7/pty.7.html
in the "UNIX 98 pseudoterminals" it is said that
ptsname
can be used (and then open
), but this function accepts file descriptor. i tried to put 0 (STDIN) and 1 (STDOUT) in there, but it fails with "Inappropriate ioctl for device". im running my program from gnome-terminal
im not writing another xterm
program. just want to have file descriptors for asynchronous (non-blocking) non-canonical low-level input and output.
Michael Quad
(103 rep)
Feb 16, 2024, 01:55 AM
• Last activity: Feb 19, 2024, 06:17 PM
1
votes
1
answers
140
views
how to install brew forumlae simultaneously?
I tried this, I'll keep the list short: ```bash IFS=$'\n' pkgs=( go gcc make node ) installPkgs() { brew install $1 } export -f installPkgs parallel -j 0 installPkgs ::: ${pkgs[@]} ``` This didn't work as when I typed `node` I got 'command not found'. I know you can do: ``` brew install \ go \ gcc \...
I tried this, I'll keep the list short:
IFS=$'\n'
pkgs=(
go
gcc
make
node
)
installPkgs() {
brew install $1
}
export -f installPkgs
parallel -j 0 installPkgs ::: ${pkgs[@]}
This didn't work as when I typed node
I got 'command not found'.
I know you can do:
brew install \
go \
gcc \
make \
node
But this a sequential install, is it possible to do a simultaneous or async install?
Nickotine
(554 rep)
Dec 10, 2023, 08:00 PM
• Last activity: Dec 11, 2023, 08:27 AM
1
votes
1
answers
11330
views
Curl returning with no response and does not wait for `wait=x seconds`
I call an async service that takes ~80 seconds to respond. I run: ``` curl -v -X POST https://hostname.com/service/v2/predict \ -H 'x-api-key: somekey' \ -H 'x-request-id: longfiles' \ -H "Authorization: Bearer dfv651df8fdvd" \ -H 'Prefer: respond-async, wait=200' \ -F 'contentAnalyzerRequests={"inp...
I call an async service that takes ~80 seconds to respond. I run:
curl -v -X POST https://hostname.com/service/v2/predict \
-H 'x-api-key: somekey' \
-H 'x-request-id: longfiles' \
-H "Authorization: Bearer dfv651df8fdvd" \
-H 'Prefer: respond-async, wait=200' \
-F 'contentAnalyzerRequests={"inputtest": "this is a test"}
-F infile=@/mnt/file/stream-01865caa-b2e0-40e4-b298-1502fcc65045.json
The command specifies wait=200
but curl returns in ~60 seconds. And since the service takes ~80 seconds to respond, I get no response (but I do get a response if I use wait=1000
). Why?
---
Output of the curl query with -v
:
> Prefer: respond-async, wait=200
> Content-Length: 19271573
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------5873f0b92dd68547
>
< HTTP/1.1 100 Continue
< HTTP/1.1 202 Accepted
< Server: openresty
< Date: Fri, 07 Oct 2022 21:55:33 GMT
< Content-Length: 0
< Connection: keep-alive
< x-request-id: longfiles
< vary: Origin,Access-Control-Request-Method,Access-Control-Request-Headers
< location: https://hostname.com/service/v2/status/longfiles
< retry-after: 1
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: Authorization,Content-Type,X-Api-Key,User-Agent,If-Modified-Since,Prefer,location,x-transaction-id,retry-after,cache-control
< Access-Control-Allow-Methods: GET, POST, PUT ,DELETE, OPTIONS,PATCH
< Access-Control-Expose-Headers: location, retry-after, x-request-id, x-transaction-id, cache-control
< Access-Control-Max-Age: 86400
<
* Connection #0 to host hostname.com left intact
Franck Dernoncourt
(5533 rep)
Oct 7, 2022, 09:25 PM
• Last activity: Oct 10, 2022, 08:26 AM
0
votes
1
answers
94
views
Asynchronous downloading from virtual machine?
I have some files stored on a virtual machine that I'm downloading onto my PC. There are approximately 1 million files and I have been using the following command: ``` scp vm_user@IP:/home/vm_user/path_to_files /Users/documents ``` As you can imagine, this is slow as it downloads the files one by on...
I have some files stored on a virtual machine that I'm downloading onto my PC. There are approximately 1 million files and I have been using the following command:
scp vm_user@IP:/home/vm_user/path_to_files /Users/documents
As you can imagine, this is slow as it downloads the files one by one. Are there quicker alternatives that can download the files asynchronously or apply concurrency to the downloads to increase download speed?
dollar bill
(111 rep)
Feb 24, 2022, 09:58 AM
• Last activity: Feb 24, 2022, 11:03 AM
3
votes
2
answers
1731
views
Stopping an asynchronous while loop in a shell script
I have a asynchronous while loop that restarts processes until some condition is met. This look something like this: (while [ "$check_condition" -eq 1 ]; do ./async_command done) & ... # do some stuff check_condition=0 pkill -9 async_command As you can see, I change `check_condition` to 0 and kill t...
I have a asynchronous while loop that restarts processes until some condition is met. This look something like this:
(while [ "$check_condition" -eq 1 ]; do
./async_command
done) &
... # do some stuff
check_condition=0
pkill -9 async_command
As you can see, I change
check_condition
to 0 and kill the async process that is still running. The problem is, that the while loop still fires and the process is restarted.
I'm guessing that the loop only registers the value of check_condition
once it starts and doesn't notice any changes.
How can I fix this?
N. Krh
(33 rep)
Mar 18, 2021, 08:58 AM
• Last activity: Mar 18, 2021, 11:34 AM
4
votes
1
answers
631
views
Why does io_uring have a layer of indirection for the submission queue?
From the [paper on io_uring](https://kernel.dk/io_uring.pdf), the submission ring contains indices into a submission array, where the submission event itself is stored. The documentation explains this layer of indirection as follows: > One important difference is that while the CQ ring is directly i...
From the [paper on io_uring](https://kernel.dk/io_uring.pdf) , the submission ring contains indices into a submission array, where the submission event itself is stored. The documentation explains this layer of indirection as follows:
> One important difference is that while the CQ ring is directly indexing the shared array
of cqes, the submission side has an indirection array between them. Hence the submission side ring buffer is an index
into this array, which in turn contains the index into the sqes. This might initially seem odd and confusing, but there's
some reasoning behind it. Some applications may embed request units inside internal data structures, and this allows
them the flexibility to do so while retaining the ability to submit multiple sqes in one operation. That in turns allows for
easier conversion of said applications to the io_uring interface.
But I'm not following what is meant by "applications may embed request units inside internal data structures", nor do I follow the intuition about what the layer of indirection therefore enables.
Can someone explain in other words what this layer of indirection benefits?
perpetual_check
(211 rep)
Oct 20, 2020, 05:33 PM
• Last activity: Oct 23, 2020, 04:49 PM
4
votes
1
answers
735
views
How to set interval for an asynchronous command in bash?
I'm trying to achieve this ``` while condition; do var=value1 ### update value every 5s while sleep 5; do var=value2 done ### ... [ rest of code ] done ``` The problem here is that the script will always enter the loop and block the rest of the code
I'm trying to achieve this
while condition; do
var=value1
### update value every 5s
while sleep 5; do
var=value2
done
###
...
[ rest of code ]
done
The problem here is that the script will always enter the loop and block the rest of the code
Belka h.j
(55 rep)
May 2, 2020, 04:09 PM
• Last activity: May 5, 2020, 12:03 PM
4
votes
1
answers
2372
views
To sync or not to sync in an embedded environment?
I have a single board appliance that runs Debian 10 on a chunk of flash. UBIFS is used, and is split into two volumes: an ro roots, and an rw /var. I have found that under power cycling/reset conditions, that I can end up with 0 byte files. I keep my "settings" in /var/opt/myApp. Changing the mount...
I have a single board appliance that runs Debian 10 on a chunk of flash. UBIFS is used, and is split into two volumes: an ro roots, and an rw /var. I have found that under power cycling/reset conditions, that I can end up with 0 byte files. I keep my "settings" in /var/opt/myApp. Changing the mount option of /var to include
sync
seems to make those incidents go away.
I know the usual advice is that async is preferred over sync, but it is usually caveated with "usually, but not always" with little explanation what the exceptions might be.
The alternate solution, would be to modify any and all call sites where I write data to disk, to not only flush on file close, but sync as well (I do a lot of it with python). From a coding/completeness sake, mounting as sync
seemed both less work, and avoided me missing adding the sync guards at places, iow it's universal.
Additionally, I allow the appliance to save data to usb thumb drives. I think I should mount those sync too, to reduce loss when they are yanked out right after data is written to them.
Is this a suitably exceptional configuration to justify using sync
? Or should I use the alternate solution?
Travis Griggs
(1681 rep)
Aug 28, 2019, 10:03 PM
• Last activity: Oct 18, 2019, 02:39 PM
0
votes
1
answers
372
views
Process switch with clone()
Now, I have to write a c program and use `clone()` to make process do things asynchronous. I've read the [manual of `clone()`][man-clone]; however, I still don't know how to make it work asynchronous. I use flags `CLONE_THREAD`, `CLONE_VM` and `CLONE_SIGHAND` and there's an infinite loop in paramete...
Now, I have to write a c program and use
clone()
to make process do things asynchronous. I've read the manual of clone()
; however, I still don't know how to make it work asynchronous. I use flags CLONE_THREAD
, CLONE_VM
and CLONE_SIGHAND
and there's an infinite loop in parameter fn
. I got segmentation fault(core dumped)
first, then using gdb
to debug. Then, I got Program received signal SIGSEGV, Segmentation fault. [Switching to LWP xxx]
. I would like to make the processes switch successfully ?
Below is my code:
#define _GNU_SOURCE
#include
#include
#include
#define FIBER_STACK 1024*1024*8
int counter;
void * stack;
int do_something(){
int i;
while(1) {
if (counter == 1000)
{
free(stack);
exit(1);
} else {
counter++;
i++;
}
printf("Process %d running total runs %d, and this process runs %d \n", getpid(), counter, i);
}
}
int main() {
void * stack;
counter = 1;
stack = malloc(FIBER_STACK);
if(!stack) {
printf("The stack failed\n");
exit(0);
}
int i;
for (i = 0; i < 26; i++)
{
clone(&do_something, (char *)stack + FIBER_STACK, CLONE_THREAD|CLONE_SIGHAND|CLONE_VM, 0); // CLONE_VFORK
}
}
CYB
(103 rep)
May 20, 2014, 02:27 PM
• Last activity: Apr 6, 2019, 01:28 AM
1
votes
1
answers
399
views
Enabling Asynchronous IO at HP-UX Operating System
We are using HP-UX Itanium version B.11.31 and this server is used for running Sybase database version ASE15.7. I would like to know how to enable Asynchronous IO at Operating System level. I went through Sybase ASE and their suggestion is provided at this [link][1]. [![Sybase Asynchronous IO][2]][2...
We are using HP-UX Itanium version B.11.31 and this server is used for running Sybase database version ASE15.7. I would like to know how to enable Asynchronous IO at Operating System level.
I went through Sybase ASE and their suggestion is provided at this link .
Appreciate your valuable input as which one should be chosen. I feel it should be "Enabling Asynchronous I/O for File System Devices."
Database is stored in the file system and they are VxFS(Veritas File System)

Learning_DBAdmin
(159 rep)
Mar 26, 2019, 12:39 PM
• Last activity: Mar 27, 2019, 12:10 PM
0
votes
1
answers
479
views
Asynchronous background jobs in linux can interfere to each other?
I was trying to use a linux command repeatedly and I decided to use bash scripting. The command is curl and it has blue screen given to the target web server. I was doing this as a pentester in my company. So I wanted to repeat this curl command infinite times and I was successful with bash script l...
I was trying to use a linux command repeatedly and I decided to use bash scripting. The command is curl and it has blue screen given to the target web server. I was doing this as a pentester in my company. So I wanted to repeat this curl command infinite times and I was successful with bash script loop commands. The final command is in the following:
Ubuntu 14.04 LTS Terminal:
while :; do $(curl -v
-H "Range: bytes=18-18446744073709551615" & sleep 5 & pkill curl); done
But there is a something which I couldn't understand clearly: According to some articles and question-answers, each command in (command1 & command2 & command3 as single line) runs asynchronously and therefore they are running simultaneously without waiting one another. But in the above attacking code's result, curl's output is repeated in "every 5 seconds". That is, curl is running, then 5 seconds is waited, then curl is aborted. After that, curl is executed again. Therefore, the output is appeared again after every 5 seconds. So these commands interfere to each other. But internet articles and question-answers says its opposite. Can anyone make this point clear?
Note: By force of curl's attacking parameter, curl is pending. Not completing. Therefore, I am using sleep and then pkill command, respectively. Thereby, I can use curl command properly and repeatedly with attacking parameter.
Related Links:
1) (command1 & command2 & command3 &) Runs multiple jobs in parallel
https://unix.stackexchange.com/questions/423805/how-to-run-multiple-background-jobs-in-linux
2) (command1 & command2 & command3 &) Runs at the same time, in separate sub-shells
https://bashitout.com/2013/05/18/Ampersands-on-the-command-line.html
3) Asynchronous (multi-Threaded) Diagram Sample
https://stackoverflow.com/questions/748175/asynchronous-vs-synchronous-execution-what-does-it-really-mean

Hasan
(101 rep)
Aug 17, 2018, 07:36 AM
• Last activity: Aug 17, 2018, 09:18 AM
0
votes
1
answers
504
views
Linux AIO / io_submit / io_getevents / on fifo (named pipes)
I have to write a lot of data to a pipe. Can I use the Linux calls ``io_submit/io_getevents`` for writing to Named Pipes or it is defined only for regular files. I tried finding any document which explains the AIO over pipes but couldn't. Can someone help here. Majorly I am concerned about the ``aio...
I have to write a lot of data to a pipe. Can I use the Linux calls
`
io_submit/io_getevents
` for writing to Named Pipes or it is defined only for regular files. I tried finding any document which explains the AIO over pipes but couldn't. Can someone help here.
Majorly I am concerned about the `aio_offset
field in
struct iocb
`. What if a data packet with offset 8096 is scheduled for read/write before a data packet of offset as 4096.
Rishi Agrawal
(1 rep)
Jun 1, 2018, 05:43 AM
• Last activity: Jul 12, 2018, 10:03 PM
2
votes
1
answers
708
views
What does "asynchronous" mean in these cases?
I have asked [what "asynchronous" means a while ago for interrupts](https://superuser.com/questions/318204/what-do-the-terms-asynchronous-and-synchronous-mean-with-respect-to-the-def#). Now I have the same question but for running shell commands and for cancelling threads. From Bash manual > If a co...
I have asked [what "asynchronous" means a while ago for interrupts](https://superuser.com/questions/318204/what-do-the-terms-asynchronous-and-synchronous-mean-with-respect-to-the-def#) . Now I have the same question but for running shell commands and for cancelling threads.
From Bash manual
> If a command is terminated by the control operator
&
, the shell executes the command **asynchronously** in a subshell.
From Operating System Concepts, by Abraham Silberschatz, et al,
> A thread that is to be canceled is often referred to as the target
> thread. Cancellation of a target thread may occur in two different
> scenarios:
>
> 1. **Asynchronous** cancellation. One thread immediately terminates the target thread.
>
> 2. Deferred cancellation. The target thread periodically checks whether it should terminate, allowing it an opportunity to terminate
> itself in an orderly fashion.
I was wondering what "asynchronous" means in the above two cases? Does it have the same meaning in the two cases?
Do the definitions from Google apply to the above two cases?:
> adjective: asynchronous
> 1. (of two or more objects or events) not existing or happening at the same time.
>
> 2. Computing, Telecommunications
>
> of or requiring a form of computer control timing protocol in which **a
> specific operation** begins upon receipt of an indication (signal) that
> **the preceding operation** has been completed.
Do both definitions from Google seem
- contrary to the case of "asynchronous" operator &
,
- and unrelated to "asynchronous" cancellation of threads?
If the second definition applies to the above two cases, what are "a specific operation" and "the preceding operation" in each case?
Thanks.
Tim
(106420 rep)
Mar 30, 2018, 08:34 PM
• Last activity: Mar 31, 2018, 08:41 AM
3
votes
1
answers
1021
views
Messages on new terminal after using nohup
I'm trying to [run a few commands asynchronously](https://unix.stackexchange.com/q/289221/56041) on a login script (`.bash_profile`). When I open a new terminal, I see messages like this. They also show up when I log onto a system over SSH. Last login: Sat Jun 11 19:21:44 on ttys001 [1]- Exit 127 no...
I'm trying to [run a few commands asynchronously](https://unix.stackexchange.com/q/289221/56041) on a login script (
.bash_profile
).
When I open a new terminal, I see messages like this. They also show up when I log onto a system over SSH.
Last login: Sat Jun 11 19:21:44 on ttys001
- Exit 127 nohup -c 'git fetch -p && git pull' &/dev/null (wd: ~/cryptopp)
(wd now: ~)
+ Exit 127 nohup -c 'git fetch -p && git pull' &/dev/null (wd: ~/openssl)
(wd now: ~)
The login script performs the following:
if [ -d "$HOME/cryptopp" ]; then
cd "$HOME/cryptopp"
nohup -c 'git fetch -p && git pull' /dev/null &
fi
if [ -d "$HOME/openssl" ]; then
cd "$HOME/openssl"
nohup -c 'git fetch -p && git pull' /dev/null &
fi
The extra redirect gyrations are due to [nohup:ignoring input and appending output to 'nohup.out'](https://stackoverflow.com/q/24646320) . The extra single quotes are due to [How to escape single-quotes within single-quoted strings?](https://stackoverflow.com/q/1250079)
If it matters, I'm working on OS X, so its using Bash 3. But the scripts usually run on Linux, BSD and Solaris, and I'm seeing it on Debian 8, too.
I have a few question. First, what is the problem nohup
is complaining about? Second, how do I fix the problem nohup
is complaining about? Third, how do I suppress messages like this?
user56041
Jun 12, 2016, 01:52 AM
• Last activity: Jun 12, 2016, 03:21 AM
14
votes
1
answers
8372
views
Save cursor position and restore it in terminal
I am playing with some terminal capabilities to create async prompt output on `bash`. I want to get something like this: while outputting string in `PROMPT_COMMAND`, save terminal cursor position, print put `...` and go do other stuff (printing other info for example); then some time later *go back*...
I am playing with some terminal capabilities to create async prompt output on
bash
. I want to get something like this: while outputting string in PROMPT_COMMAND
, save terminal cursor position, print put ...
and go do other stuff (printing other info for example); then some time later *go back* to memorized position and print something new. PS1
is designed that way that command itself is put on newline, so that async output is just text in terminal.
I found out cup
terminfo entry to move cursor to given position, an there are escape codes to get current position (for examble, see [this question](https://stackoverflow.com/questions/2575037/how-to-get-the-cursor-position-in-bash)) . But for me, seems like all of them work with cursor position on screen, rather than in terminal buffer. That means that after putting new line my remembered position will be wrong.
Are there any way to work with terminal cursor position to store and restore cursor position based on buffer position? You can assume that the remembered position is still in visible part of the buffer (so you actually can put cursor there), but it might go up several lines up. For now, let's not consider race conditions. If no, I will try to find other tricks.
There is zsh
shell which actually has async prompt support, but I don't actually know will it work if before output user will press Enter to go to new line.
Lapshin Dmitry
(343 rep)
Apr 25, 2016, 08:25 AM
• Last activity: Apr 25, 2016, 08:40 AM
4
votes
1
answers
1180
views
Populate PS1 asynchronously
I have a few git svn related functions that see if I have to pull/push from/to the repository. My problem is that the functions I've written to gather this information are too slow. I'd like to make them async so that `PS1` shows a default, if though the data produced by the functions is ready I wan...
I have a few git svn related functions that see if I have to pull/push from/to the repository.
My problem is that the functions I've written to gather this information are too slow. I'd like to make them async so that
PS1
shows a default, if though the data produced by the functions is ready I want it printed.
I'd like to have these information in my prompt – so that, for example, I know if I have to pull – without doing a git svn fetch
everytime.
This is the function I call to add a ↑ to my PS1 if I have to push my changes.
function hasToPush {
(($1 == 0)) &&
(git svn dcommit --dry-run 2>/dev/null | grep -q "diff-tree" && echo "↑")
}
These are the functions I call to add a ↓ if I have to pull. The first is used to refresh my index every 2 minutes so that I can do the (($latest > $current))
check.
function loopingGitSvnFetch {
sleep 120
git svn fetch &>/dev/null
}
loopingGitSvnFetch &
function hasToPull {
(($1 == 0)) && (
latest=$(git svn log | awk 'NR==2' | cut -d ' ' -f1 | tr -d 'r')
current=$2
(($latest > $current)) && echo "↓"
)
}
To make them async, I've tried to put them together like this:
function async {
{
git diff-index --quiet --cached HEAD &>/dev/null
dirty=$(echo $?)
push=$(hasToPush $dirty)
gitsvn=$(git svn info 2> /dev/null | grep Revision)
gitsvn=${gitsvn#Revision: }
pull=$(hastoPull $dirty $gitsvn)
callback $push $pull
} &
}
But that produces the same slow behaviour.
I've tried to put results in a file and then read it after, but I don't like that approach.
I've thought about using PROMPT_COMMAND
. But that would not be async; it would be on demand.
Could you shed some light on how PS1
behaves or on what I'm doing wrong?
Thank you in advance.
PS: Could someone with 300 rep add the async and ps1 tags?
EDIT:
I added these line to my .bashrc as a simple test, it seemed to work, so having rewrote them (I reverted my previous attempt) seems was a good thing :)
while true;
do
discoverScmInfo &>~/.ps1
sleep 1
done &
PS1='$(customW)$(cat ~/.ps1)\$ '
I'll put this in a function and check if the job is already running before calling it.
Sorry about this, after all it seems that all I needed was to write about it. :)
Alberto Zaccagni
(385 rep)
Nov 23, 2011, 05:32 PM
• Last activity: Apr 21, 2015, 06:22 PM
2
votes
1
answers
501
views
Set a callback for when a certain process is spawned
The script I'm writing launches process A, which after an uncertain amount of time, launches a child process B. I need the script to execute a command C which depends on process B. But B might not be there at call time! **How to wait until a process with a certain given name is spawned?** I reckon I...
The script I'm writing launches process A, which after an uncertain amount of time, launches a child process B.
I need the script to execute a command C which depends on process B. But B might not be there at call time!
**How to wait until a process with a certain given name is spawned?**
I reckon I could just blindly poll/wait inside an infinite loop but maybe there's a fancier solution...
deprecated
(2871 rep)
Mar 28, 2012, 09:48 AM
• Last activity: Jul 5, 2012, 10:16 PM
Showing page 1 of 20 total questions