How do I turn off these services?

smp

Diamond Member
Dec 6, 2000
5,215
0
76
tcp 0 0 *:1024 *:* LISTEN 191/rpc.statd
tcp 0 0 *:printer *:* LISTEN 203/lpd
tcp 0 0 *:sunrpc *:* LISTEN 130/


Debian.
I turned everything off in inetd.conf
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
rpc.statd is part of NFS, probably the portmap or nfs-common service.
lpd is the print server, probably cups or plain lpd.
sunrpc is definately the portmap service.
 

smp

Diamond Member
Dec 6, 2000
5,215
0
76
Originally posted by: Nothinman
rpc.statd is part of NFS, probably the portmap or nfs-common service. lpd is the print server, probably cups or plain lpd. sunrpc is definately the portmap service.

so... how do I turn them off? :eek:
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Debian's default runlevel is 2, so go through /etc/rc2.d and remove symlinks to any services you don't want.
 

smp

Diamond Member
Dec 6, 2000
5,215
0
76
That's something I've never understood about runlevels .. if rc2.d is the default .. then what are the other ones for?
Also, most of those services aren't in there .. where else can I look? inetd are all turned off.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
They are for whatever someone feels like making them for when they feel like using them. I don't know why SysV makes this so damn difficult. I don't see a list of necessary daemons on my Debian system anywhere. I don't know what I can remove from startup, and most of this crap I have no clue what it does (unless it has a manpage, unlike rmnologin).

Runlevels 0, 1, and 6 are reserved. Runlevel 0 is used to halt the sys-
tem, runlevel 6 is used to reboot the system, and runlevel 1 is used to
get the system down into single user mode. Runlevel S is not really
meant to be used directly, but more for the scripts that are executed
when entering runlevel 1. For more information on this, see the man-
pages for shutdown(8) and inittab(5).

Runlevels 7-9 are also valid, though not really documented. This is
because "traditional" Unix variants don't use them. In case you're
curious, runlevels S and s are in fact the same. Internally they are
aliases for the same runlevel.

Typical...

Yeah, so if anyone knows how to turn this BS off, please post the answer. I have no clue what uses what in /etc/rc2.d (except for the 2 or 3 things I added). And if anyone knows where my missing documentation is, please let me know.

How come nothing is coming in on port 111? Something (that doesn't identify itself) is listening, but I see no traffic...
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
The other runlevels are for anything else you want. Say you like to game so you want all the memory and cpu time to go the game. So you configure runlevel 3 to run nothing but X windows. Or you have a server and you want X (along with the print servers, xft server and whatever else) so you configure 4 to run all that stuff and then 2 to run just your services.

Also runlevel 0 is shutdown and 6 is reboot (or visa versa or something like that, I forget).

That way you can switch between stuff with a simple "telinit" command.

For instance in redhat runlevel 5 is multiuser with X, and runlevel 3 is multiuser without X. Makes it easier to install nvidia drivers for instance.


You can also run the scripts manually. To shut off lpd (at least on my system it's a seperate thing that annoyingly gets installed along with gnome or X or something) you go:

/etc/init.d/lpd stop

And that should stop it. If you make changes to sshd config (say to allow X11 forwarding) you have to restart the services to make it go into effect, so you go:

/etc/init.d/sshd restart
(could be just ssh, I don't remember fer'shure)


edit... Oh, also to remove and add services to the runlevel debian has a update-rc.d program/script to do it. Each service added to a runlevel has to have a symbolic link to one of the running runlevels, and one of the shutdown/reboot runlevels.

The "easy" way to do it is simply to delete or use ln to make and delete your own links, but remember that some start up scripts have to be done in a certain order.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: drag
The other runlevels are for anything else you want. Say you like to game so you want all the memory and cpu time to go the game. So you configure runlevel 3 to run nothing but X windows. Or you have a server and you want X (along with the print servers, xft server and whatever else) so you configure 4 to run all that stuff and then 2 to run just your services.

Also runlevel 0 is shutdown and 6 is reboot (or visa versa or something like that, I forget).

That way you can switch between stuff with a simple "telinit" command.

For instance in redhat runlevel 5 is multiuser with X, and runlevel 3 is multiuser without X. Makes it easier to install nvidia drivers for instance.


You can also run the scripts manually. To shut off lpd (at least on my system it's a seperate thing that annoyingly gets installed along with gnome or X or something) you go:

/etc/init.d/lpd stop

And that should stop it. If you make changes to sshd config (say to allow X11 forwarding) you have to restart the services to make it go into effect, so you go:

/etc/init.d/sshd restart
(could be just ssh, I don't remember fer'shure)

n0c@dent:/etc/rc2.d$ sudo /etc/init.d/sunrpc stop
sudo: /etc/init.d/sunrpc: command not found
n0c@dent:/etc/rc2.d$

 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Just kill portmap. I'm thinking I will need to write a startup script to kill it on boot.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
tcp 0 0 *:1024 *:* LISTEN 191/rpc.statd
tcp 0 0 *rinter *:* LISTEN 203/lpd
tcp 0 0 *:sunrpc *:* LISTEN 130/


BTW, what is this output from? I don't have anything running on port 130....
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: n0cmonkey
Just kill portmap. I'm thinking I will need to write a startup script to kill it on boot.


update-rc.d portmap remove

That will remove portmap from your start up scripts. Also

/etc/init.d/portmap stop

should stop it. Any scripts that gets used in the runlevels, will be located in /etc/init.d/
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: drag
Originally posted by: n0cmonkey
Just kill portmap. I'm thinking I will need to write a startup script to kill it on boot.


update-rc.d portmap remove

That will remove portmap from your start up scripts. Also

/etc/init.d/portmap stop

should stop it. Any scripts that gets used in the runlevels, will be located in /etc/init.d/

I understand that. But /etc/rc2.d doesn't have a portmap script. It shouldn't start, unless something else is starting it. And with the bass ackwards way Debian does everything, I'm too scared to try and remove it. I'll end up taking out something useful. Like keyboard support or something.

EDIT: HAHA! It gave me a typical non-sensical Linux error and didn't do anything. -n is gimpy too. -f did something different but nothing helpful. I'm afraid to reboot to see if everything still works because I forced a kernel update (WHY WON'T DEBIAN UPDATE *THIS* PACKAGE AUTOMAGICALLY?!) and I haven't rebooted to test it yet...
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Portmap is started in the /etc/rcS.d runlevel. It's something that is started up while it's still in single user mode along with stuff like the scripts that do your networking configurations.

I removed it just fine with:

update-rc.d -f portmap remove

And put it back in with

update-rc.d portmap defaults

now it's in ALL my runlevels, instead of just rcS.d, but go figure. I don't know how wise it is to do without your portmap stuff, though.

It's not like I like system-v stuff, it's to complicated and stupid, give me BSD style scripts anyday. :p


If your worried about your kernel, just make a extra entry in your bootloader for the old one.... :)
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: drag
Portmap is started in the /etc/rcS.d runlevel. It's something that is started up while it's still in single user mode along with stuff like the scripts that do your networking configurations.

I removed it just fine with:

update-rc.d -f portmap remove

And put it back in with

update-rc.d portmap defaults

now it's in ALL my runlevels, instead of just rcS.d, but go figure. I don't know how wise it is to do without your portmap stuff, though.

It's not like I like system-v stuff, it's to complicated and stupid, give me BSD style scripts anyday. :p

Give me BSD style documentation any day! ;)

rcS.d isn't mentioned in the init man, but runlevel S or s is. What a load.

If your worried about your kernel, just make a extra entry in your bootloader for the old one.... :)

The lilo screen at boot doen't like me much. I can't change anything at that point, and I haven't bothered to figure out why.