libera/#devuan/ Friday, 2024-04-19

systemdlete2Is there a deterministic way to check if apt upgrade is already running (aside from the obvious check for running process with ps).  What I mean is, is there a lock file that can be tested?  I have tried lsof on /var/cache/apt/archives/lock but the problem is it spits out errors about /run/user/1000/doc01:37
fsmithredE: Could not get lock /var/lib/apt/lists/lock. It is held by process 32540 (apt)01:54
systemdlete2what command did you run?01:57
systemdlete2well, anyway, I just discovered the -w option to lsof which seems to suppress those warnings01:58
fsmithredapt update01:59
fsmithredapt update01:59
systemdlete2oh01:59
fsmithredbetter...01:59
fsmithredapt upgrade and let it sit there asking for a response01:59
systemdlete2nah01:59
systemdlete2this is for a check routine02:00
fsmithredthe file i listed is static and it's been ther since 202202:00
systemdlete2thanks for that.  Wonder why I didn't think of that to start with02:00
fsmithredhang on - three files...02:00
fsmithredlsof gave me these: /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock /var/cache/apt/archives/lock02:01
fsmithredand they're gone when i cancel the upgrade command02:02
systemdlete2right, and with the -w option, that solves that problem02:02
masonfsmithred_: Do you have unattended-upgrades installed?05:09
masonOh, this was for systemdlete.05:11
mason...who's no longer here to see it.05:12
rwpThey come and go like the will-o'-the-wisp...05:15
masonheh05:15
onefangI was using time to see how long some command took, and the result was - "real    +()m,-,134s"  lol07:58
CueXXIIIlol, what is your locale set to?07:59
onefangThis was for the my system building script.  So locale isn't set before the script starts, coz "apt install locales" is near the beginning.08:01
onefangAfter that it should be en_AU.UTF-808:01
CueXXIIIthen i wonder how your shell messed that up08:01
onefangEntirely possible my RAM gremlim hit it.  I'll run it again.08:02
onefangIf I think the RAM gremlin hit, I free my caches and things, then try it again, that helps.08:04
gnarfacentp or ntpdate got installed somewhere in there?08:04
gnarfacemaybe then got called before the script exits?08:04
onefangchrony is installed in the test VM by the part of the scripts that builds the VM.08:05
CueXXIIIbut then i would still expect to be "+()" and ",-,134" to be valid, maybe negative, numbers08:05
onefangThere is an error message printed when I install chrony, which I only found two hits on the Internet, one of them in Japanese or something similar.08:07
onefang"dpkg-statoverride: warning: --update given but /var/log/chrony does not exist"  though it gets created later.08:07
onefangDaedulas BTW.08:08
onefangAh I disable services from running until the end of the process, so chrony wont actually be running.  Though this is the first time during these tests this has happened.08:09
onefangThe time is set correctly on the fresh VM when I boot into it for the first time.08:13
onefang"12m15.831s"  Much better.   B-)08:26
rwponefang, Which time was it?  Was it the internal shell time?  Or the external /usr/bin/time?  And yes it looks like a gremlin for that output.23:04
CueXXIIIit looks a bit like it was trying to display a negative value with negative digits, the weired characters all lie in the 10 cells before the digits23:09
rwptime is on of those funny commands that to be effective at timing things like pipelines (time grep foo | head) then it needs to be built into the shell so it can time the entire pipeline.23:22
rwpWhich means that every shell has a unique version of it among bash, ksh, mksh, zsh, fish, sh, csh, and so on.23:22
ted-iousrwp: time ( command | stuff )23:25
ted-iousThat works for the whole chain.23:26
rwpRight.  Because time is built into the shell.  That's why it is required to be a shell builtin.23:27
ted-iousWhy doesn't it work for /usr/bin/time ( command | stuff ) do you know?23:39
ted-iousI just tried it and I get a syntax error.23:39
onefangWhich time is it?  Just woke up, so the time is far too early in the morning.23:40
onefangI know there's a gremlin in my RAM somewhere.  When I see that sort of odd randomness, I free my caches and it tends to go away.  Beats the old solution, which was to reboot my desktop.23:42
onefangI use bash out of habit, never bothered looked closely at the others.23:42
rwpThen you are using the bash builtin time command.  I was just curious about where to focus thought on in that weird problem time case you mentioned before.23:43
onefangThe best is to ignore the actual symptom, and try to track down the gremlin in my 256 GB of RAM.23:44
rwpted-ious, /usr/bin/time is the external command.  It takes arguments.  And it invokes the arguments.  But ( | ) ; are all shell metacharacters.  They don't make sense to external commands trying to invoke them.23:45
onefangWhich I have asked about before.  If I can nail it down to some specific bit of RAM, mapping that bit out would work fine.  I can afford to loose some RAM.23:45
rwpIf you want to use the external time you can force it to be a command with "command time ...".  And you can run shell metacharacters in a shell -c.  Like: command time sh -c '( echo foo | head )'23:46
ted-iousrwp: Ok so is there some way to quote the commands without having to run another shell?23:47
ted-iousThat's what command does right?23:47
rwpType this into the bash shell: help command23:47
ted-iousOk but command time ( df | grep ) doesn't work and neither does time command.23:48
rwpAs to the prior question the only way to have a shell style pipeline is through a shell program.  time and echo and others that are not shells don't implement it.  But sh -c is available for it.23:48
rwpI think you must have had a typo because "time ( df | grep . )" most definitely does work.23:49
ted-iousIn bash?23:49
rwpYes.  In bash.23:49
onefangJust for the record, in bash I just do - time myscript.sh23:50
ted-ious$ command time ( df | grep rpool )23:50
ted-ious-bash: syntax error near unexpected token `('23:50
ted-iousSame thing if I switch them.23:50
onefangUsually in tmux so I can scroll back.23:50
ted-iousonefang: That's cheating! :)23:50
rwp"command time" is definitely NOT "time"23:50
rwp"command time" is mostly equal to "/usr/bin/time"23:50
ted-ious$ command /usr/bin/time ( df | grep rpool )23:54
ted-ious-bash: syntax error near unexpected token `('23:54
rwpYou say that like you expect it to be something different?23:54
rwpI also note in passing that /bin/dash (aka /bin/sh) does not parse it either.  sh -c 'time ( echo foo | grep . )'  => sh: 1: Syntax error: word unexpected (expecting ")")23:55
rwpI found that unexpected to me.  But the (...) subshell is completely superfluous in these anyway.23:56
rwpReading the bash man page I see it defines time for pipelines only and that pipelines are not defined to include subshells or lists.  Which is what I find with /bin/sh.  So bash must do some extra feature to allow subshells and lists which are not strictly allowed.23:59
rwpOh well.  Let's take any further shell discussion to -offtopic.23:59
onefangIs it /usr/bin/time to take this to offtopic?  B-)23:59
onefangSNAP!23:59

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