corn scheduled tasks not autostarted

Discussion and Technical Support for general software applications and utilities including OS related issues.
yoram
Member
Member
Posts: 76
Joined: February 10th, 2011, 8:58 pm

corn scheduled tasks not autostarted

Post by yoram »

Hi
Following the instructions for scheduling tasks using corn ( I'm new to linux)
the tasks I place under CORN schedule never start up automaticall. Especially VNC.
If run manually, everything is OK. After reboot - nothing.
please help

thanks for a great site
yoram
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: corn scheduled tasks not autostarted

Post by Ian »

Hi yoram

OK, this could be a few things, possibly permissions or possibly the way you've configured the cron job.

Are you using Wemin to configure the cron jobs? If so, what user are you running the jobs as? Can you type the following command in a putty session or a terminal and send me the output please?

Code: Select all

ls -l NameOfYourScript
You might need to include the full path of the script if it doesn't reside in the folder you're in.
yoram
Member
Member
Posts: 76
Joined: February 10th, 2011, 8:58 pm

Re: corn scheduled tasks not autostarted

Post by yoram »

hi

I run webmin under my user "yoram"
this is what I get from the ls -l

thanks, Yoram

yoram@CAROLINE:~/MyScripts$ ls -l StartVNC.sh
-rw-r--r-- 1 yoram yoram 128 2011-02-09 18:47 StartVNC.sh
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: corn scheduled tasks not autostarted

Post by Ian »

Hi Yoram,

Ah, your script does not have execute permissions. So, issue the following command to fix:

Code: Select all

chmod a+x StartVNC.sh
then try again and let us know how you get on ;)
yoram
Member
Member
Posts: 76
Joined: February 10th, 2011, 8:58 pm

Re: corn scheduled tasks not autostarted

Post by yoram »

Hi, It still doesn't work at startup
This is my command line from the corn: /home/yoram/MyScripts/StartVNC.sh >/dev/null
I've tried to put perl at the head without success

Thanks, Yoram
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: corn scheduled tasks not autostarted

Post by Ian »

OK, we need to delve a bit deeper........

Can you show me the script please:

Code: Select all

cat /home/yoram/MyScripts/StartVNC.sh
Also, please send me a screendump of the output from this command too:

Code: Select all

. /home/yoram/MyScripts/StartVNC.sh
What happens when you click the "Run Now" button on the Webmin screen for this script?
yoram
Member
Member
Posts: 76
Joined: February 10th, 2011, 8:58 pm

Re: corn scheduled tasks not autostarted

Post by yoram »

Hi
for the first command I got:

yoram@CAROLINE:~$
yoram@CAROLINE:~$ cat /home/yoram/MyScripts/StartVNC.sh
#!/bin/sh
echo "JOB RUN AT $(date)"
echo "============================"
echo ""
/usr/bin/vncserver -geometry 1024x768 -depth 24
yoram@CAROLINE:~$


and for the second:

yoram@CAROLINE:~$ . /home/yoram/MyScripts/StartVNC.sh
JOB RUN AT Wed Feb 16 17:58:07 IST 2011
============================


New 'CAROLINE:14 (yoram)' desktop is CAROLINE:14

Starting applications specified in /home/yoram/.vnc/xstartup
Log file is /home/yoram/.vnc/CAROLINE:14.log

yoram@CAROLINE:~$

When I try the "run now" a new session is created and I can access through VNC.

I found that if I put the script at the "system->preferences->startup applications" it would auto start
at power up (i.e at the ubuntu home screen)

Yoram
Marco
Member
Member
Posts: 4
Joined: February 14th, 2011, 11:49 pm

Re: corn scheduled tasks not autostarted

Post by Marco »

Hi guys,

@Yoram

Issue the following two commands and send us the output:

Code: Select all

sudo cat /var/spool/cron/crontabs/yoram

Code: Select all

sudo cat /var/spool/cron/crontabs/root
cheers

Marco.
yoram
Member
Member
Posts: 76
Joined: February 10th, 2011, 8:58 pm

Re: corn scheduled tasks not autostarted

Post by yoram »

Hi Marco, thanks for your help

here it is
1. for Yoram
login as: yoram
yoram@192.168.0.14's password:
Linux CAROLINE 2.6.35-25-generic-pae #44-Ubuntu SMP Fri Jan 21 19:01:46 UTC 2011 i686 GNU/Linux
Ubuntu 10.10

Welcome to Ubuntu!
* Documentation: https://help.ubuntu.com/
Last login: Wed Feb 16 22:14:38 2011 from 192.168.0.10
yoram@CAROLINE:~$ sudo cat /var/spool/cron/crontabs/yoram
[sudo] password for yoram:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.UbuosB/crontab installed on Wed Feb 16 07:29:33 2011)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
@hourly /home/yoram/MyScripts/StartVNC.sh >/dev/null #Autostart VNC server
yoram@CAROLINE:~$



2. for root
login as: yoram
yoram@192.168.0.14's password:
Linux CAROLINE 2.6.35-25-generic-pae #44-Ubuntu SMP Fri Jan 21 19:01:46 UTC 2011 i686 GNU/Linux
Ubuntu 10.10

Welcome to Ubuntu!
* Documentation: https://help.ubuntu.com/
Last login: Thu Feb 17 00:24:18 2011 from 192.168.0.10
yoram@CAROLINE:~$ sudo cat /var/spool/cron/crontabs/root
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.LwjbsC/crontab installed on Thu Feb 10 20:54:33 2011)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
yoram@CAROLINE:~$


3. There is some permissions issue with my installation.
I activated SAMBA and enabled writes but when accessed from windows (with the owner user "yoram")
I got "access denied" whenever trying to write to the shared directory

Thanks again
Yoram :)
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: corn scheduled tasks not autostarted

Post by Ian »

Nice call Marco, you've cracked it. :clap:

Yoram, your StartVNC.sh script is set to fire hourly, not on system boot. This is why you had 14 virtual desktops when you posted those screenshots. :eek:
@hourly /home/yoram/MyScripts/StartVNC.sh >/dev/null #Autostart VNC server
Go into Webmin and change the "Simple schedule" drop down to read "When system boots" for that cron job. Then click Save.

With your samba problems, in Webmin go into the share and click the "Security and Access Control" icon. Then the option at the top, Writable? Yes No" needs to be changed to Yes. Then click Save and try again.

Also send us a screenshot of the folder(s) you're trying to write to:
ls -l /folderyouaretryingtowriteto
Let us know how you get on :thumbup:
Post Reply