The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
stop rsh in solaris murad.jaber SUN Solaris 2 09-03-2007 07:03 AM
Stop DHCP in Solaris 10 shabu SUN Solaris 2 05-29-2007 06:12 AM
how to stop rsh on solaris 10 b_manu78 SUN Solaris 1 04-21-2006 08:34 AM
how to start and stop the network in Solaris 9?? eldiego UNIX for Dummies Questions & Answers 1 11-21-2005 05:28 PM
Help: how to start/stop FTP server in solaris? eddsos SUN Solaris 1 08-07-2005 10:32 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 02-12-2007
Registered User
 

Join Date: Jan 2007
Posts: 4
Solaris 10 apache2 (how to stop the restarter)

Hi

Please bear with me, I am a noob

I've got a Apache2 webserver running on my Solaris 10 server, how do I stop the service restarting everytime it is invoked manually?



fmri svc:/network/http:apache2
name Apache 2 HTTP server
enabled true
state online
next_state none
state_time Fri Feb 09 18:32:19 2007
logfile /var/svc/log/network-http:apache2.log
restarter svc:/system/svc/restarter:default
contract_id 10573
dependency require_all/error svc:/milestone/network:default (online)
dependency require_all/none svc:/system/filesystem/local:default (online)
dependency optional_all/error svc:/system/filesystem/autofs:default (online)


Thanks in advance


p

Last edited by parmars; 02-12-2007 at 02:56 AM. Reason: typo
Reply With Quote
Forum Sponsor
  #2  
Old 02-12-2007
reborg's Avatar
Administrator
 

Join Date: Mar 2005
Location: Ireland
Posts: 3,590
what exactly do you mean by: "everytime it is invoked manually"
Reply With Quote
  #3  
Old 02-12-2007
Registered User
 

Join Date: Jan 2007
Posts: 4
Hi

Thanks for the reply


We have a set of users on this machine that stop and start apache (as sudo root)
They need to be able to stop the service and make there changes (not sure what) and then restart the service via the command line.

The issue they have is that as soon as they stop the service, it respawns staight away.

Hope this helps?

Cheers

p
Reply With Quote
  #4  
Old 02-12-2007
Registered User
 

Join Date: Jan 2007
Posts: 366
svcadm disable apache2 to stop
svcadm enable apache2 to start
Reply With Quote
  #5  
Old 02-12-2007
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
How are they currently stopping the Apache server? The restarter will try to restart (obviously) any service that is not stopped using the svcadm facility. Make sure that the sudo users use the commands posted by sb008 to stop and start Apache.
Reply With Quote
  #6  
Old 02-13-2007
Registered User
 

Join Date: Jan 2007
Posts: 4
Hi

Many thanks for the reply gents.

The users were set up in the sudoers file to run the following :
/usr/apache2/bin/apachectl which is a shell script.

Which they run parse some arguments with the command to restart the service.

But it looks like this is conflicting with the built in restater process.

Any thoughts around this, should I let the users have sudo access to stop/start the svadm disable/enable apache2 command, or try and figure out another way?


Cheers

p
Reply With Quote
  #7  
Old 02-13-2007
Registered User
 

Join Date: Jan 2007
Posts: 366
Quote:
Originally Posted by parmars
Hi

Many thanks for the reply gents.

The users were set up in the sudoers file to run the following :
/usr/apache2/bin/apachectl which is a shell script.

Which they run parse some arguments with the command to restart the service.

But it looks like this is conflicting with the built in restater process.

Any thoughts around this, should I let the users have sudo access to stop/start the svadm disable/enable apache2 command, or try and figure out another way?


Cheers

p
That is how SMF is intented to be.

So your approach does indeed conflict with SMF.

It is better to use "sudo", but don't give your users direct access to svcadm because then they will be able to stop/start any process.

Instead you should make 2 scripts (owned by root).

1 script for stopping Apache; with the "svcadm disable apache2" command inside and
1 script for starting Apache; with the "svcadm enable apache2" command
inside

Or maybe even a single script will do; with the "svcadm refresh apache2" command inside, which will allow users to restart Apache
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:09 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0