Skip to content

man pages, journald: document the relationship between journald restarts, stdout/stderr log stream termination and SIGPIPE #6620

@AndriiNikitin

Description

@AndriiNikitin

Submission type

  • Bug report

systemd version the issue has been seen with

systemd-233-6.fc26.x86_64

Used distribution

Fedora 26 (Server Edition)

In case of bug report: Expected behaviour you didn't see

my service's messages in journal

In case of bug report: Unexpected behaviour you saw

In case of bug report: Steps to reproduce the problem

Issue is similar to https://bugs.freedesktop.org/show_bug.cgi?id=84923

$ cat /a.sh
#!/bin/bash
while true ; do sleep 5; echo still alive ; done
$ cat /etc/systemd/system/a.service
[Unit]
Description=stillalive

[Service]
User=myuser
ExecStart=/a.sh

[Install]
WantedBy=multi-user.target

So I configured simple service above, started it as below and see expected messages every 5 sec in journal:

$ sudo systemctl start a
$ sudo systemctl status a
● a.service - stillalive
   Loaded: loaded (/etc/systemd/system/a.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2017-08-15 16:16:01 UTC; 19s ago
 Main PID: 1391 (a.sh)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/a.service
           ├─1391 /bin/bash /a.sh
           └─1404 sleep 5

Aug 15 16:16:01 fedora26-amd64 systemd[1]: Started stillalive.
Aug 15 16:16:06 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:16:11 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:16:16 fedora26-amd64 a.sh[1391]: still alive

Now I restart journal and new messages are not arriving to journal until my custom service is restarted again:

$ sudo systemctl stop systemd-journald
Warning: Stopping systemd-journald.service, but it can still be activated by:
  systemd-journald.socket
  systemd-journald-dev-log.socket
  systemd-journald-audit.socket
$ sudo systemctl status a
● a.service - stillalive
   Loaded: loaded (/etc/systemd/system/a.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2017-08-15 16:16:01 UTC; 5min ago
 Main PID: 1391 (a.sh)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/a.service
           ├─1391 /bin/bash /a.sh
           └─1498 sleep 5

Aug 15 16:20:21 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:26 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:31 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:36 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:41 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:46 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:51 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:56 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:21:01 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:21:06 fedora26-amd64 a.sh[1391]: still alive
$ sudo systemctl status a
● a.service - stillalive
   Loaded: loaded (/etc/systemd/system/a.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2017-08-15 16:16:01 UTC; 7min ago
 Main PID: 1391 (a.sh)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/a.service
           ├─1391 /bin/bash /a.sh
           └─1528 sleep 5

Aug 15 16:20:21 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:26 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:31 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:36 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:41 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:46 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:51 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:20:56 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:21:01 fedora26-amd64 a.sh[1391]: still alive
Aug 15 16:21:06 fedora26-amd64 a.sh[1391]: still alive

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions