On 10/26/2011 09:53 AM, Nikodemus Siivola wrote:
> On 26 October 2011 18:19, Carlos Konstanski
> <ckonstanski@...> wrote:
>
>> When I run SBCL from a shell or from SLIME, everything is roses. But if I
>> try to run a shebang script from cron, it looks in the wrong place for
>> sbcl.core. Instead of looking in /usr/lib64/sbcl/sbcl.core (the correct
>> location), it looks in /usr/local/lib/sbcl//sbcl.core (double slashes appear
>> in /var/log/messages, so I duplicated them here).
>
> Yah. The inability to provide multiple options for shebang scripts is a pain.
>
> #!sbcl --script
>
> assumes that --core is either in the standard location
> /usr/local/lib/sbcl or in a locate indicated by SBCL_HOME.
>
> Since you have it in a non-standard location, and cron doesn't have
> your usual environment set up, it can't find it.
>
> Using
>
> SBCL_HOME=/usr/lib64/sbcl your-script
>
> in cron should work, I think. I don't remember offhand if cron allow
> you to set up the environment like that, but if it doesn't you can use
> env for that -- or do
>
> sbcl --core /usr/lib64/sbcl/sbcl.core --script your-script
>
> instead.
>
> Cheers,
>
> -- nikodemus
It worked! The SBCL_HOME environment variable didn't help because the actual
sbcl executable isn't in the same directory. But the sbcl --core command
line did. Thanks!
|