Description of problem: a cron process does not run silently due to insufficient assumption checking Version-Release number of selected component (if applicable): ghc-doc-index-7.6.3-26.4 How reproducible: 1. install: ghc-doc-index 2. fire off: /etc/cron.hourly/ghc-doc-index 3. read the result Steps to Reproduce: the diff fails to confirm that one comparand is present and non-null Actual results: noise to stderr Expected results: a silent process Additional info:
the test needs to be in file; /usr/bin/ghc-doc-index This line: DIR_DIFF=$(diff $PKGDIRCACHE $PKGDIRCACHE.new) something like DIR_DIFF=/dev/null [ -s $PKGDIRCACHE -a -s $PKGDIRCACHE.new ] && { DIR_DIFF=$(diff $PKGDIRCACHE $PKGDIRCACHE.new) }
Thanks for the report - I wish you had included the noise.
``` if [ -r "$PKGDIRCACHE" ]; then $LISTING */ > $PKGDIRCACHE.new DIR_DIFF=$(diff $PKGDIRCACHE $PKGDIRCACHE.new) else $LISTING */ > $PKGDIRCACHE fi ``` No sure how this can fail?
almost certainly a missing mkdir -p [root@centos-7 ~]# grep PKGDIRCACHE /etc/cron.hourly/ghc-doc-index [root@centos-7 ~]# less /etc/cron.hourly/ghc-doc-index [root@centos-7 ~]# grep PKGDIRCACHE /usr/bin/ghc-doc-index PKGDIRCACHE=/var/lib/ghc/pkg-dir.cache if [ -r "$PKGDIRCACHE" ]; then $LISTING */ > $PKGDIRCACHE.new ============ in ghc-doc-index, JUST AFTER: PKGDIRCACHE=/var/lib/ghc/pkg-dir.cache add a backstop check: PKGDIR=`dirname ${PKGDIRCACHE}` [ ! -d ${PKGDIR} ] && mkdir -p ${PKGDIR} and it should be fixed
Hmm I am not sure: /var/lib/ghc/ is owned by ghc-compiler-7.6.3-26.4.el7 https://koji.fedoraproject.org/koji/rpminfo?fileStart=200&rpmID=8405643&fileOrder=name&buildrootOrder=-id&buildrootStart=0#filelist
[herrold@centos-7 ~]$ rpm -qf /var/lib/ghc/ ghc-compiler-7.6.3-26.4.el7.x86_64 indeed -- is there a Dependency on that parent, or is that parent properly 'owning' that directory?
that seems like a lot of Dependency to drag in to satisfy a small package ghc-compiler Size : 79646724 ghc-doc-index Size : 199
I think I have improved this in the Fedora and Copr packages. Basically the little package requires the doc index script in ghc-compiler and all the docs are currently in devel subpackages which will pull in the compiler anyway.
I wonder if it is some permission issue you are seeing?
EPEL 7 entered end-of-life (EOL) status on 2024-06-30.\n\nEPEL 7 is no longer maintained, which means that it\nwill not receive any further security or bug fix updates.\n As a result we are closing this bug.