[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ezjail] Non-interactive use of ezjail-admin update -P

Perhaps a short script like this would do the job for you:


/usr/sbin/portsnap cron
/usr/sbin/portsnap update
/usr/sbin/portsnap -p /path/to/basejail/usr/ports update

On Jun 4, 2007, at 5:19 AM, Alexandros Kosiaris wrote:

Hello to all,

If you have ever tried to run ezjail-admin update -P non- interactively,
for example from cron or like in

$ ssh mymachine ezjail-admin update -P

you will have received an error from portsnap which points out that
portsnap should not be run non-interactively. Now if i am not mistaken I
have read that this had been fixed quite some time ago however i could
not find the fix and it is obviously not in the freebsd ports tree. The
following patch i attach solves this little problem

--- ezjail-2.0.1/ezjail-admin   Mon Jul 24 14:07:58 2006
+++ ezjail-2.0.1-new/ezjail-admin       Mon Jun  4 13:12:56 2007
@@ -145,7 +145,11 @@
     echo "Gathering local information may take a while."
     cd ${ezjail_jailbase}/usr/ports/ && cvs -d ${ezjail_portscvsroot}
up -Pd
-    portsnap fetch
+    if ! [ -t 0 ]; then
+      portsnap cron
+    else
+      portsnap fetch
+    fi
[ -d ${ezjail_jailbase}/usr/ports ] && ezjail_portsnapaction=update
     portsnap -p ${ezjail_jailbase}/usr/ports

Keep up the good work guys.

Alexandros Kosiaris 	Network Management Center , NTUA
e-mail : alex AT noc.ntua DOT gr
Public Key Fingerprint :
D6B1 0634 BE65 719C 6C95  7492 8201 4B46 C478 F074

george donnelly ~ High Speed Rails inc. ~ highspeedrails.com
Managed Open-Source Hosting ~ Plone Hosting ~ Full Support
Yahoo/AIM: highspeedrails   ~   Voice: 1-800-969-1452