LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Anacron job 'cron.daily' (https://www.linuxquestions.org/questions/debian-26/anacron-job-cron-daily-579426/)

cccc 08-24-2007 05:06 AM

Anacron job 'cron.daily'
 
hi

I have etch stable and I'm getting the following root mails:
Code:

/etc/cron.daily/man-db:
mandb: warning: /usr/share/man/man1/ControlPanel.1.gz is a dangling symlink


Code:

# ls -la /usr/share/man/man1/ControlPanel.1.gz
ls: /usr/share/man/man1/ControlPanel.1.gz: No such file or directory

Code:

# cat /etc/cron.daily/man-db
#!/bin/sh
#
# man-db cron daily

set -e

if ! [ -d /var/cache/man ]; then
    # Recover from deletion, per FHS.
    mkdir -p /var/cache/man
    chown man:root /var/cache/man
    chmod 2755 /var/cache/man
fi

# expunge old catman pages which have not been read in a week
if [ -d /var/cache/man ]; then
  cd /
  if ! dpkg-statoverride --list /var/cache/man >/dev/null 2>&1; then
    chown -R man /var/cache/man || true        # just in case
  fi
  start-stop-daemon --start --pidfile /dev/null --startas /bin/sh \
        --oknodo --chuid man -- -c \
        "find /var/cache/man -type f -name '*.gz' -atime +6 -print0 | \
        xargs -r0 rm -f"
fi

# regenerate man database
if [ -x /usr/bin/mandb ]; then
    # --pidfile /dev/null so it always starts; mandb isn't really a daemon,
    # but we want to start it like one.
    start-stop-daemon --start --pidfile /dev/null \
                      --startas /usr/bin/mandb --oknodo --chuid man \
                      -- --no-purge --quiet
fi

exit 0

howto solve this problem ?

Axo 08-24-2007 07:19 AM

If that is the only entry that cron is whining about check what it's linking to and if it doesn't exist delete it.

yanik 08-24-2007 07:42 AM

a dangling symlink means it's not linked to anything, you can safely remove it.

cccc 08-27-2007 06:04 AM

Quote:

Originally Posted by yanik (Post 2869049)
a dangling symlink means it's not linked to anything, you can safely remove it.

thx, but where can I delete it ?

yanik 08-27-2007 07:09 AM

An easy way to deal with symlinks is to install 'symlinks' from the repos.

From the symlinks man page:
Code:

It scans directories for symbolic links and lists them on stdout, often revealing flaws in the filesystem tree.
and

Code:

-d    causes dangling links to be removed.

cccc 08-27-2007 07:15 AM

you mean, now it's OK ?
Code:

# symlinks -d
symlinks: scan/change symbolic links - v1.2 - by Mark Lord

Usage:  symlinks [-crsv] dirlist

Flags:  -c == change absolute/messy links to relative
        -d == delete dangling links
        -r == recurse into subdirs
        -s == shorten lengthy links
        -v == verbose (show all symlinks)


yanik 08-27-2007 07:37 AM

no, you have to tell it where to look for symlinks.

As root;

Code:

symlinks -d /

cccc 08-27-2007 08:34 AM

I've done:
Code:

symlinks -d /
other_fs: /initrd.img -> boot/initrd.img-2.6.18-5-686
other_fs: /vmlinuz -> boot/vmlinuz-2.6.18-5-686
other_fs: /initrd.img.old -> boot/initrd.img-2.6.18-4-686
other_fs: /vmlinuz.old -> boot/vmlinuz-2.6.18-4-686

you think, now shoud be OK ?

yanik 08-27-2007 08:39 AM

try your scrpit again :

Code:

/etc/cron.daily/man-db
And see if the error is gone.

cccc 08-27-2007 08:42 AM

I get no errors:
Code:

# /etc/cron.daily/man-db
#


cccc 08-28-2007 04:35 AM

thx a lot !

cccc 08-31-2007 04:01 AM

sorry, but this problem still exists.

if I'm doing:
Code:

# /etc/cron.daily/man-db
#

I don't get any errors, but still get these mails:
Code:

/etc/cron.daily/man-db:
mandb: warning: /usr/share/man/man1/ControlPanel.1.gz is a dangling symlink

any other ida, what's wrong ?

yanik 08-31-2007 07:05 AM

I don't know then. I would try to re-create the db as root with:

Code:

mandb -c

cccc 09-05-2007 05:37 AM

thx, it seems to work now.

cccc 05-20-2008 12:32 PM

what happens after this command:
Code:

# symlinks -r -d /
on debian ?


All times are GMT -5. The time now is 07:04 AM.