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

fix journalctl --since #865

Closed
wants to merge 1 commit into from
Closed

fix journalctl --since #865

wants to merge 1 commit into from

Conversation

yalh76
Copy link
Contributor

@yalh76 yalh76 commented Dec 30, 2019

The problem

Difficult to explain, as it's more sensations and difficult to reproduce...

Sometime you try to install a package and even if the service is started and the line_match can be found in journalctl, ynh_systemd_action doesn't detect it.

Same during package_check with services fail to starts but start during manual installation

Solution

Diving in ynh_systemd_action and in journalctl arguments. It seems that --since=-0 is documented nowhere

PR Status

Ready

How to test

Make some install and check what happens :/

Validation

  • Principle agreement 0/2 :
  • Quick review 0/1 :
  • Simple test 0/1 :
  • Deep review 0/1 :

@Josue-T
Copy link
Contributor

Josue-T commented Dec 31, 2019

Hello,

I also detected sometime that this helper is sometime a little bit buggy. Mainly with gitea so without systemd.

Did you see that your patch fix your issue ?

@maniackcrudelis
Copy link
Contributor

--since=-0 is since minus 0 seconds.
Just tried the command, it works the exact same way with -0 and now

Are you sure that's the issue you had ?

@yalh76
Copy link
Contributor Author

yalh76 commented Dec 31, 2019

I'm like 95% of the issue I had but no proof, no logs, no screenshot, nothing....

I can just tell the conditions...

I was working on YunoHost-Apps/distbin_ynh#52 => applying last example_ynh on distbin_ynh

As I worked like a barbarian, change_url script wasn't working.... And as I didn't took time to read all logs, I decided to test manually change_url on distbin_ynh

I applied a snapshot and started a virtual machine, launch three ssh windows with a command for each one:

  1. $ yunohost app install distbin --debug
  2. $ journalctl -u distbin -fe
  3. $ journalctl -u nginx-fe

like that:
image

At the end of the install, ynh_systemd_action was waiting distbin service start... but in the $ journalctl -u distbin -fe windows I seen that the disbin service was really started. So I launch a fourth ssh to execute $ service distbin restart and the package installation ended well.

I have seen that a few times on different packages but wasn't able to reproduce systematically...

I will try to make additional tests. and let you know.

@maniackcrudelis
Copy link
Contributor

maniackcrudelis commented Dec 31, 2019

The thing is, using --since=-0 as well as --since="now" will just start to follow the log with no lines before.

The behavior is the same, as said before, between now and 0s before now.
So I really think the problem is elsewhere.

You should probably try to follow $templog as well in a separate terminal to see if the helper really miss something.

Also, instead of a sleep 60, you can use the timeout option of ynh_systemd_action.

@yalh76
Copy link
Contributor Author

yalh76 commented Jan 30, 2020

I wasn't able to reproduce systematically. So closing for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants