* cron script won't run
@ 2006-09-26 7:46 Matthew Metzger
2006-09-26 8:25 ` Matthew Metzger
2006-09-26 8:30 ` Adam T. Bowen
0 siblings, 2 replies; 5+ messages in thread
From: Matthew Metzger @ 2006-09-26 7:46 UTC (permalink / raw)
To: linux-admin
Hello,
I have a script that works great when I run it from the command line,
but doesn't work at all when added to crontab. The strange part is that
/var/log/cron shows the job running:
Sep 26 03:39:01 cono crond[25241]: (root) CMD
(/etc/cron.3min/mail-restart.sh)
However, the log shows some other errors that may have something to do
with it.
PAM adding faulty module: /lib/security/pam_krb5.so
(root) CMD (/etc/cron.3min/mail-restart.sh)
PAM unable to dlopen(/lib/security/pam_krb5.so)
PAM [dlerror: /lib/security/pam_krb5.so: cannot open shared object file:
No such file or directory]
However, other cron jobs run just fine. So I'm not sure what is the
problem. Any help in figuring this out would be greatly appreciated.
Thanks.
-Matthew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cron script won't run
2006-09-26 7:46 cron script won't run Matthew Metzger
@ 2006-09-26 8:25 ` Matthew Metzger
2006-09-27 13:29 ` Matthew Metzger
2006-09-26 8:30 ` Adam T. Bowen
1 sibling, 1 reply; 5+ messages in thread
From: Matthew Metzger @ 2006-09-26 8:25 UTC (permalink / raw)
To: linux-admin
A follow up:
I fixed the PAM errors by running:
apt-get install pam_krb5
my crontab script, however, still will not run.
-Matthew
Matthew Metzger wrote:
> Hello,
>
> I have a script that works great when I run it from the command line,
> but doesn't work at all when added to crontab. The strange part is that
> /var/log/cron shows the job running:
>
> Sep 26 03:39:01 cono crond[25241]: (root) CMD
> (/etc/cron.3min/mail-restart.sh)
>
>
> However, the log shows some other errors that may have something to do
> with it.
>
> PAM adding faulty module: /lib/security/pam_krb5.so
> (root) CMD (/etc/cron.3min/mail-restart.sh)
> PAM unable to dlopen(/lib/security/pam_krb5.so)
> PAM [dlerror: /lib/security/pam_krb5.so: cannot open shared object file:
> No such file or directory]
>
> However, other cron jobs run just fine. So I'm not sure what is the
> problem. Any help in figuring this out would be greatly appreciated.
>
> Thanks.
>
> -Matthew
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cron script won't run
2006-09-26 8:25 ` Matthew Metzger
@ 2006-09-27 13:29 ` Matthew Metzger
0 siblings, 0 replies; 5+ messages in thread
From: Matthew Metzger @ 2006-09-27 13:29 UTC (permalink / raw)
To: linux-admin
thanks for the responses to my question. I learned from them. My problem
was that I was directly editing the /etc/crontab file instead of using
the crontab command correctly. Once I figured out how to create a cron
job in a separate text file and then add it to the crontab with "crontab
config_text.cron", it worked fine.
thanks for your help.
-Matthew
Matthew Metzger wrote:
> A follow up:
>
> I fixed the PAM errors by running:
> apt-get install pam_krb5
>
> my crontab script, however, still will not run.
>
> -Matthew
>
>
>
> Matthew Metzger wrote:
>> Hello,
>>
>> I have a script that works great when I run it from the command line,
>> but doesn't work at all when added to crontab. The strange part is
>> that /var/log/cron shows the job running:
>>
>> Sep 26 03:39:01 cono crond[25241]: (root) CMD
>> (/etc/cron.3min/mail-restart.sh)
>>
>>
>> However, the log shows some other errors that may have something to do
>> with it.
>>
>> PAM adding faulty module: /lib/security/pam_krb5.so
>> (root) CMD (/etc/cron.3min/mail-restart.sh)
>> PAM unable to dlopen(/lib/security/pam_krb5.so)
>> PAM [dlerror: /lib/security/pam_krb5.so: cannot open shared object
>> file: No such file or directory]
>>
>> However, other cron jobs run just fine. So I'm not sure what is the
>> problem. Any help in figuring this out would be greatly appreciated.
>>
>> Thanks.
>>
>> -Matthew
>>
>> -
>> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cron script won't run
2006-09-26 7:46 cron script won't run Matthew Metzger
2006-09-26 8:25 ` Matthew Metzger
@ 2006-09-26 8:30 ` Adam T. Bowen
2006-09-26 9:05 ` Luca Ferrari
1 sibling, 1 reply; 5+ messages in thread
From: Adam T. Bowen @ 2006-09-26 8:30 UTC (permalink / raw)
To: Matthew Metzger; +Cc: linux-admin
Hi,
Matthew Metzger wrote:
> I have a script that works great when I run it from the command line,
> but doesn't work at all when added to crontab.
# cat /dev/sysadm/mantra
The environment from within cron is not necessarily the same as that of
an interactive shell.
> The strange part is that
> /var/log/cron shows the job running:
>
> Sep 26 03:39:01 cono crond[25241]: (root) CMD
> (/etc/cron.3min/mail-restart.sh)
>
> However, the log shows some other errors that may have something to do
> with it.
>
> PAM adding faulty module: /lib/security/pam_krb5.so
> (root) CMD (/etc/cron.3min/mail-restart.sh)
> PAM unable to dlopen(/lib/security/pam_krb5.so)
> PAM [dlerror: /lib/security/pam_krb5.so: cannot open shared object file:
> No such file or directory]
Is the PAM Kerberos package installed on your system? Does the file
/lib/security/pam_krb5.so actually exist? Perhaps something in your
script is triggering authentication through Kerberos. You could:
grep /etc/pam.d/* krb
to reveal any specific pam configurations that are trying to use
Kerberos. I can't be of much more help I'm afraid. Sticking a load of
echo statements into the mail-restart.sh script could reveal what line
in your script is causing the error.
Cheers
Adam
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cron script won't run
2006-09-26 8:30 ` Adam T. Bowen
@ 2006-09-26 9:05 ` Luca Ferrari
0 siblings, 0 replies; 5+ messages in thread
From: Luca Ferrari @ 2006-09-26 9:05 UTC (permalink / raw)
To: linux-admin
On Tuesday 26 September 2006 10:30 Adam T. Bowen's cat, walking on the
keyboard, wrote:
> Hi,
>
> Matthew Metzger wrote:
> > I have a script that works great when I run it from the command line,
> > but doesn't work at all when added to crontab.
>
> # cat /dev/sysadm/mantra
> The environment from within cron is not necessarily the same as that of
> an interactive shell.
It is possible to specify environment variables in the crontab file, thus to
create an environment similar to the one the user work in interactive mode:
[t35@server 35]$ crontab -l
PATH=/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt
BASH_ENV=$HOME/.bashrc
LPDEST=stt35
MAIL=/var/mail/t35
USERNAME=""
DFENV=/home/t35/dfenv.cfg
TERMINFO=/usr/share/terminfo
DFTERMINFO=/vol1/df31d/lib/terminfo
LINES=25
COLS=80
USER=t35
DFUSER=35
10 21 * * 1-6 /your/crontab/job
Also making into your script a redirection to a log file could help finding
out what is the problem.
Luca
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-09-27 13:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-26 7:46 cron script won't run Matthew Metzger
2006-09-26 8:25 ` Matthew Metzger
2006-09-27 13:29 ` Matthew Metzger
2006-09-26 8:30 ` Adam T. Bowen
2006-09-26 9:05 ` Luca Ferrari
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).