[arch-projects] [initscripts][RFC] deprecating ck_depends
Hi guys, I'm trying to resolve FS#20903, and I think the only sensible solution is to stop using the ck_depends function. I'd like to hear your opinion on this. This is the situation: ck_depends was introduced in <http://projects.archlinux.org/initscripts.git/commit/?id=2c9681f461a0cde98a88de65e232369df68ed859> as a simple mechanism to implement dependencies. What it does, is that it allows an rc script to start other rc scripts. However, it is not equivalent to adding the depedent rc scripts to the DAEMONS array. The problem is that at shutdown, we have no record of when the dependencies were started, and therefore treat them as if they were started by the user during runtime. The end result is that the dependencies of a daemon are started before the daemon (as expected), but also stopped before the daemon (contrary to the expectation). I don't think parsing the rc scripts at shutdown to figure out the dependencies could work, nor do I think it is in the spirit of our initscripts. The only correct solution (IMHO) to resolve a dependency is to ask the user to add the relevant daemon to the DAEMONS array. I therefore suggest marking ck_depends as deprecated, and print a warning whenever it is used. Did I miss something? Any opinions? Cheers, Tom
On Thu, Jun 23, 2011 at 5:37 PM, Tom Gundersen <teg@jklm.no> wrote:
Hi guys,
I'm trying to resolve FS#20903, and I think the only sensible solution is to stop using the ck_depends function. I'd like to hear your opinion on this.
This is the situation: ck_depends was introduced in <http://projects.archlinux.org/initscripts.git/commit/?id=2c9681f461a0cde98a88de65e232369df68ed859> as a simple mechanism to implement dependencies.
What it does, is that it allows an rc script to start other rc scripts. However, it is not equivalent to adding the depedent rc scripts to the DAEMONS array. The problem is that at shutdown, we have no record of when the dependencies were started, and therefore treat them as if they were started by the user during runtime.
The end result is that the dependencies of a daemon are started before the daemon (as expected), but also stopped before the daemon (contrary to the expectation).
I don't think parsing the rc scripts at shutdown to figure out the dependencies could work, nor do I think it is in the spirit of our initscripts. The only correct solution (IMHO) to resolve a dependency is to ask the user to add the relevant daemon to the DAEMONS array.
I therefore suggest marking ck_depends as deprecated, and print a warning whenever it is used.
Did I miss something? Any opinions?
I agree. This should be removed. I didn't even know it existed on arch. I think we should not handle dependancy between daemons. Let sysadmin, customize its arch. -- Sébastien Luttringer www.seblu.net
Tom Gundersen, 2011-06-23 17:37:
Hi guys,
I'm trying to resolve FS#20903, and I think the only sensible solution is to stop using the ck_depends function. I'd like to hear your opinion on this.
This is the situation: ck_depends was introduced in <http://projects.archlinux.org/initscripts.git/commit/?id=2c9681f461a0cde98a88de65e232369df68ed859> as a simple mechanism to implement dependencies.
What it does, is that it allows an rc script to start other rc scripts. However, it is not equivalent to adding the depedent rc scripts to the DAEMONS array. The problem is that at shutdown, we have no record of when the dependencies were started, and therefore treat them as if they were started by the user during runtime.
The end result is that the dependencies of a daemon are started before the daemon (as expected), but also stopped before the daemon (contrary to the expectation).
I don't think parsing the rc scripts at shutdown to figure out the dependencies could work, nor do I think it is in the spirit of our initscripts. The only correct solution (IMHO) to resolve a dependency is to ask the user to add the relevant daemon to the DAEMONS array.
I therefore suggest marking ck_depends as deprecated, and print a warning whenever it is used.
Did I miss something? Any opinions?
Cheers,
Tom ACK. Actually there already appears to be a warning at the very beginning of function kicking in whenever a daemon is starting another one. I'll just add a comment to ck_depends in my upcoming patches. -- Kurt
Kurt J. Bosch, 2011-06-25 10:45:
Tom Gundersen, 2011-06-23 17:37:
Hi guys,
I'm trying to resolve FS#20903, and I think the only sensible solution is to stop using the ck_depends function. I'd like to hear your opinion on this.
This is the situation: ck_depends was introduced in <http://projects.archlinux.org/initscripts.git/commit/?id=2c9681f461a0cde98a88de65e232369df68ed859>
as a simple mechanism to implement dependencies.
What it does, is that it allows an rc script to start other rc scripts. However, it is not equivalent to adding the depedent rc scripts to the DAEMONS array. The problem is that at shutdown, we have no record of when the dependencies were started, and therefore treat them as if they were started by the user during runtime.
The end result is that the dependencies of a daemon are started before the daemon (as expected), but also stopped before the daemon (contrary to the expectation).
I don't think parsing the rc scripts at shutdown to figure out the dependencies could work, nor do I think it is in the spirit of our initscripts. The only correct solution (IMHO) to resolve a dependency is to ask the user to add the relevant daemon to the DAEMONS array.
I therefore suggest marking ck_depends as deprecated, and print a warning whenever it is used.
Did I miss something? Any opinions?
Cheers,
Tom ACK. Actually there already appears to be a warning at the very beginning of function kicking in whenever a daemon is starting another one. I'll just add a comment to ck_depends in my upcoming patches. -- Kurt
Nevermind it is already there. :/
On Sat, Jun 25, 2011 at 10:48 AM, Kurt J. Bosch <kjb-temp-2009@alpenjodel.de> wrote:
Kurt J. Bosch, 2011-06-25 10:45:
Tom Gundersen, 2011-06-23 17:37:
Hi guys,
I'm trying to resolve FS#20903, and I think the only sensible solution is to stop using the ck_depends function. I'd like to hear your opinion on this.
This is the situation: ck_depends was introduced in
<http://projects.archlinux.org/initscripts.git/commit/?id=2c9681f461a0cde98a88de65e232369df68ed859>
as a simple mechanism to implement dependencies.
What it does, is that it allows an rc script to start other rc scripts. However, it is not equivalent to adding the depedent rc scripts to the DAEMONS array. The problem is that at shutdown, we have no record of when the dependencies were started, and therefore treat them as if they were started by the user during runtime.
The end result is that the dependencies of a daemon are started before the daemon (as expected), but also stopped before the daemon (contrary to the expectation).
I don't think parsing the rc scripts at shutdown to figure out the dependencies could work, nor do I think it is in the spirit of our initscripts. The only correct solution (IMHO) to resolve a dependency is to ask the user to add the relevant daemon to the DAEMONS array.
I therefore suggest marking ck_depends as deprecated, and print a warning whenever it is used.
Did I miss something? Any opinions?
Cheers,
Tom
ACK. Actually there already appears to be a warning at the very beginning of function kicking in whenever a daemon is starting another one. I'll just add a comment to ck_depends in my upcoming patches. -- Kurt
Nevermind it is already there. :/
Yeah, I added both those things after sending the email (there was a discussion on IRC). The last remaining perpetrators are tracked here: <https://bugs.archlinux.org/task/24843>. -t
participants (3)
-
Kurt J. Bosch
-
Seblu
-
Tom Gundersen