| systemdlete2 | Is 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/doc | 01:37 |
|---|---|---|
| fsmithred | E: Could not get lock /var/lib/apt/lists/lock. It is held by process 32540 (apt) | 01:54 |
| systemdlete2 | what command did you run? | 01:57 |
| systemdlete2 | well, anyway, I just discovered the -w option to lsof which seems to suppress those warnings | 01:58 |
| fsmithred | apt update | 01:59 |
| fsmithred | apt update | 01:59 |
| systemdlete2 | oh | 01:59 |
| fsmithred | better... | 01:59 |
| fsmithred | apt upgrade and let it sit there asking for a response | 01:59 |
| systemdlete2 | nah | 01:59 |
| systemdlete2 | this is for a check routine | 02:00 |
| fsmithred | the file i listed is static and it's been ther since 2022 | 02:00 |
| systemdlete2 | thanks for that. Wonder why I didn't think of that to start with | 02:00 |
| fsmithred | hang on - three files... | 02:00 |
| fsmithred | lsof gave me these: /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock /var/cache/apt/archives/lock | 02:01 |
| fsmithred | and they're gone when i cancel the upgrade command | 02:02 |
| systemdlete2 | right, and with the -w option, that solves that problem | 02:02 |
| mason | fsmithred_: Do you have unattended-upgrades installed? | 05:09 |
| mason | Oh, this was for systemdlete. | 05:11 |
| mason | ...who's no longer here to see it. | 05:12 |
| rwp | They come and go like the will-o'-the-wisp... | 05:15 |
| mason | heh | 05:15 |
| onefang | I was using time to see how long some command took, and the result was - "real +()m,-,134s" lol | 07:58 |
| CueXXIII | lol, what is your locale set to? | 07:59 |
| onefang | This 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 |
| onefang | After that it should be en_AU.UTF-8 | 08:01 |
| CueXXIII | then i wonder how your shell messed that up | 08:01 |
| onefang | Entirely possible my RAM gremlim hit it. I'll run it again. | 08:02 |
| onefang | If I think the RAM gremlin hit, I free my caches and things, then try it again, that helps. | 08:04 |
| gnarface | ntp or ntpdate got installed somewhere in there? | 08:04 |
| gnarface | maybe then got called before the script exits? | 08:04 |
| onefang | chrony is installed in the test VM by the part of the scripts that builds the VM. | 08:05 |
| CueXXIII | but then i would still expect to be "+()" and ",-,134" to be valid, maybe negative, numbers | 08:05 |
| onefang | There 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 |
| onefang | Daedulas BTW. | 08:08 |
| onefang | Ah 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 |
| onefang | The 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 |
| rwp | onefang, 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 |
| CueXXIII | it 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 digits | 23:09 |
| rwp | time 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 |
| rwp | Which means that every shell has a unique version of it among bash, ksh, mksh, zsh, fish, sh, csh, and so on. | 23:22 |
| ted-ious | rwp: time ( command | stuff ) | 23:25 |
| ted-ious | That works for the whole chain. | 23:26 |
| rwp | Right. Because time is built into the shell. That's why it is required to be a shell builtin. | 23:27 |
| ted-ious | Why doesn't it work for /usr/bin/time ( command | stuff ) do you know? | 23:39 |
| ted-ious | I just tried it and I get a syntax error. | 23:39 |
| onefang | Which time is it? Just woke up, so the time is far too early in the morning. | 23:40 |
| onefang | I 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 |
| onefang | I use bash out of habit, never bothered looked closely at the others. | 23:42 |
| rwp | Then 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 |
| onefang | The best is to ignore the actual symptom, and try to track down the gremlin in my 256 GB of RAM. | 23:44 |
| rwp | ted-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 |
| onefang | Which 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 |
| rwp | If 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-ious | rwp: Ok so is there some way to quote the commands without having to run another shell? | 23:47 |
| ted-ious | That's what command does right? | 23:47 |
| rwp | Type this into the bash shell: help command | 23:47 |
| ted-ious | Ok but command time ( df | grep ) doesn't work and neither does time command. | 23:48 |
| rwp | As 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 |
| rwp | I think you must have had a typo because "time ( df | grep . )" most definitely does work. | 23:49 |
| ted-ious | In bash? | 23:49 |
| rwp | Yes. In bash. | 23:49 |
| onefang | Just for the record, in bash I just do - time myscript.sh | 23:50 |
| ted-ious | $ command time ( df | grep rpool ) | 23:50 |
| ted-ious | -bash: syntax error near unexpected token `(' | 23:50 |
| ted-ious | Same thing if I switch them. | 23:50 |
| onefang | Usually in tmux so I can scroll back. | 23:50 |
| ted-ious | onefang: 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 |
| rwp | You say that like you expect it to be something different? | 23:54 |
| rwp | I 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 |
| rwp | I found that unexpected to me. But the (...) subshell is completely superfluous in these anyway. | 23:56 |
| rwp | Reading 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 |
| rwp | Oh well. Let's take any further shell discussion to -offtopic. | 23:59 |
| onefang | Is it /usr/bin/time to take this to offtopic? B-) | 23:59 |
| onefang | SNAP! | 23:59 |
Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!