Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 215355 - sys-apps/openrc: allow init scripts to override default status function
Summary: sys-apps/openrc: allow init scripts to override default status function
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-29 19:21 UTC by Tomáš Chvátal (RETIRED)
Modified: 2009-04-22 15:54 UTC (History)
2 users (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 Tomáš Chvátal (RETIRED) gentoo-dev 2008-03-29 19:21:59 UTC
i use self written initscripts and i have in them status function which reports something to me.
when i use it with new baselayout it only says: status ok
it will be really nice to allow user (in this actualy initscript) overrride this so it calls function in script itself.
alternative would be alowing other functions in scripts.
if i rename it to ie stat() and call it returns unknown function `stat' (btw there is really typo in that first comma)

Reproducible: Always

Steps to Reproduce:
use baselayout 2 and have some status() function in initscript

Actual Results:  
 * status: started

Expected Results:  
really nice dump of stuff i really need
Comment 1 Doug Goldstein (RETIRED) gentoo-dev 2008-03-31 16:39:00 UTC
Can you give a functional example? I'm opposed to this unless there's some real benefit.

How about rc-status? How do you expect that to work?
Comment 2 SpanKY gentoo-dev 2008-03-31 17:20:51 UTC
rc-status doesnt work the same way

overriding the default status function is fine as the output is meant for humans to consume
Comment 3 Roy Marples 2008-03-31 17:35:31 UTC
(In reply to comment #2)
> overriding the default status function is fine as the output is meant for
> humans to consume

What about the return value? A lot of 3rd party scripts do this

if /etc/init.d/foo --quiet status; then
    $action_if_started
else
    $action_if_stopped
fi
Comment 4 SpanKY gentoo-dev 2008-03-31 17:50:20 UTC
that is why i referred to the output, not the exit status
Comment 5 Doug Goldstein (RETIRED) gentoo-dev 2008-03-31 18:07:07 UTC
Well aware that rc-status doesn't work the same. But let's say the proposal is the have Apache say "Serving # vhosts". Would you want rc-status to just say "started" or some shortened version there of. That was my question to the user what HE expected in his suggestion. 
Comment 6 Tomáš Chvátal (RETIRED) gentoo-dev 2008-04-01 11:09:46 UTC
ok i put status function to my firewall just for testing.
on old baselayout output looks like:
root@hlukotvor: ~ # rc-status
 firewall                                                                                                                     [ started  ]
...
root@hlukotvor: ~ # /etc/init.d/firewall status
 * status:  started
### /sbin/iptables -nvL #################################
Chain INPUT (policy DROP 4012 packets, 474K bytes)
...

with baselayout2 and openrc:
scarab@Ugly-Elf: ~ > s rc-status
 firewall                                                                                                                      [  started  ]
...
scarab@Ugly-Elf: ~ > s /etc/init.d/firewall status
 * status: started
Comment 7 Tomáš Chvátal (RETIRED) gentoo-dev 2008-04-01 11:12:02 UTC
so allow another functions into initscripts and i will use them unless that i need more info from some scripts than "status: started" really
Comment 8 Doug Goldstein (RETIRED) gentoo-dev 2008-10-07 15:55:04 UTC
Roy? Mike?
Comment 9 Benedikt Böhm (RETIRED) gentoo-dev 2009-04-18 10:40:07 UTC
fixed in 0.4.3-r2, thanks
Comment 10 Tomáš Chvátal (RETIRED) gentoo-dev 2009-04-22 15:54:46 UTC
(In reply to comment #9)
> fixed in 0.4.3-r2, thanks
> 

I LOVE YOU :]
(note this is not spam i am really happy and really sorry i had no time to do it myself)