Re: script to turn off services
- From: "Mike Burger" <mburger@xxxxxxxxxxxxxxxxx>
- Date: Thu, 17 Aug 2006 06:45:11 -0400 (EDT)
Not to be argumentative, but:
Since when does "service <servicename> status" give anything different
than "/etc/init.d/<servicename> status"?
It certainly doesn't, on my system:
[root@burgers ~]# service dansguardian status
Parent DansGuardian pid:3379
[root@burgers ~]# /etc/init.d/dansguardian status
Parent DansGuardian pid:3379
[root@burgers ~]# service dovecot status
dovecot (pid 3081) is running...
[root@burgers ~]# /etc/init.d/dovecot status
dovecot (pid 3081) is running...
[root@burgers ~]# service bluetooth status
hcid is stopped
sdpd is stopped
hidd is stopped
[root@burgers ~]# /etc/init.d/bluetooth status
hcid is stopped
sdpd is stopped
hidd is stopped
On Wed, August 16, 2006 1:42 pm, Wayne Pinette wrote:
rather than use service <servicename> I would use
/etc/init.d/<servicename> status
try /etc/init.d/bluetooth status. That usually gives you back a string
which tells you if it is running or not.
Then you can call /etc/init.d/bluetooth stop and chkconfig bluetooth
off
But I kind of agree with the other guy about not bothering to check
cause turning something off thats already off isn't an evil thing.
Wayner
On 8/16/06, Bill Tangren <bjt@xxxxxxxxxxxxxxxx> wrote:inode0@xxxxxxxxx 08/16/06 9:55 am >>>
I am trying to write a script that will turn off unneeded services,but I am not
having any luck. I have tried the following:and already
service bluetooth status > /dev/null 2>&1
EXITVALUE=$?
if [ $EXITVALUE == 0 ]; then
service bluetooth stop
chkconfig --level 345 bluetooth off
fi
This works if bluetooth is not installed, but not if it IS installed
turned off. In that case, the service command returns zero and the ifblock is
executed.tell me where
Does anyone know how to modify this script so that it will run (or
I can learn how to modify it)?
Why do you care what state it is in if you know you want it off?
Doesn't something simple (albeit parts may be unnecessary but
shouldn't cause any harm) like
for u in "list of unneeded services"; do
service $u stop
chkconfig $u off
done
work ok?
John
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
--
Mike Burger
http://www.bubbanfriends.org
Visit the Dog Pound II BBS
telnet://dogpound2.citadel.org or http://dogpound2.citadel.org:2000
To be notified of updates to the web site, visit
http://www.bubbanfriends.org/mailman/listinfo/site-update, or send a
message to:
site-update-request@xxxxxxxxxxxxxxxxx
with a message of:
subscribe
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
- References:
- Re: script to turn off services
- From: Wayne Pinette
- Re: script to turn off services
- Prev by Date: Sendmail content filtering
- Next by Date: RHEL Web Stack (mysql user)
- Previous by thread: Re: script to turn off services
- Next by thread: Display with RHEL 4, Update 2 going to sleep
- Index(es):