-   Linux - Software (
-   -   Can't run atd since upgrading kernel to 3.6.1 (

RandomTroll 10-08-2012 07:16 PM

Can't run atd since upgrading kernel to 3.6.1
When I run atd I get:


Can't link execution file: Operation not permitted
I've had the same atd since May 5; I just upgraded the kernel from 3.5.5 to 3.6.1. No log file records a problem, even when I run atd with the -d switch. /var/run/ is created but the process isn't in the list.

unSpawn 10-08-2012 08:13 PM

Start atd manually with 'strace -v -o /path/to/logfile'?

RandomTroll 10-10-2012 02:06 PM

1 Attachment(s)
1) atd works in kernel 3.5.5
2) A version built from the latest source in 3.6.1 fails in the same way

Find the strace log attached. I don't understand it.
The reported error seems to happen at:


link("a0000101574742", "=0000101574742") = -1 EPERM (Operation not permitted)
In 3.5.5, when atd works, the end of the trace changes at the first getdents; the link never happens:


mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb779c000 _llseek(3, 0, [0], SEEK_CUR) = 0
write(3, "1119\n", 5) = 5
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
setregid32(0, 2) = 0
setreuid32(0, 2) = 0
time(NULL) = 1349882275
stat64(".", {st_dev=makedev(8, 4), st_ino=10715414, st_mode=S_IFDIR|0700, st_nlink=2, st_uid=2, st_gid=2, st_blksize=4096, st_blocks=8, st_size=4096, st_atime=2012/10/10-09:17:07, st_mtime=2012/10/10-09:17:06, st_ctime=2012/10/10-09:17:06}) = 0
getdents(4, {{d_ino=10715416, d_off=618125610, d_reclen=16, d_name=".SEQ"} {d_ino=10715414, d_off=901055122, d_reclen=16, d_name="."} {d_ino=10715172, d_off=2147483647, d_reclen=16, d_name=".."}}, 32768) = 48
getdents(4, {}, 32768) = 0
close(4) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {0x80492b0, [], SA_NOCLDSTOP}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({3600, 0},

RandomTroll 10-14-2012 03:25 PM

I found the error reported in atd.c. atd tries to hard-link the at
job's entry in /var/spool/atjobs/ to another name to lock it; the new
name is the old one with an = prepended, for example linking
a000030157642b to =a000030157642b . I'm getting an error 1, EPERM,
operation not permitted. If I change the line of code that causes atd
to report an error and exit to just report the error atd works.

Nothing's different in the permissions of atd or at or these
directories with kernel 3.5.5 (in which it works). If I change the
permissions of /var/spool/atjobs to 777 the error still happens. I
can cd to /var/spool/atjobs and make a link at the command line. The
original file gets created: why would a link be disallowed? at jobs
initiated by root have the same problem.


    newname[0] = '=';

    /* We try to make a hard link to lock the file.  If we fail, then
    * somebody else has already locked it (a second atd?); log the
    * fact and return.
    if (link(filename, newname) == -1) {
        if (errno == EEXIST) {
            syslog(LOG_WARNING, "trying to execute job %.100s twice",filename);
        } else {
          /*        perr("Can't link execution file"); */
          syslog(LOG_WARNING, "Can't link execution file %s to %s, error number %d, %s", filename, newname, errno, strerror(errno));
    /* If something goes wrong between here and the unlink() call,
    * the job gets restarted as soon as the "=" entry is cleared
    * by the main atd loop.

All times are GMT -5. The time now is 07:45 PM.