"invalid argument" error when reading from STDIN

Bug #1991382 reported by Ansgar Wiechers
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Logger
New
Undecided
Unassigned

Bug Description

When invoking the `logger` command on Ubuntu Jammy (bsdutils 2.37.2) with explicit PID and passing messages via STDIN

```
echo "some message" | logger -p local0.info --id="$$"
```

the command produces the following error:

> logger: send message failed: Invalid argument

The error does not appear when the message is passed as an argument:

```
logger -p local0.info --id="$$" "some message" # this works!
```

When using process substitution the error only appears for the first log message:

```
exec > >(logger -p local0.info --id="$$")
echo "first message" # throws error, message not logged
echo "second message" # no error, message logged correctly
```

The issue does not exist in older versions (e.g. Ubuntu Xenial, bsdutils 2.27.1).

Workaround: Omit `--id` and include the PID in a tag.

```
echo "some message" | logger -p local0.info -t "foo[$$]"
```

Revision history for this message
Ansgar Wiechers (awiechers) wrote (last edit ):

I just realized that this appears to be a different logger than the command I was reporting a bug for. I have now reported it in the (hopefully) correct tracker. Please disregard this one.

Sorry about the noise.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.