# svcadm disable lrc:/etc/rc3_d/S50httpd
svcadm: Operation not supported for legacy service 'lrc:/etc/rc3_d/
S50httpd'
The script is in /lib/svc/method/http-apache2.
Of course, when you try to kill it off, SMF just keeps respawning.
I wonder if the method scripts are cached somewhere, as I made a
couple of changes and it they didn't seem to take place until after
the system was rebooted.
Looking around the internet, the docs I see don't talk much about
handling legacy services, just describing what they are.
So how do you manually stop and start a legacy service like this?
Thanks.
Did you know Solaris 10 ships with Apache2? Last time I looked, the
CSWapache2 package had some notes on how to use it with SMF.
> After a while, it occurred to me the method I expected to stop
> and start these services manually doesn't work:
>
> # svcadm disable lrc:/etc/rc3_d/S50httpd
> svcadm: Operation not supported for legacy service 'lrc:/etc/rc3_d/
> S50httpd'
>
> The script is in /lib/svc/method/http-apache2.
This is the stock Solaris 10 Apache2 script.
> Of course, when you try to kill it off, SMF just keeps respawning.
> I wonder if the method scripts are cached somewhere, as I made a
> couple of changes and it they didn't seem to take place until after
> the system was rebooted.
>
> Looking around the internet, the docs I see don't talk much about
> handling legacy services, just describing what they are.
>
> So how do you manually stop and start a legacy service like this?
Use the legacy script.
--
Ian Collins
The installation now does the SMF automatically. I didn't see
anything else in the package.
>
> > After a while, it occurred to me the method I expected to stop
> > and start these services manually doesn't work:
>
> > # svcadm disable lrc:/etc/rc3_d/S50httpd
> > svcadm: Operation not supported for legacy service 'lrc:/etc/rc3_d/
> > S50httpd'
>
> > The script is in /lib/svc/method/http-apache2.
>
> This is the stock Solaris 10 Apache2 script.
Ah, okay - for some reason I thought CSW was doing this. Never the
less, I modified it to suit our setup for /opt/csw and it "sorta"
works.
>
> > So how do you manually stop and start a legacy service like this?
>
> Use the legacy script.
The legacy script just calls apachectl. When you do this, the httpd
process is just respawned. It will not stop. That's the problem.
Thanks.
SMF should not be restarting legacy items. What's the parent PID of httpd?
Is it owned by SMF?
If you dig out the contract id using "ps -o ctid -p <pid>" and dig up the
contract information using "ctstat -vi <ctid>", which service is it
associated with?
--
Brandon Hume - hume -> BOFH.Ca, http://WWW.BOFH.Ca/
Sorry, I just realized ctstat won't produce an FMRI on Solaris 10. You can
list the processes associated with a service using "svcs -p", though.
I would list all of them. I think you might find that the httpd you're
seeing isn't coming from the FMRI you think it is.
online 18:33:20 svc:/network/cswapache2:default
18:33:20 9863 httpd.prefork
3:10:01 11568 httpd.prefork
3:10:01 11569 httpd.prefork
3:10:01 11570 httpd.prefork
3:10:01 11571 httpd.prefork
3:10:01 11572 httpd.prefork
3:15:08 11592 httpd.prefork
and this
legacy_run Apr_26 lrc:/etc/rc2_d/S50httpd
which is a symlink to:
lrwxrwxrwx 1 root root 17 Dec 10 2008 /etc/rc2.d/
S50httpd -> /etc/init.d/httpd
which points to /opt/csw/apache2
The cswapache2 points to the same location.
I think the /etc/init.d/httpd should be a symlink to the /etc/opt/csw/
init.d/cswapache2 script -- but I don't understand the lrc: (legacy)
input - I want one of them removed, and I think that must be the
culprit that is respawning httpd even when shut down via the script.
Thanks.
The developers here really just prefer the simple /etc/init.d method
-- 99% of our systems are Linux-based.
The contents of /etc/rc?.d are symlinks to the scripts in /etc/init.d.
So /etc/rc3.d/S50apache will now be a symlink to a symlink to a script.
It won't matter much, although personally I would have removed the
/etc/rc3.d symlink, backed up /etc/init.d/httpd to
/etc/init.d/httpd_unused, and put a script in /etc/init.d/httpd that
simply called svcadm as needed.
> The developers here really just prefer the simple /etc/init.d method
> -- 99% of our systems are Linux-based.
Why not just replace the Solaris box with Linux, then? That'll keep them
happy... at least, until Upstart and its equivalents catch on.
I've seen multiple Solaris machines turned into unstable wrecks when the
admins and users tried to turn them into Linux one piece at a time. Then
they inevitably blame Solaris for being such a shoddy Linux.
What was wrong with the pre-installed Solaris Apache2?
--
Ian Collins
Maybe he can't run pre-installed Solaris Apache2 due to some security
requirements from "above" him. I get that A LOT where I work. These
so-called security wanna-bes see an IAVM (IAVA) come out and it says
some software version 1.2.3.4 is "bad" and that we MUST upgrade NOW,
or get "turned-off". Drives me insane. So, we have little choice in
the matter. Either we must learn the complexities of compiling many
different packages that must play nice together or rely on 3rd party
distributors (which we HOPE we can trust, of whom seem to do a good
job keeping ahead of the upgrade madness). It's a bad situation we're
put in all the time.
Maybe Oracle will maintain Open Source Repositories better than Sun
did. It can be argued with several view points, many of which are
valid. I know many of us are not looking at Oracle with high-hopes,
but only time will tell. I hear Wal-Mark is hiring.
{:-\