Removing Unwanted Startup Debian Files or Services

Under Debian Linux ( and most other distros) startup files are stored in /etc/init.d/ directory and symbolic linked between /etc/rcX.d/ directory exists. Debian Linux (Red Hat/ Fedora) uses System V initialization scripts to start services at boot time from /etc/rcX.d/ directory. Debian Linux comes with different utilities to remove unwanted startup file:

(A) rcconf
It is a console based interactive utility that allows you to control which services are started when the system boots up or reboots. It displays a menu of all the services which could be started at boot. The ones that are configured to do so are marked and you can toggle individual services on and off. To start rconf, login as root user and type rcconf
# rcconf


Debian rcconf – a console based utility to control startup services

Select the service you would like to enable or disable.

(B) sysv-rc-conf is yet another tool for for SysV like init script links under Debian Linux. To start sysv-rc-conf, login as root user and type sysv-rc-conf:
# sysv-rc-conf


Debian sysv-rc-conf – a console based advanced utility to control startup services

Select the service you would like to enable or disable.

Both sysv-rc-conf and rcconf are best tools to use on Remote Debian Linux or when GUI is not available, they are just like ntsysv command under Red Hat Linux.

(C) You can also use update-rc.d script as follows (update-rc.d removes any links in the /etc/rcX.d directories to the script /etc/init.d/service):
# update-rc.d -f {SERVICE-NAME} remove

For example to stop xinetd service at boot time, type the command as follows:
# update-rc.d -f xinetd remove

How do I restart Linux network service?

RedHat Linux command to reload or restart network (login as root user):

# service network restart
OR
# /etc/init.d/network restart

To start Linux network service:
# service network start

To stop Linux network service:
# service network stop

Debian Linux command to reload or restart network:
# /etc/init.d/networking restart

To start Linux network service:
# /etc/init.d/networking start

To stop Linux network service:
# /etc/init.d/networking stop

Ubuntu Linux user use sudo command with above Debian Linux command:
# sudo /etc/init.d/networking restart

To start Linux network service:
# sudo /etc/init.d/networking start

To stop Linux network service:
# sudo /etc/init.d/networking stop

How do I restart inetd service under Linux?

inetd is a daemon on Linux (BSD/Unix) systems that manages Internet services. inetd listens on all ports used by internet services such as FTP, POP3, and telnet. When a TCP packet or UDP packet comes in with a particular port number, inetd launches the appropriate server program to handle the connection. This uses memory more efficiently, as the other daemons do not run constantly.

Under old version of RedHat Linux you can restart inetd (login as root user):
# killall -HUP inetd

Note above command should work with almost any Linux distrobution.

New version of RedHat Linux (Fedora) comes with xinetd daemon, which can be restarted as follows:
# service xinetd restart

See also:

=> How to restart inetd under FreeBSD

Resetting RX and TX counters

You need to remove driver related to Ethernet card. Under Linux use following commands:

1) Find out driver attached to eth0 using following command
lsmod | less

2) Remove the driver using rmmod command:
rmmod driver-name

3) Again insert driver into kernel using
modprobe driver-name

For example, let us assume your driver name is 8139too , then your command should be (log in as root user):
# rmmod 8139too
# modprobe 8139too

Verify that RX and TX couters reset:
ifconfig

Under FreeBSD use following the commands:

Get list of loaded drivers, and find out ID of device driver related to Ethernet
# kldstat

Remove driver
# kldunload driver-ID

Load driver into kernel:
# kldload -v driver-name

Don’t try this command on remote server via telnet or ssh, at it will take down your connection. For more information please see
FreeBSD : How to unload (remove) device driver (module) from kernel
FreeBSD How to list device drivers (modules) loaded in memory?
FreeBSD : How to unload (remove) device driver (module) from kernel

How Do I Remotely Reboot Linux System?

A remote Linux / UNIX server can be rebooted using following methods:

A) Login to remote server using ssh as root user and use any one of the following syntax:

ssh [email protected]

OR

ssh [email protected]

When prompted for password please supply remote server root password.

B) Type reboot command as follows:

reboot

You can also save time using the following reboot command over ssh session:
ssh [email protected] reboot
ssh [email protected] reboot

Halt or stop linux firewall

A firewall is designed to help protect your computer from attack by malicious users or by malicious software (viruses that use unsolicited incoming network traffic to attack).

Also before you disable your firewall, you must disconnect your computer from all networks, including the Internet to avoid damage :D

You would like to Halt linux firewall or stop linux firewall (i.e. flush iptables rules). First login as root user.

Option A – If you are redhat Linux user type command:

If you are using Red Hat (RHEL) / CentOS / Fedora Core Linux, use the following command:

OR

Option B – If you are Debian Linux user type following commands one by one