[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Welcome to emergency mode!



On Wed 10 Feb 2016 at 12:41:21 (-0700), Bob Holtzman wrote:
> On Tue, Feb 09, 2016 at 10:54:30PM +0000, Brian wrote:
> > On Tue 09 Feb 2016 at 14:50:40 -0700, Bob Holtzman wrote:
> > 
> > > On Mon, Feb 08, 2016 at 05:52:27PM -0600, John Hasler wrote:
> > > > Bob Holtzman writes:
> > > > > As root journalctl produces a long list, tail journalctl produces 
> > > > 
> > > > > "tail: cannot open ‘journalctl’ for reading: No such file or directory".
> > > > 
> > > > > Now I'm really confused. Any explanation?
> > > > 
> > > > journalctl is a program for querying the systemd journal.  tail is a
> > > > tool to output the last part of a file.
> > > > 
> > > > man journalctl
> > > > 
> > > > man tail
> > > 
> > > Of course. What's your point?
> > 
> > The tail *command* operates *on files*. It opens the file and displays
> > the last 10 lines of it. (I think we both agree on that because we have
> > read the same manual).
> > 
> >   tail journalctl
> > 
> > attempts to open a file with the name journalctl in your home directory.
> > (As the output tells you - it does not exist).
> > 
> > If the file is not in your home directory you have to inform tail where
> > it is by giving the full path. Like so:
> > 
> >   tail /bin/journalctl
> 
> Ouch. I missed that. It raises a new question. I've read that *spit*
> systemd doesn't write logs that are human readable, however, "tail
> journalctl" as root does. As user the output is unreadable (binary?).

Your problems are scattered throughout this thread, but I'll only post here.

Summarising:

# journalctl

will produce a list of lines from the systemd journal (no need to spit).

# cd
# tail journalctl

will respond
tail: cannot open ‘journalctl’ for reading: No such file or directory
unless you just happen to have a text file called journalctl in root's
home directory (normally /root).

Ditto for any user.

# tail /bin/journalctl

will, as you said, produce garbage because you have _run_ the program
/usr/bin/tail (sensible) to _print_ the last 10 lines of the executable
binary program /bin/journalctl (not sensible).

Dutch has already posted the correct way to print the last 20 lines
of the journal (non-interactively) with    journalctl | tail -n 20
and Felix has already posted that you can study the journal
interactively by running the   journalctl   command on its own.

If those don't work for you, please cut and paste your commands and
their output into your email, which is what John asked for.

I hope you eventually get to study the journal even if you don't have
/var/log/journal. You might post the output from:

$ ls -ld /var/log/j*

Cheers,
David.


Reply to: