cassimirinho
(usa Ubuntu)
Enviado em 24/11/2007 - 14:51h
Apaguei o /var/log/cron.log, removi e instalei novamente o cron e reiniciei o pc.
No terminal: cron
E depois: sudo cron
*******************
cassimirinho@ubuntu:~$ tail -f /var/log/cron.log
Nov 24 14:31:51 ubuntu anacron[6002]: Anacron 2.3 started on 2007-11-24
Nov 24 14:31:51 ubuntu anacron[6002]: Normal exit (0 jobs run)
Nov 24 14:31:51 ubuntu /usr/sbin/cron[6033]: (CRON) INFO (pidfile fd = 3)
Nov 24 14:31:51 ubuntu /usr/sbin/cron[6035]: (CRON) STARTUP (fork ok)
Nov 24 14:31:51 ubuntu /usr/sbin/cron[6035]: (CRON) INFO (Running @reboot jobs)
Nov 24 14:32:34 ubuntu cron[6608]: (CRON) DEATH (can't open or create /var/run/crond.pid: Permission denied)
Nov 24 14:35:28 ubuntu cron[6658]: (CRON) DEATH (can't lock /var/run/crond.pid, otherpid may be 6035: Resource temporarily unavailable)
***************************
Veja que com o primeiro comando "cron" ele não deixa eu executar, já no segundo aparece o tal erro que vi em muitos lugares mas ninguém soube resolver. {Nov 24 14:35:28 ubuntu cron[6658]: (CRON) DEATH (can't lock /var/run/crond.pid, otherpid may be 6035: Resource temporarily unavailable)}
***************************
Esse /var/run/crond.pid já deletei o conteúdo 6035, já deletei o arquivo, mas o erro é sempre o mesmo mudando apenas o número do pid.
****************************
Listando "crontab -l" e "sudo crontab -l":
cassimirinho@ubuntu:~$ crontab -l
# (minuto) (hora) (dia do mes) (mes) (dia da semana) comando
45 14 * * * /home/cassimirinho/torpedo.sh
cassimirinho@ubuntu:~$ sudo crontab -l
[sudo] password for cassimirinho:
# (minuto) (hora) (dia do mes) (mes) (dia da semana) comando
46 14 * * * root /home/cassimirinho/torpedo.sh
Sendo que o "crontab -e" salva e um diretório /tmp/....qualquer e o "sudo crontab -e" salve em um outro dentro do /tmp/... também.
Se eu digitar no terminal /home/cassimirinho/torpedo.sh minha aplicação é aberta sem problemas.
****************************
tail -f /var/log/cron.log após 14:45(cassimirinho) e 14:46(root)...continuação...
Nov 24 14:44:01 ubuntu /usr/sbin/cron[6035]: (root) RELOAD (crontabs/root)
Nov 24 14:44:01 ubuntu /usr/sbin/cron[6035]: (cassimirinho) RELOAD (crontabs/cassimirinho)
Nov 24 14:45:01 ubuntu /USR/SBIN/CRON[6681]: (cassimirinho) CMD (/home/cassimirinho/torpedo.sh)
Nov 24 14:46:01 ubuntu /USR/SBIN/CRON[6695]: (root) CMD (root /home/cassimirinho/torpedo.sh)
Nov 24 14:46:01 ubuntu /USR/SBIN/CRON[6694]: (root) MAIL (mailed 25 bytes of output but got status 0x0001 )
Acredito que a última linha acima é por conta de eu ter colocado o "root" no meio do comando crontab, mas sem ele no meio o que muda é:
Nov 24 14:48:01 ubuntu /usr/sbin/cron[6035]: (root) RELOAD (crontabs/root)
Nov 24 14:48:01 ubuntu /USR/SBIN/CRON[6701]: (root) CMD (/home/cassimirinho/torpedo.sh)
Aqui acho que é tudo o que eu poderia falar pra ajudar, mas tá complicado...
Se quiser ler o meu strace -i cron:
cassimirinho@ubuntu:~$ strace -i cron
[ffffe410] execve("/usr/sbin/cron", ["cron"], [/* 35 vars */]) = 0
[b7fbfceb] brk(0) = 0x8052000
[b7fc05b1] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
[b7fc0703] mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7faa000
[b7fc05b1] access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
[b7fc0474] open("/etc/ld.so.cache", O_RDONLY) = 3
[b7fc043e] fstat64(3, {st_mode=S_IFREG|0644, st_size=57288, ...}) = 0
[b7fc0703] mmap2(NULL, 57288, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f9c000
[b7fc04ad] close(3) = 0
[b7fc05b1] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
[b7fc0474] open("/lib/libpam.so.0", O_RDONLY) = 3
[b7fc04f4] read(3, "\177ELF\1\1\1{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}\3{TTEXTO}\3{TTEXTO}\1{TTEXTO}{TTEXTO}{TTEXTO}000\32{TTEXTO}"..., 512) = 512
[b7fc043e] fstat64(3, {st_mode=S_IFREG|0644, st_size=37880, ...}) = 0
[b7fc0703] mmap2(NULL, 40660, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f92000
[b7fc0703] mmap2(0xb7f9b000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8) = 0xb7f9b000
[b7fc04ad] close(3) = 0
[b7fc05b1] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
[b7fc0474] open("/lib/libselinux.so.1", O_RDONLY) = 3
[b7fc04f4] read(3, "\177ELF\1\1\1{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}\3{TTEXTO}\3{TTEXTO}\1{TTEXTO}{TTEXTO}{TTEXTO} ?{TTEXTO}{TTEXTO}00"..., 512) = 512
[b7fc043e] fstat64(3, {st_mode=S_IFREG|0644, st_size=83516, ...}) = 0
[b7fc0703] mmap2(NULL, 88980, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f7c000
[b7fc0703] mmap2(0xb7f90000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13) = 0xb7f90000
[b7fc04ad] close(3) = 0
[b7fc05b1] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
[b7fc0474] open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
[b7fc04f4] read(3, "\177ELF\1\1\1{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}\3{TTEXTO}\3{TTEXTO}\1{TTEXTO}{TTEXTO}{TTEXTO}\260a\1"..., 512) = 512
[b7fc043e] fstat64(3, {st_mode=S_IFREG|0644, st_size=1339816, ...}) = 0
[b7fc0703] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f7b000
[b7fc0703] mmap2(NULL, 1349136, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7e31000
[b7fc0703] mmap2(0xb7f75000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x143) = 0xb7f75000
[b7fc0703] mmap2(0xb7f78000, 9744, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f78000
[b7fc04ad] close(3) = 0
[b7fc05b1] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
[b7fc0474] open("/lib/tls/i686/cmov/libdl.so.2", O_RDONLY) = 3
[b7fc04f4] read(3, "\177ELF\1\1\1{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}\3{TTEXTO}\3{TTEXTO}\1{TTEXTO}{TTEXTO}{TTEXTO}p\n{TTEXTO}{TTEXTO}00"..., 512) = 512
[b7fc043e] fstat64(3, {st_mode=S_IFREG|0644, st_size=9684, ...}) = 0
[b7fc0703] mmap2(NULL, 12412, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7e2d000
[b7fc0703] mmap2(0xb7e2f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7e2f000
[b7fc04ad] close(3) = 0
[b7fc05b1] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
[b7fc0474] open("/lib/libsepol.so.1", O_RDONLY) = 3
[b7fc04f4] read(3, "\177ELF\1\1\1{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}\3{TTEXTO}\3{TTEXTO}\1{TTEXTO}{TTEXTO}{TTEXTO}@.{TTEXTO}{TTEXTO}00"..., 512) = 512
[b7fc043e] fstat64(3, {st_mode=S_IFREG|0644, st_size=219668, ...}) = 0
[b7fc0703] mmap2(NULL, 264992, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7dec000
[b7fc0703] mmap2(0xb7e22000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x35) = 0xb7e22000
[b7fc0703] mmap2(0xb7e23000, 39712, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7e23000
[b7fc04ad] close(3) = 0
[b7fc0703] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7deb000
[b7fadc40] set_thread_area({entry_number:-1 -> 6, base_addr:0xb7deb6b0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
[b7fc0784] mprotect(0xb7f75000, 4096, PROT_READ) = 0
[b7fc0741] munmap(0xb7f9c000, 57288) = 0
[ffffe410] brk(0) = 0x8052000
[ffffe410] brk(0x8073000) = 0x8073000
[ffffe410] open("/etc/selinux/config", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
[ffffe410] statfs64("/selinux", 84, 0xbfba6280) = -1 ENOENT (No such file or directory)
[ffffe410] open("/proc/mounts", O_RDONLY|O_LARGEFILE) = 3
[ffffe410] fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
[ffffe410] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa9000
[ffffe410] read(3, "rootfs / rootfs rw 0 0\nnone /sys"..., 1024) = 772
[ffffe410] read(3, "", 1024) = 0
[ffffe410] close(3) = 0
[ffffe410] munmap(0xb7fa9000, 4096) = 0
[ffffe410] rt_sigaction(SIGCHLD, {0x804a6e0, [CHLD], SA_RESTART}, {SIG_DFL}, 8) = 0
[ffffe410] rt_sigaction(SIGHUP, {0x804a6b0, [HUP], SA_RESTART}, {SIG_DFL}, 8) = 0
[ffffe410] fcntl64(0, F_GETFL) = 0x2 (flags O_RDWR)
[ffffe410] fstat64(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
[ffffe410] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa9000
[ffffe410] _llseek(0, 0, 0xbfba6160, SEEK_CUR) = -1 ESPIPE (Illegal seek)
[ffffe410] open("/var/run/crond.pid", O_RDWR|O_CREAT, 0644) = -1 EACCES (Permission denied)
[ffffe410] write(2, "cron: can\'t open or create /var/"..., 65cron: can't open or create /var/run/crond.pid: Permission denied
) = 65
[ffffe410] getpid() = 6734
[ffffe410] time(NULL) = 1195923033
[ffffe410] open("/etc/localtime", O_RDONLY) = 3
[ffffe410] fstat64(3, {st_mode=S_IFREG|0644, st_size=721, ...}) = 0
[ffffe410] fstat64(3, {st_mode=S_IFREG|0644, st_size=721, ...}) = 0
[ffffe410] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa8000
[ffffe410] read(3, "TZif{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}{TTEXTO}\3{TTEXTO}{TTEXTO}{TTEXTO}\3{TTEXTO}"..., 4096) = 721
[ffffe410] close(3) = 0
[ffffe410] munmap(0xb7fa8000, 4096) = 0
[ffffe410] stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=721, ...}) = 0
[ffffe410] stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=721, ...}) = 0
[ffffe410] stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=721, ...}) = 0
[ffffe410] socket(PF_FILE, SOCK_DGRAM, 0) = 3
[ffffe410] fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
[ffffe410] connect(3, {sa_family=AF_FILE, path="/dev/log"}, 110) = 0
[ffffe410] send(3, "<78>Nov 24 14:50:33 cron[6734]: "..., 105, MSG_NOSIGNAL) = 105
[ffffe410] close(3) = 0
[ffffe410] exit_group(1) = ?
Process 6734 detached