Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Strange vcron behaviour
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
HomerSimpson
l33t
l33t


Joined: 25 Jan 2003
Posts: 869
Location: Ohio, USA

PostPosted: Thu Nov 06, 2003 1:53 am    Post subject: Strange vcron behaviour Reply with quote

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
View user's profile Send private message
HomerSimpson
l33t
l33t


Joined: 25 Jan 2003
Posts: 869
Location: Ohio, USA

PostPosted: Thu Nov 06, 2003 6:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
HomerSimpson
l33t
l33t


Joined: 25 Jan 2003
Posts: 869
Location: Ohio, USA

PostPosted: Thu Nov 06, 2003 9:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
HomerSimpson
l33t
l33t


Joined: 25 Jan 2003
Posts: 869
Location: Ohio, USA

PostPosted: Fri Nov 07, 2003 6:25 pm    Post subject: Strange vcron behaviour [Solved] Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum