"pebble logs" does not show logs of short-running / failing processes #495
Labels
25.04
Planned for the 25.04 cycle
Bug
An undesired feature ;-)
Low Priority
The opposite of "Priority"
The command
pebble logs
doesn't capture stdout/stderr of short-running (kind of "oneshot") processes. The output of the service is only visible by inspecting the task of the "start" change.How to reproduce
With a fresh Pebble checkout, build the binary:
In one terminal session, run Pebble with an empty pebble dir:
In another terminal session, create a new file
test.yaml
:Then, add this layer to the Pebble plan (of the running instance) and start it:
The
pebble start
command prints:And trying to retrieve the log files produces empty output:
However, changing the command to something that doesn't immediately exit makes Pebble properly take care of the process and capture its output (restart the Pebble daemon and run the above steps with the updated
test.yaml
from here):As especially the cases where the service fails to start are the "interesting" ones, having
pebble logs
output something in those cases would be nice. If not, maybe the command-line help of "pebble logs" should be updated to notice that logs are only captured for successfully-running services, not for failing services(?).Doing a
pebble changes
and noticing the failed change ID and then runningpebble tasks <change-id>
(e.g.pebble tasks 1
) DOES show the service output.In any case, a service exiting with exit status 0 may in some cases be considered "successful" (maybe with a kind of "oneshot" service type?), and still cause
pebble logs
to contain its output?The text was updated successfully, but these errors were encountered: