Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-30-2003, 05:11 PM
|
#1
|
Member
Registered: Sep 2003
Posts: 35
Rep:
|
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
|
|
|
12-30-2003, 05:31 PM
|
#2
|
Member
Registered: Nov 2003
Location: Ronneby, Sweden
Posts: 555
Rep:
|
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
|
|
|
12-30-2003, 06:40 PM
|
#3
|
Member
Registered: Sep 2003
Distribution: RH7.3, RH9 w/fluxbox best thing since sliced bread
Posts: 34
Rep:
|
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
|
|
|
12-30-2003, 07:44 PM
|
#4
|
Member
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513
Rep:
|
Re: the proper way to shutdown services.
Quote:
Originally posted by Blu-star
...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?...
|
Not quite. You only need to remove the executable bit (x) to stop a service from starting, not all the permissions. In the /etc/rc.d directory (in Slackware at least), list the directory with the -l option ( ls -l /etc/rc.d ). the default permissions for a service with the x permission removed would look like this:
-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.
|
|
|
12-31-2003, 10:14 AM
|
#5
|
Member
Registered: Sep 2003
Posts: 35
Original Poster
Rep:
|
thanks for the help!
really appriciated.
|
|
|
12-31-2003, 10:19 AM
|
#6
|
Senior Member
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028
Rep:
|
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.
|
|
|
12-31-2003, 07:18 PM
|
#7
|
Member
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513
Rep:
|
Quote:
Originally posted by ugge
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.
|
ntsysv is a RedHat specific util and might not work with Slack, which is what he said he installed in the very first post.............AFAIK, RH does things a little differently than Slack when it comes to booting up the services.
Last edited by thegeekster; 12-31-2003 at 07:20 PM.
|
|
|
01-01-2004, 04:12 AM
|
#8
|
Senior Member
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028
Rep:
|
Thanx for the info
|
|
|
01-01-2004, 01:57 PM
|
#9
|
Senior Member
Registered: Oct 2003
Location: lost in the midwest...
Distribution: Slackware
Posts: 1,098
Rep:
|
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?
|
|
|
01-01-2004, 08:21 PM
|
#10
|
Member
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513
Rep:
|
Quote:
Originally posted by detpenguin
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?
|
I haven't come across anything, yet, that list basic startup daemons that would apply for all distros. Keep in mind that different systems may require a couple of different startup daemons for essential operation. Anyway, here's some links to look at:
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
Last edited by thegeekster; 01-01-2004 at 11:29 PM.
|
|
|
01-01-2004, 10:15 PM
|
#11
|
Senior Member
Registered: Oct 2003
Location: lost in the midwest...
Distribution: Slackware
Posts: 1,098
Rep:
|
excellent!!! thanks geekster!
|
|
|
All times are GMT -5. The time now is 02:47 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|