Seema Please see inline Seema Alevoor wrote: >>> They need to play well together. The rest is implementation detail. >>> (I thought that was all sorted out already, no?) >>> >>> >>> >>> >> That is what I too thought. So, I am confused as to the need for this >> 'apachectl.smf' script - is this an implementation detail , that won't >> be exposed to the customers ? >> >> If yes, then again my concern is - why can't we leverage already >> existing '/lib/svc/method/http-apache2' script for this purpose. >> > > /lib/svc/method/http-apache2 is normally used by the SMF framework to > start/stop the service. > http-apache2 is not expected to invoke "svcamd enable .." command. > > You would be adding svcadm enable in apachectl start option. And within http-apache2, you will have the implementation on how to start the apache server. > If we can modify apachectl interface (like adding more options), then there > is no need > for another script. > > +1 > I would like to know > > 1. If apachectl interface can be modified? > Interface should only be known with respect to exposed command line options (for example, start, stop) is the common interface that customers are familiar with. Now, what we do within start option and how we start the server internally when user invokes apachectl start is an implementation detail that they shouldn't have to worry about. How we start the server within apachectl start is again only an implementation detail and not actual interface. > 2. If no, then should we ask the users to manually invoke svcamd commands ? > If we patch apachectl to internally invoke svcadm and further use http-apache2 to actually start the server then apachectl will be integrated into SMF and customer will have a seamless experience using either of them. > 3. or should we provide a wrapper script and handle svcadm command invocation > from within the script ? > IMO, -1 . another wrapper script if it is going to be an external implementation that customer will need to know. > 4. or should we reuse /lib/svc/method/http-apache2 to invoke svcamd command > and > ask the user to run "/lib/svc/method/http-apache2 start" to start the smf > service ? > > > No, you misunderstood. Customer does not have to remember anything new other apachectl start and svcadm enable. Now, how do we integrate these 2 is upto us. My suggestion is to patch apachectl start so that the following control happens
user invokes apachectl start -> we internally invoke it as svcadm enable -> SMF internally translates this and calls /lib/svc/method/http-apache2 -> where we now provide actual implementation to start the server. Now, if a user wants to start the server in worker mode, if in case, we provide apachectl start-worker as an option, then apachectl can set the appropriate SMF property and invoke svcadm enable -> which should again read the SMF property and start the server with worker MPM. Hope this clarifies thanks sriram
