the proper way to shutdown services.
hey!
what is the proper way to make programs not to start at systemstartup. when i first installed slackware and ran ps -aux i saw that there was a few things i didnīt want running, one was sendmail and the other OpenSSH. i went to /etc/rc.d and i saw there was a file called rc.sendmail there, i did a chmod ugo-rwx on that file, and after that it hasnīt started, is this the real way to do this? if not, how should i do? the OpenSSHd i commented out from rc.inet2 (i think it was inet2). help out a newbie please :) |
No, that's not the right way. First find out what runlevel you are in. As root, type
runlevel It's probably 2 or 3 if you have text login or 5 if you are using graphical login. Now, go to the directory /etc/rc.d/rcN.d where N=your runlevel. This directory contains a lot of symbolic links to the directory ../init.d/ Remove the links to the services you are not using. Regards Martin |
here is another way....
[root@myBOX manny]# /sbin/runlevel N 3 Redhat To display what is configured for a particular runlevel, try the following: [root@myBOX manny]# /sbin/chkconfig --list | grep 3:on keytable 0:off 1:on 2:on 3:on 4:on 5:on 6:off atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off syslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off gpm 0:off 1:off 2:on 3:on 4:on 5:on 6:off kudzu 0:off 1:off 2:off 3:on 4:on 5:on 6:off vmware 0:off 1:off 2:on 3:on 4:off 5:on 6:off sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off network 0:off 1:off 2:on 3:on 4:on 5:on 6:off random 0:off 1:off 2:on 3:on 4:on 5:on 6:off ipchains 0:off 1:off 2:on 3:on 4:on 5:on 6:off iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off lpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off portmap 0:off 1:off 2:off 3:on 4:on 5:on 6:off xfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off xinetd 0:off 1:off 2:on 3:on 4:on 5:on 6:off [root@myBOX manny]# to shutoff a particular service/deamon, try the following [root@myBOX manny]# /sbin/chkconfig sshd off you will notice that sshd is no longer configured to run: [root@myBOX manny]# /sbin/chkconfig --list | grep 3:on keytable 0:off 1:on 2:on 3:on 4:on 5:on 6:off atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off syslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off gpm 0:off 1:off 2:on 3:on 4:on 5:on 6:off kudzu 0:off 1:off 2:off 3:on 4:on 5:on 6:off vmware 0:off 1:off 2:on 3:on 4:off 5:on 6:off network 0:off 1:off 2:on 3:on 4:on 5:on 6:off random 0:off 1:off 2:on 3:on 4:on 5:on 6:off ipchains 0:off 1:off 2:on 3:on 4:on 5:on 6:off iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off lpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off portmap 0:off 1:off 2:off 3:on 4:on 5:on 6:off xfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off xinetd 0:off 1:off 2:on 3:on 4:on 5:on 6:off to enable a service/deamon, it's the opposite: [root@myBOX manny]# /sbin/chkconfig sshd on hope this helps, manny |
Re: the proper way to shutdown services.
Quote:
-rw-r--r-- 1 root root while the ones that do start at boot would look like this: -rwx-r-xr-x 1 root root What you're doing with that particular chmod command is locking all users out of those bootup scripts, including root, which will make it look like this (you won't even be able to open up the file to look at it): ---------- 1 root root To restore any files you may have locked, you can run this command: chmod a+r /etc/rc.d/* ; chmod u+w /etc/rc.d/* None of the other files will be affected. Only the files with all permissions removed (the locked ones) will be restored without setting the x bit. The correct command to stop a service starting at boot would be: chmod a-x /etc/rc.d/<filename> (Notice that you can use 'a' in the command instead of 'ugo' to accomplish the same thing) NOTE: Using chmod will prevent/allow services starting during boot globally, ie., regardless of runlevel. If you only want to change it for a particular runlevel, then use the method outlined by MartinN. Only, I would just comment out the desired service (not remove it) in case you may change your mind in the future. ;) |
thanks for the help!
really appriciated. |
You might have the command ntsysv mhich will help you do this just by (un)checking services to start at current run level. These setting will kick in next boot, or when you change run level.
|
Quote:
|
Thanx for the info
|
is there a list of what each program does someplace? how would i know which programs i need running, and which are just there for convenience?
|
Quote:
Common Startup Services (Daemons) - Describes some of the different startup services, but seems to list some services specific to a RedHat-based distro not found on all distros. Slackware.com - System Startup - Slackware startup is based on BSD startup and this shows some basic daemons. This might give you an idea of what may be essential. Red HatŪ Linux 6 Unleashed: Chapter 6 - Describes the startup and shutdown of RH. The second section (different page) talks about the different scripts and daemons. Linux Startup Manual - The name says it all. <EDIT> Describes the startup process of a System V compatible system. Many Linux distributions make use of this style, as opposed to a BSD style. The difference is in a System V compatible distro there is given a subdirectory for each runlevel, while BSD compatible systems give one startup script to each runlevel (not subdirectories). </EDIT> HTH :) |
excellent!!! thanks geekster!
|
All times are GMT -5. The time now is 02:36 PM. |