libera/#maemo/ Monday, 2019-01-14

DocScrutinizer05http://wiki.maemo.org/Community_Council01:08
DocScrutinizer05warfare: ping01:09
DocScrutinizer05warfare: spam in http://maemo.org/news/planet-maemo/rss.xml01:09
DocScrutinizer05xes: ^^^01:09
DocScrutinizer05warfare: xes: I have no idea if planet-maemo is of any use, or been of any use during last 10 years01:11
DocScrutinizer05tbh I don't even understand what's the intended purpose. Some maemo specific filter bubble of sorts?01:14
xesDocScrutinizer05: there is a task collecting news from maby blogs and other sources01:22
xes*many01:22
pabs3DocScrutinizer05: its a very common thing to have for Linux distros, for eg https://planet.debian.org/ http://planet.gnome.org/ http://planetkde.org/ etc03:54
DocScrutinizer05I think it's pointless13:29
DocScrutinizer05particularly when unredacted13:29
DocScrutinizer05SPAM QED13:29
CatButtsmeow14:42
ceeneI'm having a bit of trouble with one linux related thing, maybe someone has an idea15:21
ceeneI'm executing via execv something like this: /bin/sh -c "producer | consumer"15:21
ceenewith that, I have the PID of /bin/sh15:22
ceenebut if I kill this sh instance, both producer and consumer keep on running15:22
KotCzarnyyou can always do 2 execvs' and copy data between processes yourself15:22
ceeneshouldn't sh be killing its children?15:22
ceenei'd rather not do that15:22
ceene:/15:22
KotCzarnymaybe it waits for the children to finish15:23
inzKotCzarny, no need to copy data manually, one can just pipe()15:23
ceenethese children won't end unless someone kills them, that's the reason I want to kill sh15:24
ceeneI expected them to die, but it seems they are happy to keep on living forever15:24
KotCzarnydo the killed sh vanishes from process list?15:25
ceeneyes, it becomes a zombie, and after waitpid it disappears15:27
inzSom'n like htis: int pfd[2]; pipe(pfd); if (!(prodpid = fork())) { close(STDOUT_FILENO); dup2(pfd[1], STDOUT_FILENO); producer execve; } if (!(conpid = fork())) { close(STDIN_FILENO); dup2(pfd[0], STDIN_FILENO); consumer execve; } close(pfd[0]); close(pfd[1]);15:27
KotCzarnykill the producer or receiver then?15:27
inzI believe the problem was that their pids are not known15:28
ceeneinz: exactly15:29
ceenemy C program only knows about sh, because I fork+execv, so I know the pid of the child I create, but I do not know nothing of the children sh begets15:29
KotCzarnycan any of them be modified to create pid file?15:30
ceenei control both of them, yes15:30
KotCzarnymight be easiest way, or even control pipe to accept msgs/signals15:31
ceeneisn't there any way for sh to just kill his own children when it dies?15:31
KotCzarnymaybe your apps detach from sh?15:32
ceenenop, none of them fork() or daemon()15:32
inzThe behavior might also depend on the shell15:32
inzIs the pipe() solution above too complex for you?15:34
ceeneno, I could do it, but I have several processes that I launch via fork+execv, that are later on managed by a few functions15:35
ceeneso I would have to make a special case out of this process15:35
KotCzarnymake the producer or receiver create known pid file15:36
KotCzarnythen kill the pid when needed15:36
inzIt should be enough for you to just kill one end or the other, they should mutually destruct on SIGPIPE when one end goes away15:36
ceenethat still forces me to make this a particular case that isn't managed the same way I managed the other processes15:36
KotCzarnycan producer spawn receiver?15:37
ceeneI could do that, yes15:37
KotCzarnythat way you could evecve it directly15:38
ceeneeverything seems inelegant to me15:40
KotCzarnyall depends on your schedule and budget i guess15:40
ceeneIf pid is less than -1, then sig is sent to every process in the process group whose ID is -pid.15:41
KotCzarnyhttps://unix.stackexchange.com/questions/124127/kill-all-descendant-processes15:42
KotCzarnymay be related?15:42
ceenefork()+exec() /bin/sh -c 'a | b'... I guess a, b, sh would belong to the same process group15:42
ceenebut would the parent of sh be a member of the same process group?15:42
ceeneah, I can set process group by myself via setpgrp15:44
KotCzarnyyou can also make shell return descendant pids on kill15:44
KotCzarnyand use it15:44
KotCzarnyanyway, time to go home15:45
ceenethanks for your ideas!15:45
ceenethe process group trick did it!15:58
ceene        if(!(a->pid = fork())) {15:58
ceene+               /* Move child to a new process group so we can kill all its descendents via kill -pid */15:58
ceene+               setpgid(a->pid, 0);15:58
ceene15:58
ceene-               kill(a->pid, sig);15:58
ceene+               /* Negative PID means sending signal to all members of the group PID */15:58
ceene+               kill(-a->pid, sig);15:58
ceeneso I can keep exactly the same code for everything, and if I face later on some other thing that must create children, they will die as well15:59
ceeneand I can forget about that15:59
ceene:)15:59
KotCzarny:)15:59
KotCzarnynothing like sharing problem and resolving it by mind reset15:59
ceenetotally, you were a pretty fine rubber duck, you even talked back with useful remarks16:00
ceenenow I have more of a philosophical problem...16:00
KotCzarnytry porto16:00
ceenei'm basically creating a init system by scratch16:00
ceenes/by/from/16:01
infobotceene meant: i'm basically creating a init system from scratch16:01
KotCzarnywhy not systemd?16:01
KotCzarny;)16:01
ceenelol16:01
ceenethat's my philosophical problem, I don't want to do that16:01
KotCzarnybut there are few real ones to choose from16:01
KotCzarnyincluding busybox's simple inittab16:02
ceenemost things I'm running from busybox init16:03
ceenebut several things I'm running via this custom initd16:04
ceenei've implemented something akin to runlevels, because this system may be running in one out of several different modes16:04
inzDoesn't every good unix geek write at least 1) a music player, 2) a window manager, 3) an irc client, 4) a compiler, 5) a kernel and 6) an init replacement; not necessarily in that order16:04
ceenebut this also initializes several segments of shared memory, configures an FPGA and more16:05
KotCzarnyi did #116:06
KotCzarnythe rest wasnt needed custom versions16:06
KotCzarny(for me)16:06
ceenethis thing also receives RPC messages requesting changes in configuration, etc16:07
ceenesomedays I think this is great, somedays I think it's doing too much in one place16:07
ceeneand I'm having some kind of imposter syndrome related to systemd (am I making the same mistakes that they do?)16:08
KotCzarnyas long you are not on the mission to rule the world with your offspring, no16:09
ceeneno, I just need this thing to manage different pieces of hardware so in the end the product does what it has to do: be a radar16:09
ceeneanything out of that, I'm not interested in16:09
KotCzarnymain problem with evild is being shoved to everyone's throats16:12
KotCzarny(apart from being written badly by an idiot)16:12
CatButtsdon't put that in mouth16:14
CatButtsyou don't know where it's been!16:14
KotCzarnyi think you've missed 'shoved' part16:17
DocScrutinizer05ceene: https://unix.stackexchange.com/questions/14815/process-descendants17:46
DocScrutinizer05ooh, somebody beat me to it17:46
DocScrutinizer05ceene: *usually* your children processes share STDIN, STDOUT, STDERR and thus when parent quits they receive SIGHUP(?)17:55
DocScrutinizer05or your parent keeps thrack of its children by memorizing their PIDs and sending them a kill signal when/before the parent quits17:57
DocScrutinizer05or you use a unique new program group for your process and its children, teher are ways to send signals to all processes of a pg17:58
DocScrutinizer05or you might even use cgroups, like systemd does17:59
DocScrutinizer05or run the process under monitor, though that's a total overkill and often fails (can't monitor monitors afaik)18:00
DocScrutinizer05see strace -f for the latter18:00
DocScrutinizer05inz: I only wrote a shell18:03
DocScrutinizer05not on linux though but on BS-M which woefully lacked anything akin a shell of sorts18:04
DocScrutinizer05this thing even had weird terminals (DS-075) where youz can move around the cursor and edit on screen like you want, and there are "DÜ", "DÜZ" "DÜM" keys for DatenÜbertragung (Zeile/Marke) "datatransfer (all)", "datatransfer line of cursor" and "datatransfer from mark to cursor"18:09
DocScrutinizer05NB that DÜ DÜZ and DÜM were the only key<s that actually triggered a data transfer from terminal to computer18:12
DocScrutinizer05there was a so called fullscreen mode(?) on a virtual second screen which transferred every key as it got pressed, but that mode and screen was reserved for the fullscreen editor18:14
DocScrutinizer05you'll have a hard time finding any info about BS-M, so look for AMBOSS-M or the big brother BS-100018:22
DocScrutinizer05the whole thing looked very "IRCy", commands to OS were like "/BOOT" or "/DATE" or "/START prognam" and a line starting with ":prognam:" established a dialog between that process "prognam" and the terminal sending it. All output from prognam showed on that terminal from then on, and all input from that terminal went to prognam until another ":progTWO:"18:39
DocScrutinizer05users? owners? passwords & login? unknown ;-P18:41
DocScrutinizer05the program FILE was like a combo of `cp`, `mv` `rm` and `ls`/`stat` and for our 6 terminals we had 6 processes started: "FILE1" to "FILE6", while scripts used "FILE"18:44
DocScrutinizer05it was normal to have a ~16ß programs started during boot, just to have them waiting for input when you need them18:49
DocScrutinizer05150*18:49
DocScrutinizer05http://www.tentacle.franken.de/m80/19:54
WikiwideCan Nokia N900 connect to 2.4GHz or 5GHz WiFi networks?21:16
Wikiwide802.11 b/g : 2.4GHz, yes.21:17
sicelo5GHz, no21:18
WikiwideOkay, thank you :-) Just trying to figure out how to improve WiFi at home. Signal is crowded by neighbours' networks.21:19
WikiwideI have heard that ordinary modems aren't that good at WiFi networking, especially when surrounded by lots of devices. Now I have a gateway or two to test...21:20
Vajbmaybe to try different channels21:23
DocScrutinizer05interesting teardown just to show what complexity of engineering we face when competing with state of the art top notch embedded integration https://www.youtube.com/watch?v=L5eSaFIIUpM21:32
sicelo3/cu21:35
DocScrutinizer05Wikiwide: first of all: do manual channel selection and nail down the channel so it never changes. Consider carefully where to place your AP. Adjust antenna orientation. Then, starting to do really effective measures, use multiple APs and configure them so they all run the same SSID and establish one contiguous RF network21:36
DocScrutinizer05refer to competent howto regarding whether those multiple AP should all use same channel or nailed fix to each its own channel21:38
DocScrutinizer05plcae the APs along "perimeter" of your flat21:39
DocScrutinizer05place*21:39
DocScrutinizer05sicelo: ?21:39
sicelotypo. sorry21:39
DocScrutinizer05np :-)21:40
sicelo>configure them so they all run the same SSID and establish one contiguous RF network< a la, WDS?21:42
DocScrutinizer05sicelo: I lack expertise on that particular detail of WLAN21:46
sicelook. i'm also not well-versed. just that WDS tends to be not worth it (bandwidth is reduced) and also interoperability with APs from different manufacturers is virtualy non-existe t21:48

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