• Bug#265283: doesn't gracefully handle /var/log/cron-apt/status absence

    From Marc Haber@1:229/2 to All on Thu Aug 12 16:30:16 2004
    From: [email protected]

    Package: cron-apt
    Version: 0.0.26
    Severity: normal

    [28/526]mh@janeway:~/cron-apt/0.0.26$ sudo cron-apt -i -d /etc/cron-apt/config-hourly
    cat: /var/lib/cron-apt/status: No such file or directory
    cat: /var/lib/cron-apt/status: No such file or directory

    Looks like the file is only created in some cirumstances, but the cat
    command relies on it being present.

    Greetings
    Marc

    -- System Information:
    Debian Release: 3.1
    APT prefers unstable
    APT policy: (500, 'unstable'), (500, 'testing')
    Architecture: i386 (i686)
    Kernel: Linux 2.6.7-janeway
    Locale: LANG=C, LC_CTYPE=de_DE

    Versions of packages cron-apt depends on:
    ii apt 0.5.27 Advanced front-end for dpkg
    ii bash 3.0-5 The GNU Bourne Again SHell
    ii mailx 1:8.1.2-0.20040524cvs-1 A simple mail user agent

    -- no debconf information


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Marc Haber@1:229/2 to Marc Haber on Thu Aug 12 17:00:13 2004
    From: [email protected]

    On Thu, Aug 12, 2004 at 04:01:56PM +0200, Marc Haber wrote:
    [28/526]mh@janeway:~/cron-apt/0.0.26$ sudo cron-apt -i -d /etc/cron-apt/config-hourly
    cat: /var/lib/cron-apt/status: No such file or directory
    cat: /var/lib/cron-apt/status: No such file or directory

    Looks like the file is only created in some cirumstances, but the cat
    command relies on it being present.

    Replacing the useless use of cat with

    if echo $STATUS | grep exit > /dev/null 2>&1 ; then
    mailit
    exit
    fi

    looks like it solves the problem.

    Greetings
    Marc

    -- ----------------------------------------------------------------------------- Marc Haber | "I don't trust Computers. They | Mailadresse im Header Karlsruhe, Germany | lose things." Winona Ryder | Fon: *49 721 966 32 15 Nordisch by Nature | How to make an American Quilt | Fax: *49 721 966 31 29


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Ola Lundqvist@1:229/2 to Marc Haber on Thu Aug 12 21:10:09 2004
    From: [email protected]

    Hello

    On Thu, Aug 12, 2004 at 04:37:05PM +0200, Marc Haber wrote:
    On Thu, Aug 12, 2004 at 04:01:56PM +0200, Marc Haber wrote:
    [28/526]mh@janeway:~/cron-apt/0.0.26$ sudo cron-apt -i -d /etc/cron-apt/config-hourly
    cat: /var/lib/cron-apt/status: No such file or directory
    cat: /var/lib/cron-apt/status: No such file or directory

    Looks like the file is only created in some cirumstances, but the cat command relies on it being present.

    Replacing the useless use of cat with

    if echo $STATUS | grep exit > /dev/null 2>&1 ; then
    mailit
    exit
    fi

    looks like it solves the problem.

    It does not. If you echo $STATUS you get the filename. And you can not pass variables from within the { } to the outside. It is a "subshell". If you know
    a way to do that I'm very interested (except in ways that I already do that).

    I have fixed a way around this by the way.

    Regards,

    // Ola

    Greetings
    Marc

    -- ----------------------------------------------------------------------------- Marc Haber | "I don't trust Computers. They | Mailadresse im Header Karlsruhe, Germany | lose things." Winona Ryder | Fon: *49 721 966 32 15 Nordisch by Nature | How to make an American Quilt | Fax: *49 721 966 31 29


    --
    --------------------- Ola Lundqvist ---------------------------
    / [email protected] Annebergsslingan 37 \
    | [email protected] 654 65 KARLSTAD |
    | +46 (0)54-10 14 30 +46 (0)70-332 1551 |
    | http://www.opal.dhs.org UIN/icq: 4912500 |
    \ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 /
    ---------------------------------------------------------------


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)