Lines Matching refs:stream
39 #include "journald-stream.h"
147 return log_warning_errno(errno, "Failed to stat connected stream: %m");
149 /* We use device and inode numbers as identifier for the stream */
225 return log_error_errno(r, "Failed to save stream data %s: %m", s->state_file);
376 /* Try to save the stream, so that journald can be restarted and we can recover */
384 assert_not_reached("Unknown stream state");
445 log_error("Got invalid event from epoll for stdout stream: %"PRIx32, revents);
455 log_warning_errno(errno, "Failed to read from stream: %m");
477 _cleanup_(stdout_stream_freep) StdoutStream *stream = NULL;
483 stream = new0(StdoutStream, 1);
484 if (!stream)
487 stream->fd = -1;
488 stream->priority = LOG_INFO;
490 r = getpeercred(fd, &stream->ucred);
495 r = getpeersec(fd, &stream->label);
502 r = sd_event_add_io(s->event, &stream->event_source, fd, EPOLLIN, stdout_stream_process, stream);
504 return log_error_errno(r, "Failed to add stream to event loop: %m");
506 r = sd_event_source_set_priority(stream->event_source, SD_EVENT_PRIORITY_NORMAL+5);
510 stream->fd = fd;
512 stream->server = s;
513 LIST_PREPEND(stdout_stream, s->stdout_streams, stream);
517 *ret = stream;
519 stream = NULL;
557 static int stdout_stream_load(StdoutStream *stream, const char *fname) {
566 assert(stream);
569 if (!stream->state_file) {
570 stream->state_file = strappend("/run/systemd/journal/streams/", fname);
571 if (!stream->state_file)
575 r = parse_env_file(stream->state_file, NEWLINE,
581 "IDENTIFIER", &stream->identifier,
582 "UNIT", &stream->unit_id,
585 return log_error_errno(r, "Failed to read: %s", stream->state_file);
592 stream->priority = p;
598 stream->level_prefix = r;
604 stream->forward_to_syslog = r;
610 stream->forward_to_kmsg = r;
616 stream->forward_to_console = r;
623 StdoutStream *stream;
631 log_warning("Too many stdout streams, refusing restoring of stream.");
635 r = stdout_stream_install(s, fd, &stream);
639 stream->state = STDOUT_STREAM_RUNNING;
640 stream->fdstore = true;
643 (void) stdout_stream_load(stream, fname);
684 log_debug("Cannot restore stream file %s", de->d_name);
777 log_error_errno(errno, "Failed to send stream file descriptor to service manager: %m");
779 log_debug("Successfully sent stream file descriptor to service manager.");