Ticket #1837 (closed defect: wontfix)

Opened 9 years ago

Last modified 8 years ago

atd issues

Reported by: h.koenig Owned by: openmoko-devel
Priority: normal Milestone:
Component: unknown Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: no PatchReviewResult:
Reproducible:

Description

I'm using Om 2008.8 with zeckes -dev updates. playing with atd I noticed

1) atd does not remove scripts after execution

atd is a single shot timer, scripts should not run twice. but atd does not remove them from /var/spool/at/ after execution. thus these scripts will run over and over again once they are timed out, whenever atd gets (re)started or triggered...

looking at the sources in atd-0.70-r4/atd/atd.c there is no remove/unlink to the spool files.

to test:

--- 8< ------ 8< ------ 8< ------ 8< ------ 8< ------ 8< ---
cd /var/spool/at

cat >> 1.1 <<EOF
#!/bin/sh
date >> /tmp/at.run
echo >> /var/spool/at/trigger
EOF

chmod +x 1.1
echo >> /var/spool/at/trigger
--- 8< ------ 8< ------ 8< ------ 8< ------ 8< ------ 8< ---

2) /bin/bash atd scripts crash

using /bin/bash instead of /bin/sh in atd-scripts will crash
the script at startup before executing the first command in shell script,
using /bin/sh my atd scripts works (but I need some arithmetic and
"dc" frombusybox outputs time-in-secs as float -- but that's another topic;)

from strace:
...
uname({sys="Linux", node="om-gta02", ...}) = 0
stat64("/", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
stat64(".", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
stat64(".", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
stat64("/", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
stat64("..", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
open("..", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
brk(0xbd000) = 0xbd000
getdents64(3, /* 3 entries */, 4096) = 72
lstat64("../at", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
close(3) = 0
stat64("../..", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
open("../..", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
getdents64(3, /* 12 entries */, 4096) = 328
lstat64("../../spool", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
close(3) = 0
stat64("../../..", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
open("../../..", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
brk(0xc1000) = 0xc1000
getdents64(3, /* 19 entries */, 8192) = 488
lstat64("../../../var", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
close(3) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---

Change History

comment:1 Changed 9 years ago by zecke

That is by design (not the bash crash). If you want your script to be removed then put an rm into the script at least this is how GPE (atd was created by the founder of GPE) and Qtopia handle this.

comment:2 Changed 8 years ago by john_lee

  • Status changed from new to closed
  • HasPatchForReview unset
  • Resolution set to wontfix
Note: See TracTickets for help on using tickets.