Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not handling all possible output in last login component #23

Closed
taylorthurlow opened this issue Nov 6, 2018 · 0 comments
Closed

Not handling all possible output in last login component #23

taylorthurlow opened this issue Nov 6, 2018 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@taylorthurlow
Copy link
Owner

I just installed a Ubuntu 18.04 LTS and tried setting up panda-motd - but it crashed complaining about the last_login component not being able to parse a date. Upon inspection, the results of the command:

last --time-format=iso taylor

are

taylor   pts/2        tmux(14328).%2   2018-11-05T16:04:53-0800   gone - no logout
taylor   pts/2        tmux(14328).%1   2018-11-05T16:02:57-0800 - 2018-11-05T16:03:24-0800  (00:00)
taylor   pts/1        tmux(14328).%0   2018-11-05T16:00:25-0800   gone - no logout
taylor   pts/3        tmux(13667).%1   2018-11-05T16:00:09-0800 - 2018-11-05T16:00:22-0800  (00:00)
taylor   pts/1        tmux(13667).%0   2018-11-05T15:59:09-0800 - 2018-11-05T16:00:19-0800  (00:01)
taylor   pts/1        tmux(13582).%0   2018-11-05T15:59:01-0800 - 2018-11-05T15:59:08-0800  (00:00

The - in the gone - no logout section is what breaks the regex search. On top of that, we were basically assuming that that section of the log would only be "still logged in" or a valid date. I'm going to play with the regex a bit to get it to match the entire section, and handle whatever messages show up in that column.

@taylorthurlow taylorthurlow added the bug Something isn't working label Nov 6, 2018
@taylorthurlow taylorthurlow self-assigned this Nov 6, 2018
taylorthurlow added a commit that referenced this issue Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant