Operating System - HP-UX
1850506 Members
2298 Online
104054 Solutions
New Discussion

Not to schedule a cronjob

 
SOLVED
Go to solution
susee_sundar
Regular Advisor

Not to schedule a cronjob

Hi.,

When I try to schedule the cronjob with the user build.It is giving the following error message.
----------
crontab: can't create your crontab file in the crontab directory.

When we give the command crontab -e, it is opening the editor after make the entry in the editor and when we save the cronjob..,I get the above error message.
--------

Regards
Suseendran .A
11 REPLIES 11
Peter Godron
Honored Contributor

Re: Not to schedule a cronjob

Hi,
is the user build allowed to have a cron file?
See "man crontab"
User should be in /usr/lib/cron/cron.allow
susee_sundar
Regular Advisor

Re: Not to schedule a cronjob

Hi Peter,

I dont think that was the root cause
I dont have cron.allow file in my server only I am having cron.deny and the user 'build' is not specified onto the list

The Error seems to be different., Its not looking like a permission issue.


$crontab -e
<< The Editor is opening >>
<< When I make entry & try to exit >>
:wq
crontab: can't create your crontab file in the crontab directory.


Regards
Suseendran, A
Eric Antunes
Honored Contributor

Re: Not to schedule a cronjob

Hi,

Check write permissions in /usr/spool/cron/crontabs directory.

Best Regards,

Eric Antunes
Each and every day is a good day to learn.
Peter Godron
Honored Contributor

Re: Not to schedule a cronjob

Hi,
could you please try (as user build)
cd /tmp
crontab -l > l.l
vi l.l and add your stuff
crontab l.l

If that does not work get root to create a file called build in /var/spool/cron/crontabs, set permissions to 400 and chgrp to the group of build.
Yogeeraj_1
Honored Contributor

Re: Not to schedule a cronjob

hi,

verify your temporary directory just in case they are running out of space.

also try the method specified by Peter above.

i.e.

crontab -l > /tmp/cron.txt

then edit the cron.txt accordingly

crontab /tmp/cron.txt


hope this helps too!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Matti_Kurkela
Honored Contributor
Solution

Re: Not to schedule a cronjob

Also check the permissions of the "crontab" command. It should be something like this

-r-sr-xr-x 1 root bin 32768 Jun 18 2002 /usr/bin/crontab

In other words, the "crontab" command must be suid root to allow non-root users to edit their own crontabs. In a default installation this is true, but the suid bit may be removed for various reasons:

- as a workaround to prevent the use of a local root exploit until a patch is available, the suid bit might be intentionally removed from a vulnerable binary

- as a security measure, the number of suid root binaries may be limited to absolute minimum required (I'm not sure whether the Bastille hardening system from software.hp.com offers to do this or not)
MK
susee_sundar
Regular Advisor

Re: Not to schedule a cronjob

Hi .,

I tried the above things ., But still the issue remains.


I created the file called build inside the crontabs directory and changed the group as build & given the permission..

Here I attached a few details..

----------------------

[root@nibappsun08 cron]$ pwd
/var/spool/cron
[root@nibappsun08 cron]$ ls -lt
total 4
drwxr-xr-x 2 root sys 512 Nov 28 17:30 crontabs
drwxr-xr-x 2 root sys 512 Nov 28 15:19 atjobs
[root@nibappsun08 cron]$ cd crontabs/
[root@nibappsun08 crontabs]$ ls -ltr
total 10
-r-------- 1 root sys 190 Sep 1 07:17 adm
-r-------- 1 root root 452 Sep 1 07:27 lp
-r-------- 1 root sys 308 Sep 1 07:51 sys
-r-------- 1 root sys 404 Sep 1 07:55 uucp
-r-------- 1 root other 0 Sep 25 20:50 test
-r-------- 1 root other 525 Nov 28 17:13 root
-r-------- 1 root build 0 Nov 28 17:30 build
[root@nibappsun08 crontabs]$
------------------------


Yogeeraj_1
Honored Contributor

Re: Not to schedule a cronjob

hi again

what does "bdf /var/spool/cron/crontabs " show?

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
susee_sundar
Regular Advisor

Re: Not to schedule a cronjob

Hi.,

Its an amazing effort shown from all of you to find the solution...

ya the Trick which works was the suid permission is not set for my crontab command..

After setting the suid permission to the file it is working fine..

Thanks Especially to " Matti Kurkela " and to Eveyone...

Regardfs
Suseendran, A
Peter Godron
Honored Contributor

Re: Not to schedule a cronjob

Hi,
so the question you have to ask yourself now is : Who changed the crontab permissions ??
Dennis Handly
Acclaimed Contributor

Re: Not to schedule a cronjob

>Peter: so the question you have to ask yourself now is: Who changed the crontab permissions??

If you suspect more of these problems, you could use:
# /usr/sbin/swverify \*