On Sat, Oct 12, 2024 at 21:43:39 -0400, Karl Vogel wrote: > >> In previous messages: > > > > system('systemctl', '--quiet', [...] , @start_units) == 0 > > or die("Could not execute systemctl: $!"); > > > > Could not execute systemctl: at /usr/bin/deb-systemd-invoke line 148. > > See the ":" followed by two spaces? Unlike systemctl, well-behaved > programs set "errno" when they puke, and that setting is turned into > a more-or-less useful error message like "Permission denied". > "$!" would have held that message.
I don't think this is correct. A *function* can set errno (a global variable in C), in addition to returning a value. A process can't, unless there has been some major change to the Unix process model that I've missed. A failing process can return an exit status greater than 0 to indicate that something has gone awry, but that's it. There's no other mechanism available (that I know of) to pass information back to the parent process. The closest thing would be that the parent can detect whether the child was killed by a signal, which is not relevant here.