Subject: bug#76244: Shepherd does not support UTF-8 in the log output

From: Tomas Volf <[email-masked]>
Date: Thu, 13 Feb 2025 00:46:48 +0100

Hi :)

Shepherd does not seem to support UTF-8 output (Japanese in my case) in
the log output.  I noticed the issue with timers, but can be reproduced
with transient as well:

--8<---------------cut here---------------start------------->8---
$ herd spawn transient -- $(which sh) -c 'echo "猫"'
Spawning transient service for ("/run/current-system/profile/bin/sh" "-c" "echo \"???\"").
Service user-homes has been started.
Starting service transient-252...
Service transient-252 started.
Service transient-252 running with value #<<process> id: 1314 command: ("/run/current-system/profile/bin/sh" "-c" "echo \"???\"")>.
Service transient-252 has been started.
$ tail -f /var/log/messages
Feb 12 23:43:31 localhost shepherd[1]: Service user-homes has been started. 
Feb 12 23:43:31 localhost shepherd[1]: Service user-homes started. 
Feb 12 23:43:31 localhost shepherd[1]: Service user-homes running with value #t. 
Feb 12 23:43:31 localhost shepherd[1]: Starting service transient-252... 
Feb 12 23:43:31 localhost shepherd[1]: Service transient-252 started. 
Feb 12 23:43:31 localhost shepherd[1]: Service transient-252 running with value #<<process> id: 1314 command: ("/run/current-system/profile/bin/sh" "-c" "echo \"???\"")>. 
Feb 12 23:43:31 localhost shepherd[1]: Service transient-252 has been started. 
Feb 12 23:43:31 localhost shepherd[1]: sh[1314] ??? 
Feb 12 23:43:31 localhost shepherd[1]: Service transient-252 has been disabled. 
Feb 12 23:43:31 localhost shepherd[1]: Transient service transient-252 terminated, now unregistered. 
--8<---------------cut here---------------end--------------->8---

Notice the `???' in output from both commands.  Neither the `herd spawn'
output nor the /var/log/message contain correct Japanese character.

Have a nice day,
Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.