libera/#devuan-dev/ Saturday, 2022-10-01

rwpbgstack15, SIGPIPE is 13 and 13+128 = 141 as returned by the shell encoded to know it is a signal exit.00:00
rwpA write to a named pipe without any readers returns a SIGPIPE.  Processes should never ignore SIGPIPE.  Lots of cascade problems.00:01
rwpA time honored technique for named pipes is to have one process open it for reading but never read from it.  Then writes to the pipe block until there is a reader.00:01
bgstack15Ah, thank you, rwp. I had decoded 141 down to binary 10001101 but hadn't realized the 13 was significant. I thought maybe it was 4 separate flags that I didn't know how to proceed further with.00:12
bgstack15Do you think that I should therefore make yet another fork()ed child process that opens fifo and just while(1) or something?00:13
bgstack15while(1);00:13
rwpI would need to see what your code is doing in order to make an opinion about it.00:14
rwpOther than the strong opinion that ignoring sigpipe has long caused problems.  I have chased problems with it again and again.00:15
rwpThough if you never fork a child then it's all contained in your program code and that is okay.00:15
rwpBut for example a low level init process on another software distro ignored SIGPIPE at one point.  That is inherited.  And there is no way for the child to un-ignore it.00:16
rwpWhich just created a nasty cascade of errors!  It's been such a long journey that it is a pet peeve of mine now.00:17
bgstack15This is a user-level "daemon" for monitoring and displaying capslock+numlock status in system tray icons00:18
bgstack15I wrap around https://github.com/jonhoo/mktrayicon which used name pipes as an interface00:19
bgstack15maybe I can rewrite major parts of it to use a socket and then I won't need named pipes or even child processes.00:19
bgstack15https://bgstack15.ddns.net/cgit/keyboard-leds-trayicons/tree/experimental/keyboard-leds-trayicons.c?h=experimental&id=29fa73d2f5013c9502934bc8252014a211d7f7a800:21
rwpI don't have a negative immune response to using named pipes.  (shrug.)  However if you are in C code then Unix domain sockets are slightly more efficient.  And more typically used.00:21
XenguyWow, you guys are rockin' today00:24
* Xenguy bows before such expertise...00:24
rwpXenguy, Experience and Treachery will always triumph over Youth and Enthusiasm.  Especially the treachery part. :-)00:26
bgstack15Hm, I think I more closely match the enthusiasm bit.00:26
XenguyTo me treachery seems like an alliteration00:28
bgstack15I like the way C operates; I just barely know how to use it.00:28
XenguyIf my brain serves me correctly00:28
rwpI am reading through your code bgstack15 and it will take a moment to get the vision of it.00:29
bgstack15It's a C rewrite of a shell script in the same repo, if shell is easier for you to read.00:29
bgstack15(and get the vision)00:29
Xenguybgstack15, Can't go wrong learning some C me thinks00:30
rwpI will go look at the shell too.  I am pretty bilingual between C and sh.00:33
rwpBut with C (and most other languages) the library used with it can be unfamiliar.00:33
bgstack15I also love how you can just run man <FUNCTIONNAME>. I wanted to try a libini-config5 (dependency of sssd which is a major thing I use, so it's on every system I have) C library for parsing ini files but it had no freaking documentation AT ALL00:33
rwpbgstack15, I rather wish we had a code review site, such as garrit or something, so that comments could be logged on sections.00:44
rwpI think in main() around line 775 where the fifo is opened O_WRONLY that if that were O_RDWR then the parent would have an open read on the fifo and that would prevent the SIGPIPE and makes writes block if the pipe fills instead of sending a SIGPIPE.00:46
rwpWith my "peephole" looking at the code I think that might help improve that small bit of things.00:47
rwpBut for other things...  Please put a space between the "#include" part and the "<foo.h>" file part.  "#include<stdlib.h>" offends my sensibilities.00:48
rwpAlso use of signal(2) should be replaced with sigaction(2) throughout.00:49
rwpI haven't see a goto used in code since it was declared the keyword of the damned.  I think you don't need it anyway.  In both use locations the code is closing the fifo and re-opening it.  But that is because there are no more writers on the pipe and so EOF is being returned  If there is at least one writer, same issue as one reader, then the read will block instead of return EOF.00:52
rwpThat's all the time I have today.  I need to take off in five minutes.  Gotta fly!00:53
XenguyGawdspeed00:54
bgstack15thanks so much, rwp! I think I can tolerate the suppressed SIGPIPE. I don't want it to block, at all, for any reason.01:19
bgstack15But this O_RDWR isn't so bad either.01:23
rwpbgstack15, I was taught all about IPC message passing with named pipes by Marc J. Rochkind, Advanced UNIX Programming, Prentice-Hall, 1985.  Pages 160 on.03:29
rwpIt's an ancient book now and severely dated for details of C and such but the walk through of how the kernel handles pipes is still valid.03:29
rwpIf you have a library this is the type of book that might be found there.  Or brought over by inter-library loan.03:30
rwpNote that he updated to a 2nd edition though and I think all of that got removed from that second edition.  If I can dig up a copy of it I will look.03:30
rwpI can't recommend buying such a book now but I would recommend borrowing it from the library.  Perfect for a library loan.03:31
rwpOh my!  Have I got a deal for you.  It's so old now that the Internet Archive has it online!  https://archive.org/details/advancedunixprog00roch03:33
rwpThe Internet Archive is AWESOME! :-)03:34
Xenguyre: Interenet Archive:  +110:00
Xenguyer, Internet10:01
bgstack15is the devuan mirror having any issues at the moment?21:34
bgstack15at deb.devuan.org21:35
onefanghttps://sledjhamr.org/apt-panopticon/results/Report-web.html says no.21:39
onefangdeb.devuan.org is a DNS round robin, so might be one particular mirror that is having trouble at your end.21:40
brocashelmit's usually the tw mirror that fucks up for me21:44
brocashelmblendbyte21:44
brocashelmbeard.ly is what i've been using to avoid that issue21:45
bgstack15I'm going to probably test connecting directly to beard.ly if my current debmirror process fails out.21:46
bgstack15beard.ly doesn't seem to support https (according to my debmirror invocation), so I'm trying devuan.ipacct.com now which appears to be working21:57
onefangbeard.ly passed the HTPS tests from apt-panopticon.22:00
bgstack15Perhaps debmirror (as packaged on centos 7) is faulty.22:00
bgstack15Doesn't matter. devuan.ipacct.com is doing what I want.22:00
onefangbeard.ly even redirects HTTP to HTTPS.  No idea about debmirror.22:01
bgstack15In this apt+dpkg world, there's many, many ways to duplicate a deb mirror. I had picked debmirror.22:02
onefangYou gonna be adding an official Devuan package mirror soon?22:02
bgstack15No.22:06
bgstack15I don't do it in the proper Devuan way.22:06
bgstack15I don't place a ton of apache redirects to Debian files. I download absolutely everything and have an entirely offline, flattened Devuan mirror.22:07
onefangWell only three rewrite rules needed.  B-)22:09
bgstack15Oh, that's right, it uses a DEBIAN/ directory iirc22:11
bgstack15Still, I want an offline mirror so that I can be entirely decoupled from the Internet and still have full operations.22:11
bgstack15It has come in handy before.22:11
onefangFair enough.22:11
onefangCorrect.  DEVUAN/ DEBIAN/ and DEBIAN-SECURITY/ are the redirects.22:12
bb|hcbbgstack15: devuan.ipacct.comis mine... In case it fails let me know ;)22:18
bgstack15I check my debmirror logs maybe weekly, and there's always some errors. It matters the most at the beginning of the month when all my systems pull all OS updates. In the past, I've had to run my debmirror script manually 1-8 times, but today it was just straight not ever finding all listed packages. It's like a lot of our public mirrors are not up to date with the package files.22:20
bgstack15bb|hcb: I will do that. I hope it performs better than the deb.devuan.org round-robin hosts, which are hit-or-miss.22:21
onefangProbably just a timing thing.22:21
bgstack15I run my daily debmirror at 10:00 UTC22:23
onefangMost of the mirrors update every 30 minutes.22:24
onefanghttps://sledjhamr.org/apt-panopticon/results/Report-web.html is useful for checking details.  In particular the weekly stats for updated.22:24
onefangBeard.ly is currently on 99.31%,  devuan.ipacct.com on 100%.22:25
bgstack15That's probably my problem: I'm probably catching nodes during their upgrade process.22:26
bgstack15I'm guessing a their debmirror processes take longer than 15 minutes, so they spend the majority of their time in pulling down updates and not having a 100%-correct packages.tgz22:27
onefangI have a TODO to write a mirror update script that pulls down new packages, then pulls down updated metadata, then deletes old packages.  Then suggest the other mirror admins switch to it.  ZThat'll help22:32
onefangAlso, since we are a layer on top of Debian, you also get to trip over the Debian mirrors update windows.22:36
bb|hcbI'd suppose that most problems are with the Debian part, because many mirrors use external stuff for that22:38
onefangI should try to sleep now.  The sun is up.22:41
brocashelmnight shift?22:43
XenguyHoliday time maybe; been staying up late myself the last couple of nights23:55
XenguyOr Vampire Time, nuff said, ahem23:56
golinuxonfang is not standard issue.  :D23:56
golinuxonefang23:56
Xenguyhah, who is, around here?23:57
golinuxWe are "special" and offtopic23:58
Xenguyaye23:58

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!