Ticket #159 (closed defect: fixed)

Opened 18 months ago

Last modified 16 months ago

runscript does not call status

Reported by: jabronson@gmail.com Owned by: roy
Priority: major Milestone:
Component: rc Version: 0.4
Keywords: Cc:

Description

If I implement a status function in an initscript, runscript does not call it.

Change History

comment:1 Changed 18 months ago by roy

OpenRC does not allow a custom status function at this time

comment:2 follow-up: ↓ 3 Changed 18 months ago by jabronson@gmail.com

are there plans to support this in the future? this used to work before I upgraded to baselayout 2.

i am relying on a custom status function in my ebuild of  couchdb, which provides its own  script to manage stopping (pass -b), starting (pass -d), and getting the status (pass -s) of the daemon. the initscript i provide with the ebuild should be able to just call out to the provided script with the appropriate option in its start, stop, and status functions. because of the way couchdb works, the default way openrc checks status is not always consistent with couchdb's actual status. getting the status via couchdb -s is guaranteed to be correct.

in the meantime, i've renamed the function to "fullstatus", but it would be nice to be able to just call it "status". i can try to write a patch if that would be helpful?

thanks,
josh

comment:3 in reply to: ↑ 2 Changed 17 months ago by roy

Replying to jabronson@…:

are there plans to support this in the future? this used to work before I upgraded to baselayout 2.

To be truthful I'm still in two minds about it.
I suppose that if the custom status function can return the correct codes then we can allow it - which is why I haven't done so far.

You can try writing a patch if you like - however we would need support in /lib/rc/sh/runscript.sh so we could write something like this

status()
{
   if custom_service_running; then
      einfo "Started"
      return ${SERVICE_STARTED}
   else
      eerror "Crashed"
      return ${SERVICE_CRASHED}
   fi
}

But to be fair, I'm not sure that we return a crashed status anyway. We'll need to ensure it does.

comment:4 Changed 16 months ago by roy

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r1520

Note: See TracTickets for help on using tickets.