You are not logged in.

#1 2013-08-01 13:57:03

comicosmos
Member
From: suzhou, China mainland
Registered: 2011-04-16
Posts: 45

[SOLVED] killall -9 calise in openbox autostart file

Hi,

Any help is appreciated.
I use gdm start a openbox session. And in openbox's autostart file, I start calise.
(calise is a python script that auto adjust screen backlight based on camera image).
start calise -> wait for 5 sec -> close calise.

during the 5 sec, calise will take several images from camera and adjust screen backlight according to ambient brightness -- The camera is used as light sensor.

calise
sleep 5
killall -9 calise

If I key in the code in a shell command window, it works as expected.
During the openbox start session, calise start. But it will not get killed in 5 sec.
Anyone know how to fix this or how to find debug messagae?

Thanks.

-- Nano

Last edited by comicosmos (2013-08-06 11:40:16)

Offline

#2 2013-08-01 14:15:45

swanson
Member
From: Sweden
Registered: 2011-02-05
Posts: 759

Re: [SOLVED] killall -9 calise in openbox autostart file

Call it from script instead.

Offline

#3 2013-08-01 14:30:08

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,304

Re: [SOLVED] killall -9 calise in openbox autostart file

Try something like that in openbox autostart:

calise &
(sleep 5 && killall -9 calise) &

You need to execute calise in background for the autostart script to continue with the other lines.
Everything launched in autostart should be in background, or the script will wait till the command exits before continuing to the other commands.

And do you really need the SIGKILL signal? Is not the default SIGTERM signal sufficient?

Offline

#4 2013-08-06 11:38:15

comicosmos
Member
From: suzhou, China mainland
Registered: 2011-04-16
Posts: 45

Re: [SOLVED] killall -9 calise in openbox autostart file

Yeah. Thanks berbae.
That works.

Thanks for the explanation. I should have known this.

Last edited by comicosmos (2013-08-06 11:38:33)

Offline

Board footer

Powered by FluxBB