Post a Comment
Redhat methods are the easiest here, especially "service pcmcia stop" and "service httpd start".
But REMEMBER that you have to type "/sbin" before "service" like this "/sbin/service sound stop", to really work on RHEL distros. I personally use the GUI tool which is amazing because it lists the services available and which one is enabled and which one is not, besides it gives you complete description on each service and what it is its function.
If you log in to root using 'su -' it will load the root path and you won't need the path to the service binary. You do know that service $something stop only turns off the service until the next init change right? You need to use chkconfig to completely disable something.
chkconfig $something off
Similar to what Gentoo is, only you point directly to the created initiation files and pass an argument like (for example):
/etc/rc.d/sshd start|stop|restart
You add and remove the services in a list located in the /etc/rc.conf file. Arch Linux uses the same method of operation which is another reason I enjoy Arch Linux.
Here's a little more information about it:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtun...
In the end though, they are all relatively similar at least in operation sense. I think it's a somewhat portable skill to have.
While I have no fear of the command line/terminal window I find the GUI based tools with each distro to be easy to use. Just stop the service, uncheck the box so its not used during sstart up then click ok. But I can understand the GUI not being an option on servers, in which case this article would apply.
Not all init script of FBSD are in /etc/rc.d/
only those considered as "core" system daemons are there.
Majority 3rd party stuff like apache and samba are in /usr/local/etc or in package specific directories. This can be confusing to newbies or lazy lamer who don't read the man page ;-)
Strongest point of cmdline here is its scriptability. e.g. for RH systems
1) to save the current state of you services(so that if some dependecies are bork you can still revert back)
chkconfig --list > services.states
1) dump the service names
chkconfig --list | awk '{print $1}' > services.txt
2) del services you want to turn off from services.txt, save it as services.on . you can check what the service does before making a decision with
rpm -qi `rpm -qf /etc/init.d/$SERVICE_NAME`
3) run a script like this
#!/bin/sh
FILENAME='services.on'
MODE='on'
cat $FILENAME |
while read SERVICE_NAME
do
chkconfig --level 345 $SERVICE_NAME $MODE
done
exit
4) repeat 2)3) for services you wanna turn off, just save the config to another file and edit $FILENAME on aforesaid script.
Tada, done. you can use the configuration text file on multiple machines, getting them configured in seconds too.



