[ic] expireall and server --start fail to run in crontab (was: Where is checkstat.sh?)

Ed LaFrance edl@newmediaems.com
Tue, 13 Mar 2001 09:23:49 -0800


At 04:19 AM 03/13/2001 -0600, you wrote:
>It didn't work...don't I need root to su? Now what? I mean, it worked in 
>MV4.04 anyway...this is a crontab problem, correct? Do I need to speak 
>with my host or should I read a book? =)

Sounds like you definitely need to verify that you have cron privileges, 
many hosts do not allow it.  If you have a virtual hosting account (which I 
am guessing is the case), your cron jobs should normally run under your 
userid, so su should not be needed.

You might want to try something in the cron that would generate a file:

5,10,15,20,45,55 * * * * ls -l >~/dir.txt

Give it a few minutes, then look for a file called dir.txt in your home 
directory.  If it is not there, contact your host regarding you cron 
capabilities.

BTW - if you ultimate goal with cron is to restart IC if it dies, or the 
machine is rebooted, you might want to use this shell script (edit to suit):

#!/bin/sh
var=`ps ux | grep interchange | grep -v -c grep`
if [ $var -eq 0 ]; then
         /yourhomedir/interchange/bin/interchange -s
fi

If you save this in a file called "autostart" in your home dir and do a 
chmod 755 on it, your cron entry would then be:

5,10,15,20,45,55 * * * * ./autostart

--or --

5,10,15,20,45,55 * * * * sh ~/autostart

Test ./autostart on the command line (stop interchange before invoking) 
before entrusting it, but it should work; it only issues the interchange 
start command if IC is not already running.

- Ed L.





>-----Original Message-----
>From: interchange-users-admin@lists.akopia.com
>[mailto:interchange-users-admin@lists.akopia.com]On Behalf Of Dan B
>Sent: Monday, March 12, 2001 10:24 PM
>To: interchange-users@lists.akopia.com
>Subject: Re: [ic] expireall and server --start fail to run in crontab
>(was: Where is checkstat.sh?)
>
>
>Good troubleshooting, Curt.  Answer below...
>
>At 09:10 PM 3/12/2001 -0600, you wrote:
> >Thank you Dan. I believe this is what I need, however, I can't seem to
> >execute anything from my crontab for some reason. This may be a crontab
> >thing. I have tried:
> >
> >5,10,15,20,45,55 * * * * /home/myfiles/interchange/bin/interchange --start
> >
> >and
> >
> >5,10,15,20,45,55 * * * * /home/myfiles/interchange/bin/interchange --serve
> >
> >These both work when executed from /interchange as
> >
> >bin/interchange --start
> >
> >but not from cron. Any pointers out there? This crontab worked fine for
> >MV4.04 but not the IC4.6.3 tarball on Linux Mandrake 6.0. What could I
> >have screwed up? Nothing appears in error logs in either /interchange or
> >/catalogs/cat. It's like the crontab is not doing anything, although I
> >know it is because it fails this also:
> >
> >44 4 * * * /home/tgis/interchange/bin/expireall
> >
> >(or expireall -r)
> >
> >and reports to me via email as:
> >
> > >From root  Mon Mar 12 04:44:01 2001
> >Return-Path: <root>
> >Received: (from root@localhost)
> >         by myhost.com (8.9.3/8.8.7) id EAA16611
> >         for mylogin; Mon, 12 Mar 2001 04:44:01 -0600
> >Date: Mon, 12 Mar 2001 04:44:01 -0600
> >Message-Id: <200103121044.EAA16611@myhost.com>
> >From: root@myhost.com (Cron Daemon)
> >To: mylogin@myhost.com
> >Subject: Cron <mylogin@myhost> /home/myfiles/interchange/bin/expireall
> >X-Cron-Env: <SHELL=/bin/sh>
> >X-Cron-Env: <HOME=/home/myfiles>
> >X-Cron-Env: <PATH=/usr/bin:/bin>
> >X-Cron-Env: <LOGNAME=mylogin>
> >Status: RO
> >
> >Couldn't read interchange.cfg: No such file or directory
> >
> >The file is definately there. I have checked spelling of everything. Can
> >anybody point me in the right direction or offer tips to troubleshoot this?
>
>Tell your crontab to execute the command as your interchange user (which
>gives the process the effective user id: EUID same as UID interchange) with
>the following command:
>su interch -c "/home/myfiles/interchange/bin/interchange --start"
>
>(of course, replace interch with your interchange username).
>
>And enjoy,
>-Dan
>
>
>Dan Browning, Cyclone Computer Systems, danb@cyclonecomputers.com
>
>
>_______________________________________________
>Interchange-users mailing list
>Interchange-users@lists.akopia.com
>http://lists.akopia.com/mailman/listinfo/interchange-users
>
>_______________________________________________
>Interchange-users mailing list
>Interchange-users@lists.akopia.com
>http://lists.akopia.com/mailman/listinfo/interchange-users

===============================================================
**** Virtual Hosting w/private IC Installation, $65/month! ****
---------------------------------------------------------------
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================