Re: beagle-crawl-system hangs at bash login



On Thursday 20 April 2006 07:56, D Bera wrote:
> > eval nice -n 19 $IONICE su $CRAWL_USER -s /bin/bash -c \"
> > MONO_SHARED_DIR=$MONO_SHARED_DIR @sbindir@/beagle-build-index --target
> > @localstatedir@/cache/beagle/indexes/$CRAWL_INDEX_NAME $OPTIONS
> > $CRAWL_PATHS\" > /dev/null 2>&1
> >
> > According to the su manpage, the options are supposed to come before the
> > user name, here it is after. All I get is a bash login prompt when I
> > remove
>
> If you move the username all the way after -c "...", does it work for you ?

That would be tricky, the whole command would have to appear as one argument 
for the "-s" option. I moved "-s /bin/bash" only to before the user name. I 
also removed the export to make sure it works.

eval nice -n 19 $IONICE su -s /bin/bash $CRAWL_USER -c \" 
MONO_SHARED_DIR=$MONO_SHARED_DIR /usr/sbin/beagle-build-index --target /var/lib/cache/beagle/indexes/$CRAWL_INDEX_NAME 
$OPTIONS $CRAWL_PATHS\" >/dev/null 2>&1

It works for me. I still have the shell for beagleindex set to /bin/false, so 
that's good. So you're using /bin/bash as the shell instead 
of /usr/sbin/beagle-build-index so MONO_SHARED_DIR gets set? 

> Just curious, which distribution are you using ?

Gentoo.
GNU bash, version 3.1.17(1)-release (i686-pc-linux-gnu)
su is from sys-apps/shadow-4.0.15

> > the "/dev/null 2>&1". If I change the beagleindex shell to /bin/false, it
> > returns immediately. So the shell option isn't taking effect. I changed
> > to this:
> >
> > eval nice -n 19 $IONICE su -s @sbindir@/beagle-build-index $CRAWL_USER
> > \"--target @localstatedir@/cache/beagle/indexes/$CRAWL_INDEX_NAME
> > $OPTIONS $CRAWL_PATHS\" > /dev/null 2>&1
> >
> > and it works regardless of the shell I have set in /etc/password for
> > beagleindex. I moved the "-s" option to before the user name and am using
> > @sbindir@/beagle-build-index for the shell directly, instead of calling
> > bash. I also had to export MONO_SHARED_DIR which I think is cleaner.
>
> su has some reservations on exporting variables. The few times I
> tried, exporting mono-shared-dir didnt work for me.

See, this is why I ask :)

-- 
Pat Double, pat patdouble com
"In the beginning God created the heaven and the earth."

Attachment: pgpPa4wM09Hnz.pgp
Description: PGP signature



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