What is fsck up to now?
toroid.org
toroid.org
It's safe to send SIGINFO to processes that don't know about it; the default action is to ignore it. You can send it to an entire process group, and maybe some of them will answer it. But even if they don't, they won't just get killed for it.
This makes it so much more useful and discoverable, since you can almost always ^T with little risk. Usually you'll get at least a bit of information about how long the current command (more or less) has been running. If the running program happens to handle it, so much the better.
You can also manually dig about in /proc/$pid/fd{,info}/ if you want something more fancy, like using gdbar² to display a graphical progress through files for a given process.
That said, sometimes it is nice to see the other commands pop up in monitor mode. For example, when the rate suddenly drops in a command that you care about then the other output will often show the culprits for you to `kill -STOP`.
SIGINFO is ignored by default, and pretty clearly an info-dump trigger, so you can throw ^T at any random utility you're running, worst case scenario is you'll just get a time-type dump.
$ ping google.com
PING google.com (172.217.5.110) 56(84) bytes of data.
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=1 ttl=54 time=4.04 ms
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=2 ttl=54 time=4.04 ms
2/2 packets, 0% loss, min/avg/ewma/max = 4.037/4.039/4.037/4.042 ms
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=3 ttl=54 time=4.16 ms
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=4 ttl=54 time=4.06 ms
4/4 packets, 0% loss, min/avg/ewma/max = 4.037/4.076/4.054/4.164 ms
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=5 ttl=54 time=4.19 ms
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=6 ttl=54 time=4.20 ms
^C
--- google.com ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 11ms
rtt min/avg/max/mdev = 4.037/4.114/4.195/0.068 ms $ dd if=/dev/zero of=/dev/null& pid=$!
$ kill -USR1 $pid; sleep 1; kill $pid
18335302+0 records in 18335302+0 records out 9387674624 bytes (9.4 GB) copied, 34.6279 seconds, 271 MB/sNow you can use the status option to get a realtime update of the progress.
dd if=/dev/urandom of=/dev/null status=progress
load: {load%} cmd: {cmd name} {PID} running {user time}u {system time}s
Being able to grab the PID from a currently running process -- in the same shell it's running in! -- is priceless on its own. The rest is icing on the cake.But I should also clarify that my long-running fsck isn't always the result of an unclean shutdown. There's something about my combination of iSCSI+crypttab+NFS that causes fsck to be run too often—even if I shut down the machine cleanly while the NAS is running, it usually decides to fsck when it comes back up.
Something to investigate next winter, perhaps.
Interesting about fsck running for unclear reasons. "What is it up to now?" is a valid question at multiple levels!
Glad you enjoyed it. :-)
> I have considered doing something totally ridiculous like setting up a Raspberry Pi with a camera and machine vision software to watch the LED displays on these devices to glean status information. Silly, but...
Ha! I actually have a PoE camera pointed at the display of my UPS. Here's what it looks like right now: https://toroid.org/misc/ups-display.jpg
Notice that horizontal blank row of dead pixels halfway down the right side of the display? The one that makes "54.6" look like "51.6"? That gap defeated my naïve five-minute attempt to use image recognition to extract the battery voltage.
Depending on how the cabling to that display works, you might be able to do all of that without having to disable the display.
grep '[f]sck'* http://mywiki.wooledge.org/ProcessManagement#But_I.27m_on_so...
M. Wooledge's description of ps options is not quite accurate, but that is incidental to xyr main point.
* http://jdebp.uk./Softwares/nosh/guide/commands/monitored-fsc...
* http://jdebp.uk./Softwares/nosh/guide/commands/monitor-fsck-...
And a service:
% system-control print-service-scripts monitor-fsck-progress
start:#!/bin/nosh
start:true
stop:#!/bin/nosh
stop:true
run:#!/bin/nosh
run:#local socket used for monitor-fsck-progress
run:local-stream-socket-listen --systemd-compatibility --backlog 2 --mode 0644 /run/fsck.progress
run:setsid
run:setlogin -- daemon
run:vc-get-tty console
run:fdmove -c 4 2
run:open-controlling-tty
run:fdmove 2 4
run:setuidgid -- daemon
run:./service
service:#!/bin/nosh
service:#fsck combined progress information displayed on /dev/console
service:monitor-fsck-progress
restart:#!/bin/sh
restart:exec false # ignore script arguments
% killall -USR1 e2fsck
or start it with -C