Summary: | sys-block/tgt-1.0.24-r1 - init.d script always claims tgtd isn't running | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jernej Simončič <jernej-bugzilla.gentoo2> |
Component: | [OLD] Core system | Assignee: | Matthew Thode ( prometheanfire ) <prometheanfire> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alexanderyt, bug, cluster, orzel, stasibear |
Priority: | Normal | ||
Version: | 10.1 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | tgtd init patch |
Description
Jernej Simončič
2013-08-28 17:54:34 UTC
I ran into this tonight, so it's still an issue. As the submitter pointed out, the status checks for two running processes that match 'tgtd', which fails when the third (grep) process runs. Since tgtd doesn't create a pid file, a slightly better test might be "Are two processes running whose names start with tgtd, one of which is the other's parent?" We could even start the process as "tgtd --debug 0" to make the text match better. The "--debug 0" would be a no-op, and would have to be omitted if the user specified an actual --debug in /etc/conf.d/tgtd. Unrelatedly, the stop command fails to stop the daemon, and I question the assumption in the comments "tgtd will exit if all targets were removed". The whole script could probably use review. Created attachment 381178 [details, diff]
tgtd init patch
Proposed fix. Uses pidof (from procps, a base package).
Test case:
1. /etc/init.d/tgtd start
2. /etc/init.d/tgtd status
Expect: Messaging that tgtd is running
Actual: Messaging "tgtd is NOT running", ps shows tgtd processes
I've kept on having problems such as this one with tgtd init scripts (for 1.5 years). I'm gonna work on it sometime this week(end). Fixed in 1.0.60 |