[Cialug] cron gpg

Barry Von Ahsen barry at vonahsen.com
Tue Aug 29 13:54:18 CDT 2006


Jeffrey C. Ollie wrote:
> On Mon, 2006-08-28 at 10:48 -0500, Barry Von Ahsen wrote:
>> I have a process that gpgs and ftps a file.  When I run it from the 
>> command line (as root), everything works fine.  When cron tries to run 
>> it (as root), it claims it can't find the gpg key it needs.  Is there 
>> anything special I need to do?  Is cron really running as root, or as 
>> some root-equivalent user?  This is on RHEL 4.3
>>
>> [...]
>>
>> Here is cron's env:
>> [...]
>> HOME=/
>>
>> [...]
>>
>> Here is root's env (from the same dir):
>> [...]
>> HOME=/root
> 
> Try manually specifying the home directory by using gpg's "--homedir"
> option.
> 

this worked perfectly, just a heads up - you have to fully path home dir 
all the way to .gnupg, or it will fail.  the manpage doesn't make this 
clear.  I just said --homedir /root/ and it failed, but --homedir 
/root/.gnupg/ worked

-barry




More information about the Cialug mailing list