diff --git a/package_linter.py b/package_linter.py index edda9cb..26f86bd 100755 --- a/package_linter.py +++ b/package_linter.py @@ -2548,6 +2548,14 @@ class Script(TestSuite): "Please do not use 'systemctl start' to start services. Instead, you should use 'ynh_systemd_action' which will display the service log in case it fails to start. You can also use '--line_match' to wait until some specific word appear in the log, signaling the service indeed fully started." ) + @test() + def bad_line_match(self): + + if self.containsregex(r'--line_match=Started$') or self.containsregex(r'--line_match=Stopped$'): + yield Warning( + 'Using --line_match="Started" or "Stopped" in ynh_systemd_action is counter productive because it will match the systemd message and not the actual app message ... Please check the log of the service to find an actual, relevant message to match, or remove the --line_match option entirely' + ) + @test() def quiet_systemctl_enable(self):