Bug 29220 - packagekit-background.cron should not exit with 1 if it's disabled
Summary: packagekit-background.cron should not exit with 1 if it's disabled
Alias: None
Product: PackageKit
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Richard Hughes
QA Contact:
Depends on:
Reported: 2010-07-22 10:26 UTC by Vincent Untz
Modified: 2010-07-23 01:40 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

Patch (779 bytes, patch)
2010-07-23 01:28 UTC, Vincent Untz
Details | Splinter Review

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

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]

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.