How do I use journalctl from the root account to tail logs of a service running as a user ? I am using #podman #quadlets to manage containers using #systemd btw

Doing this:

journalctl --user --machine=containeruser@ -xeu helloworld.service

Gives me this error:

Failed to open root directory of machine 'containeruser@': No machine 'containeruser@' known
Failed to open journal: No such device or address

help!?

#linux #selfhosting #quadlet

Doing `machinectl shell containeruser@` logs me in properly

And then I can do `journalctl --user -f -xeu helloworld` which works fine and gives me the logs.

@eternaltyro machinectl shell can also take a command so you could append the second command to the first.

So:
`machinectl shell containeruser@ /usr/bin/journalctl --user -f - xeu helloworld`

(edited to fully-path command, add backticks)

@virtuous_sloth ooh thank you, that makes is useful and make things simpler. I'm still wondering why the machine switch doesn't work with journalctl though🤔
@eternaltyro Yeah, I don't quite understand that myself.