FS#5721 - implement status option in rc.d scripts

Attached to Project: Arch Linux
Opened by Roman Kyrylych (Romashka) - Tuesday, 31 October 2006, 13:17 GMT
Last edited by Allan McRae (Allan) - Friday, 13 March 2009, 04:19 GMT
Task Type Feature Request
Category System
Status Closed
Assigned To Aaron Griffin (phrakture)
Dan McGee (toofishes)
Allan McRae (Allan)
Architecture All
Severity Medium
Priority Normal
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Currently there is support for daemon status function in /etc/rc.d/functions - function ck_daemon() but I didn't see a rc.d script which support status option. IMHO it's useful, so why not to add it? But what message convention to use? "RUNNING"/"STOPPED" or what?
This task depends upon

Closed by  Allan McRae (Allan)
Friday, 13 March 2009, 04:19 GMT
Reason for closing:  Implemented
Additional comments about closing:  See final comment
Comment by héctor (hacosta) - Saturday, 05 January 2008, 23:08 GMT
i added two new functions to the function file and the status option for the cron initscript, if this is fine, i can add the option to other initscripts
Comment by héctor (hacosta) - Sunday, 06 January 2008, 04:22 GMT
edit: 4 letters seems to be the convention.. please disregard the first function-status.diff
Comment by Gavin Bisesi (Daenyth) - Friday, 25 April 2008, 05:14 GMT
Here's a modified rc-script.proto
Comment by Aaron Griffin (phrakture) - Friday, 25 April 2008, 14:59 GMT
Aren't these part of ABS now? If not, travis let me know as I can remove you from here.

PS While we're changing the rc.d prototype, usage of "source_functions" would be helpful (it sources the functions.d dir)
Comment by Travis Willard (Cerebral) - Friday, 25 April 2008, 15:00 GMT
The proto file is a part of ABS, yes. The functions aren't.
Comment by Aaron Griffin (phrakture) - Friday, 25 April 2008, 15:03 GMT
Right right - I just mean that the prototype has ". /etc/rc.d/functions" at the top. All the initscripts ALSO call source_functions after that (source_functions is defined in /etc/rc.d/functions.d/)
Comment by Travis Willard (Cerebral) - Friday, 25 April 2008, 15:09 GMT
Yeah, that's fine - I was just commenting that you said "Aren't THESE a part of ABS now?" "these" aren't a part of ABS - just the one proto file is a part of abs. ;) But now I'm getting nitpicky
Comment by Aaron Griffin (phrakture) - Friday, 25 April 2008, 15:13 GMT
Ah, sorry my fault - "these" meaning "the prototypes" - rc.d, PKGBUILD, install script, etc
Comment by Travis Willard (Cerebral) - Friday, 25 April 2008, 15:16 GMT
Well, the original PKGBUILD and install script prototypes are a part of the pacman package. The 'exotic' prototypes (cvs packages, svn packages, perl packages, etc...) and the rc.conf script prototype are a part of ABS
Comment by Glenn Matthys (RedShift) - Tuesday, 17 June 2008, 19:18 GMT
What's the resolution of this? Will an prototype rc.d init script be provided by abs?
Comment by Allan McRae (Allan) - Sunday, 06 July 2008, 06:58 GMT
So the current status of this:

- ABS provides an rc-script prototype

- Adding source_functions to it will no longer be needed because /etc/rc.d/functions in initscripts git repo does this automatically

- The functions for printing status information have not been added to /etc/rc.d/functions yet. Once this is done, the status option can be added to the abs rc-script prototype
Comment by Gavin Bisesi (Daenyth) - Tuesday, 07 October 2008, 15:44 GMT
The functions seem to be added to /etc/rc.d/functions, but rc-script.proto does not yet include the status option.
Comment by Glenn Matthys (RedShift) - Friday, 05 December 2008, 11:45 GMT
IMO a status option is a bit useless. I've never had the need to use such a function.
Comment by Dan McGee (toofishes) - Friday, 05 December 2008, 13:18 GMT
Wow, really? Suggest closing the task because *you* don't have use for it? I think this is a great idea and relatively easy from our point of view.
Comment by Glenn Matthys (RedShift) - Friday, 05 December 2008, 13:24 GMT
Yes. Because we already have /var/run/daemons to check if something is running and nothing a simple ps xfau and grep can't solve.
Comment by Aaron Griffin (phrakture) - Friday, 05 December 2008, 21:02 GMT
Minor modification of the above patch:
http://phraktured.net/status-functions.patch

Is this ok with you all?
Comment by Glenn Matthys (RedShift) - Friday, 05 December 2008, 21:09 GMT
I'm still against it.
Comment by Aaron Griffin (phrakture) - Tuesday, 23 December 2008, 22:47 GMT Comment by Allan McRae (Allan) - Friday, 26 December 2008, 14:05 GMT
As STARTED and STOPPED are longer than the usual DONE/BUSY/FAIL, you need to get rid of the three spaces at the start of the two "echo -ne" lines of that patch.
Comment by Allan McRae (Allan) - Friday, 26 December 2008, 14:13 GMT
Also, in ck_status, status_started and status_stopped are the wrong way around.
Comment by Allan McRae (Allan) - Monday, 09 March 2009, 09:57 GMT
This patch fixes the above issues. I do not have commit access to push this.
Comment by Aaron Griffin (phrakture) - Monday, 09 March 2009, 19:14 GMT
Pushed to master
Comment by Allan McRae (Allan) - Friday, 13 March 2009, 04:19 GMT
Support for this is in initscripts-2009-03-2 and a prototype for this is in the abs-2.3.1-1 package.
Closing in favour of  FS#4688 

Loading...