Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

udev, init.d and a daemon

 
   Soft32 Home -> Linux -> Development RSS
Next:  Bug#541025: O: quickml -- Very-easy-to-use mailin..  
Author Message
Giacomo A. Catenazzi

External


Since: Dec 16, 2006
Posts: 20



(Msg. 1) Posted: Tue Aug 11, 2009 5:20 am
Post subject: udev, init.d and a daemon
Archived from groups: linux>debian>devel (more info?)

Hello,

I've a problem designing a boot script, and I find no example.

The problem:
- Logitech G15 (and like) USB keyboards have a LCD display and few
(or lots) extra keys
- g15daemon is a deamon need to handle the display, and to handle the
extra keys in xorg (xkb-data (>= 0.9+cvs.20070428-1) )
- g15daemon requires the kernel module uinput, to push back the
extra keys (after decoding it, according to keyboard version)

Actual solution:
- a standard init.d script, which start and stop a deamon

Now I'm thinking/writing about a event based rule (with udev) which
handles also some short disconnection of USB bus on some systems.

Problems:
- How to force the deamon to be loaded BEFORE xorg in insserv?
I don't find a "before of" dependency in LSB headers
- How to handle the common case: keyboard is already attached
(daemon is in /usr filesystem), with udev.
- How to load uinput module? Actually I modprobe and I pool
to see if the device is created, every 0.1 seconds for 5 seconds.
Note this could be done concurrently detaching the command, but
anyway is not event based as I would like.

any suggestions/example?
How would it work on upstart?

Notes:
- actually g15daemon doesn't support multiple keyboards, but
libg15 library does.
- init.d script is still need for shutdown phase

ciao
cate




--
To UNSUBSCRIBE, email to debian-devel-REQUEST.TakeThisOut@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.TakeThisOut@lists.debian.org
Back to top
Login to vote
Giacomo A. Catenazzi

External


Since: Dec 16, 2006
Posts: 20



(Msg. 2) Posted: Tue Aug 11, 2009 7:20 am
Post subject: Re: udev, init.d and a daemon [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Marco d'Itri wrote:
> On Aug 11, "Giacomo A. Catenazzi" <cate.RemoveThis@debian.org> wrote:
>
>> - How to handle the common case: keyboard is already attached
>> (daemon is in /usr filesystem), with udev.
>
> cd /lib/udev/
> . ./hotplug.functions
> wait_for_file /dev/log

Thanks. I was looking for such function since years!

>
>> - How to load uinput module? Actually I modprobe and I pool
> I expect that it would be autoloaded by udev when the hardware is
> installed.

uinput is "input from userspace", so no hardware.
But probably CONFIG_INPUT_UINPUT must be set "y" on debian kernels.


>> - init.d script is still need for shutdown phase
> Is there any point in killing such a daemon on shutdown instead of
> letting the generic init scripts do it?

Maybe. I like to manually start and stop daemons (especially
for tests), and for upgrades I think we need a sysadmin method for stop and
(re)start a deamon.
But I'll think more about this.

Anyway, thanks!

ciao
cate


--
To UNSUBSCRIBE, email to debian-devel-REQUEST.RemoveThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.RemoveThis@lists.debian.org
Back to top
Login to vote
Petter Reinholdtsen

External


Since: Mar 14, 2004
Posts: 188



(Msg. 3) Posted: Tue Aug 11, 2009 9:20 am
Post subject: Re: udev, init.d and a daemon [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

[Giacomo A. Catenazzi]
> Problems:
> - How to force the deamon to be loaded BEFORE xorg in insserv?
> I don't find a "before of" dependency in LSB headers

The header is X-Start-Before. In this case, I would use an entry like
this:

# X-Start-Before: xdm kdm gdm ldm sdm

to make sure your script is started before the display managers. See
<URL:http://wiki.debian.org/LSBInitScripts> or insserv(Cool for more
info on the available headers.

Happy hacking,
--
Petter Reinholdtsen


--
To UNSUBSCRIBE, email to debian-devel-REQUEST.TakeThisOut@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.TakeThisOut@lists.debian.org
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Resolved bugs keeping packages out of testing? - Hi, I have several "excuses" pages that resemble this one: http://qa.debian.org/excuses.php?package=darcs-b...

[gentoo-user] Bug in init script variables? [was: GETTING .. - Ok, I found the problem... I have the following: server root # cat /etc/conf.d/cyrus export..

[gentoo-user] Kernel panic: No init found. Try passing ini.. - Greetings! While moving the laptop, I lost the power and the installation was not complete. I was about to start..

Kernel panic. No init found. Try passing init=option to ke.. - Hi All, I have following errors when I start my machine(RH8.0). EXT3-fs:unable to read super block mount: error 22..

Build Daemon - Hello What is the current status of the ARM build servers ? I may be in a position to offer hosting and support in..

Lisa Daemon - I am using KDE and Fedora Core 1. Also web browser Konqueror. In Konqueror window there is a "Network Browser.&q...
       Soft32 Home -> Linux -> Development All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can 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

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]