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

functions: fix run_task #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

functions: fix run_task #119

wants to merge 1 commit into from

Conversation

amartinz
Copy link

@amartinz amartinz commented May 8, 2024

The if statement was missing the then keyword, preventing any services to run.

shellcheck

In /usr/share/btrfsmaintenance/btrfsmaintenance-functions line 101:
	else
        ^-- SC1009 (info): The mentioned syntax error was in this else clause.


In /usr/share/btrfsmaintenance/btrfsmaintenance-functions line 104:
		if /usr/bin/flock --help 2>&1 | grep -q -- --verbose;
                ^-- SC1049 (error): Did you forget the 'then' for this 'if'?
                ^-- SC1073 (error): Couldn't parse this if expression. Fix to allow more checks.


In /usr/share/btrfsmaintenance/btrfsmaintenance-functions line 106:
		fi
                ^-- SC1050 (error): Expected 'then'.
                  ^-- SC1072 (error): Unexpected keyword/token. Fix any mentioned problems and try again

Fedora 40

#> systemctl status btrfs-scrub.service 
○ btrfs-scrub.service - Scrub btrfs filesystem, verify block checksums
     Loaded: loaded (/usr/lib/systemd/system/btrfs-scrub.service; static)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: inactive (dead) since Wed 2024-05-08 07:54:13 CEST; 7s ago
   Duration: 11ms
TriggeredBy: ● btrfs-scrub.timer
       Docs: man:fstrim
    Process: 19500 ExecStart=/usr/share/btrfsmaintenance/btrfs-scrub.sh (code=exited, status=0/SUCCESS)
   Main PID: 19500 (code=exited, status=0/SUCCESS)
        CPU: 10ms

Mai 08 07:54:13 THREADRIPPER-3970X.localdomain systemd[1]: Started btrfs-scrub.service - Scrub btrfs filesystem, verify block checksums.
Mai 08 07:54:13 THREADRIPPER-3970X.localdomain btrfs-scrub.sh[19500]: /usr/share/btrfsmaintenance/btrfsmaintenance-functions: line 106: syntax error near unexpected token `fi'
Mai 08 07:54:13 THREADRIPPER-3970X.localdomain btrfs-scrub.sh[19500]: /usr/share/btrfsmaintenance/btrfsmaintenance-functions: line 106: `                fi'
Mai 08 07:54:13 THREADRIPPER-3970X.localdomain btrfs-scrub.sh[19509]: Running scrub on /
Mai 08 07:54:13 THREADRIPPER-3970X.localdomain btrfs-scrub.sh[19509]: /usr/share/btrfsmaintenance/btrfs-scrub.sh: line 43: run_task: command not found
Mai 08 07:54:13 THREADRIPPER-3970X.localdomain btrfs-scrub.sh[19509]: Scrub cancelled at /
Mai 08 07:54:13 THREADRIPPER-3970X.localdomain systemd[1]: btrfs-scrub.service: Deactivated successfully.

The if statement was missing the then keyword, preventing any services to run.

Fixes: 0cc1772 ("functions: detect if flock --verbose support from help text")
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant