LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-03-2008, 11:19 AM   #16
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled

Quote:
Originally Posted by sharu99
[root@ConsoleServer /]# ls -l /tftpd_check/tftpd_check.sh
-rwxrwxrwx 1 root root 398 Nov 3 09:11 /tftpd_check/tftpd_check.sh
Let's think about this for a moment: you have a script that will be run by root, and you've made it world writable. Is that a smart idea?

At very least, # chmod 744 tftpd_check.sh

Next, we know crond is running because other cronjobs are getting run. If you wanted to verify that crond was running, one quick way to do so is: # pgrep crond

Next, start taking a look at /var/log/cron to see what you can figure out about whether your job really is or isn't getting run.

Finally, there are several suggestions in this thread for you to check root's mail for clues. Have you done that?

# mail
 
Old 11-03-2008, 01:21 PM   #17
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Code:
xterm -e '/usr/sbin/in.tftpd' &
This part of your script will never work as you expect, unless you explicitly set the environment variable DISPLAY inside your script and you have permissions to use an active X windows (if any). Indeed, there is no X assigned by the cron daemon.

Anyway it looks to me that this kind of interactive job (you want to start an interactive tftp session, right?) is not suitable for running in a crontab. Just my personal opinion.
 
Old 11-04-2008, 12:04 AM   #18
sharu99
LQ Newbie
 
Registered: Oct 2008
Posts: 15

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by colucix View Post
Code:
xterm -e '/usr/sbin/in.tftpd' &
This part of your script will never work as you expect, unless you explicitly set the environment variable DISPLAY inside your script and you have permissions to use an active X windows (if any). Indeed, there is no X assigned by the cron daemon.

Anyway it looks to me that this kind of interactive job (you want to start an interactive tftp session, right?) is not suitable for running in a crontab. Just my personal opinion.
Hi,

Can you please let me know how i can set the DISPLAY variable inside the script?
In the script, i am trying to check if tftpd is running and if not going to start it.

Can somebody please check this???? I have not received any answers for 2 days....

Last edited by sharu99; 11-05-2008 at 08:51 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron hourly, daily, cron.d jobs don't execute eggsmartha Linux - General 3 09-17-2007 06:37 PM
Cron jobs not executed at right time(persistent UTC?) baddah Linux - Newbie 2 03-29-2006 11:27 PM
Cron Jobs christo512 Linux - Software 1 02-09-2006 09:19 AM
Cron Jobs XaViaR Linux - General 1 06-23-2005 06:57 PM
cron jobs Zyanid Linux - Software 0 08-27-2002 05:10 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration