Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 366863 - app-misc/g15daemon: init.d script isn't functional when g15daemon is started via udev
Summary: app-misc/g15daemon: init.d script isn't functional when g15daemon is started ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-11 10:57 UTC by BT
Modified: 2012-02-22 08:20 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
g15daemon hotplugging log (hotplugging.log,5.99 KB, text/plain)
2011-09-09 07:04 UTC, BT
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BT 2011-05-11 10:57:52 UTC
For quite some time now I've been seeing the following message during boot:

* Starting g15daemon ...
* start-stop-daemon: /usr/sbin/g15daemon is already running
* Failed to start g15daemon.                                  [ !! ]
* ERROR: g15daemon failed to start

I recently discovered that g15daemon was actually being started via the udev rule '/lib/udev/rules.d/99-g15daemon.rules'.

Since I already had g15daemon added to the default runlevel (on advice from the ebuild pkg_postinst() message), it wasn't able to start via the runlevel and resulted in the above error message.

Now that I've removed g15daemon from the default runlevel, it starts without error. However the init.d script is no longer functional when issuing start/stop/restart commands manually. I either get a 'ERROR: g15daemon failed to start' or 'WARNING: g15daemon is already stopped' message.

I believe the init.d script needs to be modified to check whether g15daemon is already running. It might also be a good idea to change the ebuild pkg_postinst() to advise users that g15daemon is started via udev and no longer needs to be added to the default runlevel.
Comment 1 BT 2011-05-12 02:47:44 UTC
I should also add that udev will sometimes fail to start g15daemon, although not very often. Maybe the solution to this problem is to add a udev use flag to control the installation of '/lib/udev/rules.d/99-g15daemon.rules'.
Comment 2 Tomáš "tpruzina" Pružina (amd64 [ex]AT) 2011-07-17 19:00:14 UTC
I can confirm this issue, amd64.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-08-03 07:49:35 UTC
/usr/bin/g15daemon-hotplug just runs the init.d script. Somehow you are getting the daemon without the script starting. I've alter the hotplug script slightly in -r4 on a lark, please retest.
Comment 4 BT 2011-08-03 10:33:12 UTC
g15daemon doesn't start at all now during boot (udev) or when hot plugging. It does start if I revert your changes to g15daemon-hotplug.
Comment 5 BT 2011-09-09 07:03:31 UTC
With 'IN_HOTPLUG=1' in '/usr/bin/g15daemon-hotplug' I see the following in '/var/log/messages':

/etc/init.d/g15daemon[2823]: g15daemon: not allowed to be hotplugged

However with 'IN_HOTPLUG=0' I can hotplug the keyboard and g15daemon starts. So it appears that your changes to '/usr/bin/g15daemon-hotplug' in -r4 disables hotplugging. Was this intentional?

I also did some further tests to see what g15daemon was doing in response to the keyboard being hotplugged.

Initially the keyboard was unplugged and g15daemon stopped. I plugged the keyboard in and unplugged it 30 seconds later. I noticed that g15daemon wasn't being stopped. Instead '/var/log/messages' was flooded with the
following:

g15daemon[3059]: Keyboard has gone.. Retrying

After plugging the keyboard in again g15daemon was restarted as expected. So it appears that the g15daemon init.d script isn't responding to the 'remove' hotplug action.

I've attached a snippet of '/var/log/messages' so you can see for yourself. If you need any more info please let me know.
Comment 6 BT 2011-09-09 07:04:43 UTC
Created attachment 285913 [details]
g15daemon hotplugging log
Comment 7 Tomáš "tpruzina" Pružina (amd64 [ex]AT) 2011-09-09 08:17:29 UTC
(In reply to comment #5)
> ...

interesting, I'll try it and report back soon. For now I've created simple scripts that do start after (re)start of X or when coming out of hibernation.
Comment 8 BT 2012-02-22 08:20:05 UTC
(In reply to comment #7)

Did you get around to testing this?