Bug 559518 - /etc/cron.weekly/98-zfs-fuse-scrub fails due to syntax errors
Summary: /etc/cron.weekly/98-zfs-fuse-scrub fails due to syntax errors
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: zfs-fuse
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Uwe Kubosch
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-28 11:23 UTC by N.Al-Rawi
Modified: 2010-07-13 07:27 UTC (History)
1 user (show)

Fixed In Version: zfs-fuse-0.6.9-5.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-07-09 05:55:52 UTC


Attachments (Terms of Use)

Description N.Al-Rawi 2010-01-28 11:23:10 UTC
Description of problem:
The script "/etc/cron.weekly/98-zfs-fuse-scrub" fails with the following errors:

/etc/cron.weekly/98-zfs-fuse-scrub: line 14: list: command not found
Found these pools:
/etc/cron.weekly/98-zfs-fuse-scrub: line 23: unexpected EOF while looking for matching `"'
/etc/cron.weekly/98-zfs-fuse-scrub: line 24: syntax error: unexpected end of file


Version-Release number of selected component (if applicable):
zfs-fuse-0.6.0-6.fc11.x86_64

How reproducible:
100% - Script fails each time it is run.

Steps to Reproduce:
1. /etc/cron.weekly/98-zfs-fuse-scrub
2. observe errors
  
Actual results:
zfs scrub fails to run, script returns the following errors:

/etc/cron.weekly/98-zfs-fuse-scrub: line 14: list: command not found
Found these pools:
/etc/cron.weekly/98-zfs-fuse-scrub: line 23: unexpected EOF while looking for matching `"'
/etc/cron.weekly/98-zfs-fuse-scrub: line 24: syntax error: unexpected end of file

Expected results:
zfs scrub to run on the available zpool(s)


Additional info:
The immediate problem appears to be due to missing backticks on line 14 when declaring the 'pools' variable:

  pools=$zpool list -H | cut -f1

However, there is no error checking performed after the declaration. Seeing as ZFS_WEEKLY_SCRUB is set to "yes" by default if zfs-fuse is installed but there are no pools defined the script will blindly continue anyway - not really ideal.

Finally, the last line is missing a double quote to close the echo statement.

Comment 1 Uwe Kubosch 2010-01-28 17:10:09 UTC
Thank you for the report!

The backticks and quotes have been fixed and will be released within a week.

If no pools are found, the "for" loop has no iterations.  Would you like a better message?

Comment 2 N.Al-Rawi 2010-01-28 17:36:18 UTC
(In reply to comment #1)
> Thank you for the report!
> 
> The backticks and quotes have been fixed and will be released within a week.

Awesome! Thanks!

> If no pools are found, the "for" loop has no iterations.  Would you like a
> better message?    

Ah yes, of course. Except, with the backticks and quotes fixed, the output when not finding any pools is:

Found these pools:
ZFS Fuse automatic scrub start done.  Use '/usr/bin/zpool status' to see progress.

Which implies that it still ran the scrub - which isn't correct.

As this is run via cron and any output is ultimately emailed to 'root' I would only really expect to see output if something bad had happened. Does that sound sensible?

Comment 3 Uwe Kubosch 2010-01-29 13:51:17 UTC
So, I'll change the output to "No pools found."

Only sending output if there was a problem is sensible.  Do I have to solve this in the script, or does cron have a mechanism for this?

Comment 4 Uwe Kubosch 2010-01-29 13:56:56 UTC
Changed the script to have no output if no pools are found.

Comment 5 N.Al-Rawi 2010-01-29 15:46:59 UTC
(In reply to comment #4/3)

> Changed the script to have no output if no pools are found.
Thanks!

> Only sending output if there was a problem is sensible.  Do I have to solve
> this in the script, or does cron have a mechanism for this?    

All cron will do is email all output from the script to the cron owner. Generally, when things go wrong, the command being run will let you know. So in the case of your script, you could probably get away with removing any 'echo' statements and let the 'zpool' command report back if it can't run.

Comment 6 Bug Zapper 2010-04-28 11:46:35 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Fedora Update System 2010-05-17 21:34:19 UTC
zfs-fuse-0.6.9-0.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9-0.fc12

Comment 8 Fedora Update System 2010-05-18 21:51:20 UTC
zfs-fuse-0.6.9-0.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update zfs-fuse'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9-0.fc12

Comment 9 Fedora Update System 2010-05-22 20:53:38 UTC
zfs-fuse-0.6.9_beta3-0.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9_beta3-0.fc12

Comment 10 Fedora Update System 2010-05-22 23:50:12 UTC
zfs-fuse-0.6.9_beta3-6.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9_beta3-6.fc13

Comment 11 Fedora Update System 2010-05-23 07:58:45 UTC
zfs-fuse-0.6.9_beta3-0.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9_beta3-0.el5

Comment 12 Fedora Update System 2010-05-24 19:17:11 UTC
zfs-fuse-0.6.9_beta3-0.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update zfs-fuse'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9_beta3-0.el5

Comment 13 Fedora Update System 2010-05-24 19:33:09 UTC
zfs-fuse-0.6.9_beta3-6.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update zfs-fuse'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9_beta3-6.fc13

Comment 14 Fedora Update System 2010-05-24 19:47:46 UTC
zfs-fuse-0.6.9_beta3-0.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update zfs-fuse'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9_beta3-0.fc12

Comment 15 Fedora Update System 2010-07-04 01:06:45 UTC
zfs-fuse-0.6.9-2.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9-2.fc13

Comment 16 Fedora Update System 2010-07-04 01:09:40 UTC
zfs-fuse-0.6.9-2.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9-2.fc12

Comment 17 Fedora Update System 2010-07-04 13:58:25 UTC
zfs-fuse-0.6.9-4.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9-4.fc12

Comment 18 Fedora Update System 2010-07-04 14:36:56 UTC
zfs-fuse-0.6.9-4.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9-4.fc13

Comment 19 Fedora Update System 2010-07-04 21:49:52 UTC
zfs-fuse-0.6.9-5.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9-5.fc13

Comment 20 Fedora Update System 2010-07-04 21:51:44 UTC
zfs-fuse-0.6.9-5.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9-5.fc12

Comment 21 Fedora Update System 2010-07-06 17:20:48 UTC
zfs-fuse-0.6.9-5.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update zfs-fuse'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9-5.fc12

Comment 22 Fedora Update System 2010-07-06 17:22:36 UTC
zfs-fuse-0.6.9-5.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update zfs-fuse'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/zfs-fuse-0.6.9-5.fc13

Comment 23 Fedora Update System 2010-07-09 05:55:42 UTC
zfs-fuse-0.6.9_beta3-0.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2010-07-13 07:24:06 UTC
zfs-fuse-0.6.9-5.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2010-07-13 07:27:03 UTC
zfs-fuse-0.6.9-5.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.