View previous topic :: View next topic |
Author |
Message |
HomerSimpson l33t
Joined: 25 Jan 2003 Posts: 869 Location: Ohio, USA
|
Posted: Thu Nov 06, 2003 1:53 am Post subject: Strange vcron behaviour |
|
|
I am running bottlerocket from vcron as a particular user. I had this setup and running for many months now. But for some reason, about a week ago, it quit working. I don't know why. Maybe I got a new version of vcron or something. I don't know.
vcron is running and running other commands. I tested that. The problem seems to be only with this command: Code: | /usr/local/bin/br -v --port=/dev/ttyS0 --on=3 |
It doesn't work (anymore) as root nor as a user.
The command works fine when run from the command line (as root and as a user).
The command appears to be run from vcron as there is an entry in the crond log but if it is actually being run then I would get an email with the output of the command (which I am not).
It normally says: Quote: | /usr/local/bin/br: Turning on appliance A3 |
Some more info:
Poking around I noticed that ttyS0 is a link owned by root:root but is pointing to tts/0 which is owned by parent:tty. "parent" is the name of the user that I am running the vcron command as.
How do I debug this? Why doesn't this command work when run from vcron anymore? What could cause this?
Thx _________________ The strong must protect the Sweet. |
|
Back to top |
|
|
HomerSimpson l33t
Joined: 25 Jan 2003 Posts: 869 Location: Ohio, USA
|
Posted: Thu Nov 06, 2003 6:40 pm Post subject: |
|
|
I have done more testing and there seems to be an issue with vcron 3.0.1-r2. When I go back to 3.0.1-r1 it works fine.
I did some meddling in the bottlerocket code and printed out the error I was getting while running from cron and it says "bad file descriptor" while trying to open /dev/ttyS0.
I guess this is a bug? ...and I should submit it to bugzilla?
Thx _________________ The strong must protect the Sweet. |
|
Back to top |
|
|
HomerSimpson l33t
Joined: 25 Jan 2003 Posts: 869 Location: Ohio, USA
|
Posted: Thu Nov 06, 2003 9:54 pm Post subject: |
|
|
I have done even more poking around and it looks like the only difference between -r1 and r2 (apart from the selinux stuff which I do not have enabled) is that a patch is added to add the line: Code: | close(STDIN_FILENO); |
Why would this line break vcron or at least not allow a command run from vcron access to the serial port? _________________ The strong must protect the Sweet. |
|
Back to top |
|
|
HomerSimpson l33t
Joined: 25 Jan 2003 Posts: 869 Location: Ohio, USA
|
Posted: Fri Nov 07, 2003 6:25 pm Post subject: Strange vcron behaviour [Solved] |
|
|
It turns out that bottlerocket checks to see if the file it opened is stdin and exits if it is true. Since stdin is closed by vcron, bottlerocket opens and gets the stdin fd. I found a work around by adding </dev/null >/dev/null 2>&1 to the end of the bottlerocket command.
Thx _________________ The strong must protect the Sweet. |
|
Back to top |
|
|
|