Question: I started a shell for another user on my system. However there's no systemd user instance for that user:

```
helloer@host $ sudo -u testusr bash
testusr@host $ systemctl --user status
Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)

```

How can I start a dbus or systemd user instance for testusr?

I'm running Arch Linux, linux 5.11.8.arch1-1, dbus 1.12.20-1, systemd 247.4-2.

Answer: 
You are comparing apples to pears. They taste different. :-)

Arithmetic
==========

An **arithmetic** `0` means false[a] both in c and the shell:

```
$ if ((0)); then echo true; else echo false; fi
false

```

Or, in a more portable test, but somewhat more convoluted:

```
$ echo $(( 22 == 23 ))
0

```

[a] Actually, what is being written is an ASCII character (`0`) (ASCII in most systems, but may be others) with the decimal byte value of `48` which is transparently being converted to a byte value of `0` (A `c char` of value `0`). And is this byte value of `0` that is taken to mean false **in c**

That is so for most shells as the arithmetic expansion is actually a direct copy of the c arithmetic. No differences should exist there.

Exit status
===========

But the exit status (`$?`) of an utility is something different:

```
$ echo "$(( 22 == 23 )) $? -- $((22 == 22 )) $?"
0 0 -- 1 0

```

Theory
======

I can only offer my opinion to the reason of why this is so.

In [classical logic](https://en.wikipedia.org/wiki/Classical_logic), with its intended semantics, [the truth values are true (denoted by 1 or the *verum* **⊤**), and untrue or false (denoted by 0 or the *falsum* **⊥**)](https://en.wikipedia.org/wiki/Truth_value#Classical_logic)

[Propositional Logic Truth Table](https://dyclassroom.com/boolean-algebra/propositional-logic-truth-table): We denote the value true as 1 and value false as 0.

That is just a codification of the human way of thinking that `nothing/empty` is closer to `false`.

That description got [encoded in the c language](https://stackoverflow.com/questions/37291681/does-the-c-standard-explicitly-indicate-truth-value-as-0-or-1)

But having only one value (`0`) for an exit status of error seemed too constricting, the logic got reversed, and the (`0`) was changed to **success**, leaving many more codes for the several possible reasons of error. That is how it is used in the shell.
I can only think of this rationale and it seems quite strong to me.

The easiest way to translate boolean operations into computer arithmetic is to use `0` for `FALSE` and `1` for `TRUE`, and then all the operations with them make perfect sense, i.e.

```
TRUE  && TRUE =  TRUE  ( 1 * 1 = 1)
TRUE  && FALSE = FALSE ( 1 * 0 = 0)
TRUE  || FALSE = TRUE  ( 1 + 0 = 1)
FALSE || FALSE = FALSE ( 0 + 0 = 0)

```

And so on and so forth.

At the same time programs need multiple exit statuses to report various errors. It's logical to make the correct exit status as `0`, and then use the remaning 255 (unsigned char) as bad exit statuses.

Now of course, `1` could have been made the good exit status but then the bad ones would have become a torn array of `0` and `2..555` which is very illogical.