Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 274484 - (~amd64)sys-apps/halevt-0.1.4: Init script broken (PID file in wrong location)
Summary: (~amd64)sys-apps/halevt-0.1.4: Init script broken (PID file in wrong location)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Markos Chandras (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-17 09:33 UTC by Laurence
Modified: 2009-06-19 19:01 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurence 2009-06-17 09:33:13 UTC
As per halevt's man page, it's default pid file is '/var/lib/run/halevt/halevt.pid'. The packaged init script calls start-stop-daemon with the argument '--pidfile /var/run/halevt.pid'. As a result the init script cannot stop the daemon.

Running '/etc/init.d/halevt stop' fails silently because the pid file it's looking for does not exist. Running '/etc/init.d/halevt restart' causes multiple halevt daemons to run (the first silently fails to stop and a new one gets started successfully).

To fix: modify the init script to either:
 a. pass '-p /var/run/halevt.pid' to halevt (i.e. "start-stop-daemon --start --pidfile /var/run/halevt.pid --exec /usr/bin/halevt -- -p /var/run/halevt -u root -g plugdev > /dev/null")
or
 b. change start-stop-daemon to use the default pid file (i.e. "start-stop-daemon --start --pidfile /var/lib/run/halevt/halevt.pid --exec ..." and "start-stop-daemon --stop --pidfile /var/lib/run/halevt/halevt.pid")

Reproducible: Always

Steps to Reproduce:
1. Run '/etc/init.d/halevt start'.
2. Note that halevt is running (`ps aux | grep halevt`) but no halevt.pid file exists in /var/run, a halevt.pid exists in /var/lib/run/halevt
3. Run '/etc/init.d/halevt restart'
4. Note two copies of halevt are now running.



Expected Results:  
`/etc/init.d/halevt stop` should stop the daemon.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2009-06-17 11:15:21 UTC
@hwoarang: kargig@void.gr is not a valid bugzilla account. Please fix that in metadata.xml.
Comment 2 Markos Chandras (RETIRED) gentoo-dev 2009-06-17 14:31:03 UTC
Adding proxy maintainer to that

I ll fix the metadata accordingly
Comment 3 Markos Chandras (RETIRED) gentoo-dev 2009-06-17 15:04:13 UTC
+*halevt-0.1.4-r1 (17 Jun 2009)
+
+  17 Jun 2009; Markos Chandras <hwoarang@gentoo.org>
+  +halevt-0.1.4-r1.ebuild, files/halevt:
+  Init script fixed. Bug 274484 . Thanks to Laurence <loz.hurst@gmail.com>
+  for
+  the proposed patch


Thanks for reporting this and providing a solution :)

Closing

Re-open if needed
Comment 4 George Kargiotakis 2009-06-19 19:01:41 UTC
New init file added that uses: 
start-stop-daemon --start --pidfile /var/run/halevt.pid --exec /usr/bin/halevt -- -p /var/run/halevt.pid -u root -g plugdev > /dev/null


Having the pid file in /var/run/halev.pid is much more consistent with other gentoo system services.