Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 434032 - sys-apps/openrc does not always stop services correctly if values in the init scripts change
Summary: sys-apps/openrc does not always stop services correctly if values in the init...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 439098
  Show dependency tree
 
Reported: 2012-09-05 15:20 UTC by Jeremy Olexa (darkside) (RETIRED)
Modified: 2013-01-15 18:33 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 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-09-05 15:20:29 UTC
% date ; sudo /etc/init.d/munin-node restart
Wed Sep  5 15:18:17 UTC 2012
 * Stopping munin-node ...
 * start-stop-daemon: fopen `/var/run/munin-node.pid': No such file or di [ ok ]
 * Starting munin-node ...    
% date ; sudo /etc/init.d/munin-node restart
Wed Sep  5 15:18:18 UTC 2012
 * Stopping munin-node ...
 * start-stop-daemon: fopen `/var/run/munin-node.pid': No such file or di [ ok ]
 * Starting munin-node ...                                                [ ok ]

So, something goes wierd in the init script. I am using stable x86 with ~arch munin.
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-09-30 07:16:11 UTC
Uhm, I can't reproduce this.. is it correct in your /etc/munin/munin-node.conf ?
Comment 2 Michael Hampicke 2012-12-08 11:22:01 UTC
I'm having the some problem on two different machines (both x86_64)

# /etc/init.d/munin-node restart
 * Stopping munin-node ... 
 * start-stop-daemon: fopen `/var/run/munin-node.pid': No such file or directory                                [ ok ]
 * Starting munin-node ...                                                                                      [ ok ]


# grep pid /etc/munin/munin-node.conf 
pid_file /var/run/munin-node.pid


# ls /var/run/munin-node.pid
ls: cannot access /var/run/munin-node.pid: No such file or directory
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-12-08 11:28:33 UTC
Is munin-node running at that point for real?

Do note that the pid file is created by the node itself, and not from the init script.

Also, can you post the full munin-node.conf?
Comment 4 Michael Hampicke 2012-12-08 13:15:06 UTC
Yes, munin-node was running at that time. My problem is now solved, but I am not sure why exactly. I did not touch the config file, the only thing I did in the meantime was: I killed munin-node manually, re-emerged munin and then started it via init script. This time the pid file was created.
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-12-08 19:42:40 UTC
I have a hunch — was that just after an update?
Comment 6 Michael Hampicke 2012-12-10 14:42:03 UTC
If your hunch is, that the problem occurred after the last update and the new init script did not kill the old munin-node instance, and ever since that an old version of munin-node was running in the background. I would think the same (as I did update munin at about a week ago).
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-12-10 18:19:50 UTC
Yeah that was the thing.


William, does it feel like it might make sense to store the pidfile path at start, and use it during stop by default? I know I should be able to store/load it myself, but maybe solving it in runscript is easier on the long term.
Comment 8 William Hubbs gentoo-dev 2012-12-10 18:49:30 UTC
(In reply to comment #7)
> William, does it feel like it might make sense to store the pidfile path at
> start, and use it during stop by default? I know I should be able to
> store/load it myself, but maybe solving it in runscript is easier on the
> long term.

I'm not sure I am following. If the pidfile variable is set to the correct value it is used in the default start/stop functions, so I'm not sure what you mean.
Comment 9 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-12-10 18:58:45 UTC
Sorry, the only thing that might happen in this case is that the pidfile changes before/after update.

Before update, the configuration file used /var/run/munin/munin-node.pid (which requires a checkpath).

After update, the configuration file uses /var/run/munin-node.pid (no checkpath needed).

But if you update, the stop is executed already with the new pidfile (which no longer matches) instead of the old one.
Comment 10 Diego Elio Pettenò (RETIRED) gentoo-dev 2013-01-15 16:04:19 UTC
William any hope on this?
Comment 11 William Hubbs gentoo-dev 2013-01-15 18:33:29 UTC
This was brought to my attention as an issue which should be fixed in
OpenRC itself. The fix is in commit 6b3a411 and will be included in
openrc-0.12.