Bug 29220

Summary: packagekit-background.cron should not exit with 1 if it's disabled
Product: PackageKit Reporter: Vincent Untz <vuntz>
Component: GeneralAssignee: Richard Hughes <richard>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch

Description Vincent Untz 2010-07-22 10:26:21 UTC
There's this code in packagekit-background.cron:

 # are we disabled?
 if [ "$ENABLED" = "no" ]; then
       exit 1
 fi

We should not exit with 1 since this will trigger a mail, I think. We should just exit with 0 if we're disabled.
Comment 1 Richard Hughes 2010-07-23 01:00:25 UTC
Isn't code zero exit code success? I admit also I don't know a tremendous amount about cron.
Comment 2 Vincent Untz 2010-07-23 01:14:34 UTC
Yes, 0 is success. The thing is that packagekit-background.cron will be run daily anyway. If it's disabled, then the script just returns. If it returns 1, then a mail will be sent to the admin. If it returns 0, then nothing happens.

If the admin has disabled the script explicitly, we certainly don't want him to receive a mail to tell him so :-)
Comment 3 Richard Hughes 2010-07-23 01:15:37 UTC
Makes sense. Please feel free to commit a fix straight to PK git master. Thanks!
Comment 4 Vincent Untz 2010-07-23 01:28:13 UTC
Created attachment 37327 [details] [review]
Patch

Apparently, I can't push to master (not sure why), so here's the git patch.
Comment 5 Richard Hughes 2010-07-23 01:40:16 UTC
Pushed to git master. Thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.