portupgrade -aF hanging under cron on FreeBSD 10 with pkgng

Mark Knight lists at knigma.org
Sat Feb 15 09:26:09 UTC 2014


For a few years I've used a very simple cron to update my ports. Every morning I get a friendly mail with the outcome.

/etc/crontab:
15      4       *       *       *       root    /home/root/cvsup_update

/home/root/cvsup_update:
#!/bin/sh
/bin/date
cd /usr/ports
sudo -u cvsupin svnsync sync file:///home/freebsd-svn/base
sudo -u cvsupin svnsync sync file:///home/freebsd-svn/ports
sudo -u cvsupin svnsync sync file:///home/freebsd-svn/doc
svn up
/usr/local/sbin/portsdb -uU
/usr/local/sbin/portupgrade -a -F
/usr/local/sbin/portversion -v | grep -v "up-to-date"
/bin/date

Since upgrading to FreeBSD 10 and migrating to pkgng (at the same time), I noticed the mails stopped. Upon investigating the script is hanging at "portupgrade -a -F" when some ports need updating.

Using "kill" a couple of times to free up the job, I eventually get the following mail:

	see: http://www.knigma.org/scratch/home_root_cvsup_update_cronmail.txt

Before killing the job to get the mail I ran ps, here are the relevant processes after the job had been stuck for several hours:

USER         PID  PPID  PGID   SID JOBC STAT TT        TIME COMMAND
root       62559  1530  1530  1530    0 I     -     0:00.01 cron: running job (cron)
root       62562 62559 62562 62562    0 IWs   -     0:00.00 /bin/sh /home/root/cvsup_update
root       84862 62562 62562 62562    0 I     -     0:03.24 ruby19: portupgrade: [1/4] png-1.5.17 (ruby19)
root       98047 84862 62562 62562    0 I     -     0:00.02 /usr/bin/script -qa /tmp/portupgrade20140215-84862-ayw6np env UPGRADE_TOOL=portupgrade UPGRADE_PORT=png-1.5.17 UPGRADE_PORT_VER=1.5.17 make FETCH_BEFORE_ARGS=-q -DBATCH checksum
root       98048 98047 98048 98048    0 IEs+  1-    0:00.01 make FETCH_BEFORE_ARGS=-q -DBATCH checksum

If I run portupgrade -a -F at the shell prompt everything is fine - but this helps to illustrate where the cron is misbehaving.

mkn at shrewd$ sudo portupgrade -a -F
[Reading data from pkg(8) ... - 854 packages found - done]
--->  Fetching the distfile(s) for 'png-1.5.18' (graphics/png)
--->  Fetching '/usr/ports/graphics/png'
===>  Found saved configuration for png-1.5.12
===>   png-1.5.18 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by png-1.5.18 for building
=> SHA256 Checksum OK for libpng-1.5.18.tar.xz.
=> SHA256 Checksum OK for libpng-1.5.18-apng.patch.gz.
--->  Fetching the distfile(s) for 'p5-CPAN-Meta-YAML-0.011' (devel/p5-CPAN-Meta-YAML)
--->  Fetching '/usr/ports/devel/p5-CPAN-Meta-YAML'
===>  License ART10 GPLv1 accepted by the user
===>   p5-CPAN-Meta-YAML-0.011 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by p5-CPAN-Meta-YAML-0.011 for building
=> SHA256 Checksum OK for CPAN-Meta-YAML-0.011.tar.gz.
--->  Fetching the distfile(s) for 'libfpx-1.3.1.4' (graphics/libfpx)
--->  Fetching '/usr/ports/graphics/libfpx'
===>   libfpx-1.3.1.4 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by libfpx-1.3.1.4 for building
=> SHA256 Checksum OK for libfpx-1.3.1-4.tar.xz.
--->  Fetching the distfile(s) for 'dejavu-2.34_2' (x11-fonts/dejavu)
--->  Fetching '/usr/ports/x11-fonts/dejavu'
===>  Found saved configuration for dejavu-2.33
===>   dejavu-2.34_2 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by dejavu-2.34_2 for building
=> SHA256 Checksum OK for dejavu-fonts-ttf-2.34.tar.bz2.
mkn at shrewd$

I'd appreciate any thoughts on why this is getting stuck please?

Thanks!
-- 
Mark Knight
Mobile: +44 7753 250584.  http://www.knigma.org/
Email: markk at knigma.org.  Skype: knigma


More information about the freebsd-ports mailing list