13
votes
Can I watch the progress of a `sync` operation?
Based on the other answers I made this over-bloated one-liner that tracks summary progress as well as device-specific progress:
# Create the command
watchSync() {
watch -n1 'grep -E "(Dirty|...
9
votes
Accepted
How to attach a listener to sysfs files?
I have not read the source code that populates operstate, but generally, reading a file in sysfs executes some code on the kernel side that returns the bytes you're reading. So, without you reading ...
7
votes
Accepted
Why does io_uring have a layer of indirection for the submission queue?
I reached out to the author of the paper and got some clarity on this.
The reason there's a layer of indirection is because some applications might want to hold submission event data inside their ...
5
votes
How to attach a listener to sysfs files?
As the good Müller already has explained you can not monitor sysfs files as they are part of virtual file system and does not act like normal files.
I ended up downing myself into some C, and whilst ...
3
votes
Accepted
Stopping an asynchronous while loop in a shell script
You need kill $! to kill the last running process at background. see In Bash scripting, what's the meaning of " $! "?
if there are other commands you are running in the background, you can ...
2
votes
Stopping an asynchronous while loop in a shell script
coproc for simulating named loops
The closest to named loops bash has, might be coproc:
coproc loop1 { while ((1)) ; do echo a >> aout ; sleep 1 ; done ;}
echo PID of loop1 $loop1_PID
coproc ...
2
votes
Can I watch the progress of a `sync` operation?
You can watch current block device I/O traffic with nmon, as in:
NMON=ld nmon -s1
(this preselects display of load graph and disk graph with 1 second refresh time.. this can also be set by starting ...
2
votes
Accepted
How to set interval for an asynchronous command in bash?
one thing to try in order to achieve a degree of asynchronous setting of a variable is:
#!/usr/bin/env bash
async() {
while :; do
# send SIGUSR1 to "parent" script
kill -USR1 "$1"
...
1
vote
Curl returning with no response and does not wait for `wait=x seconds`
The HTTP response HTTP/1.1 202 Accepted indicates that the request has been accepted for processing, but the processing has not been completed yet.
The key is:
< location: https://hostname.com/...
1
vote
How to attach a listener to sysfs files?
I'm not sure if this is quite what you want, but you can monitor the interface state like this:
$ ip monitor link dev eth0
What exactly this gets you is slightly dependent on the network device ...
1
vote
How to attach a listener to sysfs files?
Apparently a sysfs attribute that is "pollable" also works with inotify.
Pollable Attributes
There is a mechanism for Linux kernel drivers to make sysfs attributes trigger change events when ...
1
vote
Accepted
To sync or not to sync in an embedded environment?
Here is my opinion: Sorry for verbosity in advance.
When we are specifically talking about ubifs we should always either sync / similar options.
ubifs supports write-back caching
That means changes ...
1
vote
Accepted
Enabling Asynchronous IO at HP-UX Operating System
Looks like the three pages are somewhat poorly titled.
"Enabling Asynchronous Disk I/O HP-UX" page describes the installation of the asynchronous I/O driver. It would be definitely needed if you ...
1
vote
Linux AIO / io_submit / io_getevents / on fifo (named pipes)
Linux AIO is not just limited to regular files - it can be used on block device special files. I expect AIO writes cannot be used on pipes though, due to pipes not being capable of seeking.
...
1
vote
What does "asynchronous" mean in these cases?
The meaning of “asynchronous” is different in all these cases.
In the shell case, & runs a command asynchronously, meaning that the shell regains control as soon as the command starts, and the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
async × 21linux × 8
bash × 5
io × 4
shell × 3
filesystems × 3
shell-script × 2
terminal × 2
process × 2
prompt × 2
ubuntu × 1
command-line × 1
scripting × 1
linux-kernel × 1
kernel × 1
python × 1
curl × 1
php × 1
tty × 1
embedded × 1
synchronization × 1
http × 1
nohup × 1
fifo × 1
inotify × 1