What's the difference between “Service” and “/etc/init.d/”?


On Sat, 2009-04-18 at 22:32 +0800, Nathan Huang wrote:

> Hi guys

> I face a problem, What 's the difference between these two commands?


> [mirandam@charon ~]$ su -c '/etc/init.d/NetworkManager stop'


> [mirandam@charon ~]$ |su -c '/sbin/service NetworkManager start


assuming that the | character was a type and that you put a single quote

at the end of the second statement, the difference would be that the

first statement stops NetworkManager daemon and the second one starts


/sbin/service $SOME_initscript_located_in_/etc/init.d/ and
/etc/init.d/$SOME_initscript are essentially the same


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

fedora-list mailing list
[hidden email]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

0 0

If you use Linux you most likely have heard of the init.d directory. But what exactly does this directory do? It ultimately does one thing but it does that one thing for your entire system, so init.d is very important. The init.d directory contains a number of start/stop scripts for various services on your system. Everything from acpid to x11-common is controlled from this directory. Of course it's not exactly that simple.

If you look at the /etc directory you will find directories that are in the form rc#.d (Where # is a number reflects a specific initialization level - from 0 to 6). Within each of these directories is a number of other scripts that control processes. These scripts will either begin with a "K" or an "S". All "K" scripts are run before "S" scripts. And depending upon where the scripts are located will determine when the scripts initiate. Between the directories the system services work together like a well-oiled machine. But there are times when you need to...

0 0

What are the differences between the two following ways or starting something, first being:

/etc/init.d/redis-server start

And second:


I've never really fully understood why which is preferred over the other.

Other Tips. I have installed Ubuntu on the same drive as Windows 7. When I try to open Ubuntu I get a message "This file does not have a program associated with it for performing this action. Please install a program or, if one is alraedy installed, create an association in the Default Programs control panel." How do I do this? You cannot start Ubuntu at the same time while you're using Windows. You have to choose Ubuntu before entering Windows at the start of your computer. Press any key at the three-second countdown when you boot your computer. There you must see the options 'Windows' and 'Ubuntu'. Choose Ubuntu. Also see the link for details: http://www.ehow.com/how_6545352_dual-boot-ubuntu.html

0 0
0 0

I'm having issues with passwordless ssh. I've checked, double checked and checked again that I have everything set up correctly.

Both machines are RHEL6 and when the destination machine first boots up passwordless ssh does not work. If I stop ssh (service sshd stop or /ect/init.d/sshd stop) and then start it directly (/usr/sbin/sshd) passwordless ssh works fine.

If I start ssh via the service (service sshd start or /etc/init.d/sshd start) passwordless ssh does not work.

Just for testing I've tried commenting out the entire start() function in /etc/init.d/sshd and replace it with /usr/sbin/sshd - that still fails to allow passwordless ssh. I believe that this means that something in the /etc/init.d/sshd file is causing the screw up but I don't know enough about linux to narrow the issue...

0 0
0 0
Whats the difference between: Kali vs Kali Light vs Kali Mini vs Kali ARM vs Kali Docker vs Kali Cloud vs NetHunter vs Custom Image

Kali (aka Kali Normal, Kali Full, Kali Fat).
This uses GNOME v3.10, and includes all the tools from "kali-linux-full" the metapackage (more information about the package and the tool listing).
Comes as a ISO for x86 (aka 32 bit) and x64 (64 bit). There are pre-made Virtual Machines (VMware and Virtual Box) images too.

Please make sure your system has enough system resources. (If you're using a Virtual Machine - both the guest and host).
GNOME needs at least 768MB of RAM. 2GB recommended.
Download: ISOs & VM Images

Kali Light (aka Kali Lite, Kali Slim).
This uses XFCE v4.10, and does not includes all the "standard tools" by default. This is to help keep the size of the ISO down, as well as require less resources.
If you wish to get all the tools, apt-get -y install kali-linux-full.
Comes as a ISO...

0 0

I've been managing server installations both on and off Ubuntu flavor for some time - I've become quite adjusted to /etc/init.d/ for restarting servcies. Now I get this message:

root@tatooine:~# /etc/init.d/mysql status Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service mysql status Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the status(8) utility, e.g. status mysql mysql start/running, process 14048

This seems to have been brought about in the latest LTS of Ubuntu - why? What's so bad about /etc/init.d/ and what/is there a difference between service and...

0 0

/etc/init.d is maintained on ubuntu for backward compatibility with sysvinit stuff. If you actually look at /etc/initd/rc.local you'll see (also from a 12.04 LTS Server):

#! /bin/sh ### BEGIN INIT INFO # Provides: rc.local # Required-Start: $remote_fs $syslog $all # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: # Short-Description: Run /etc/rc.local if it exist ### END INIT INFO

And "Run /etc/rc.local" is exactly what it does. The entirety of /etc/rc.local is:

#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. exit 0

I would guess the purpose in doing this is to provide a dead simple place to put shell commands you want run at boot, without having to deal with the stop|start service stuff, which is in...

0 0

What is the difference between Linux and UNIX operating systems?

UNIX is copyrighted name only big companies are allowed to use the UNIX copyright and name, so IBM AIX and Sun Solaris and HP-UX all are UNIX operating systems. The Open Group holds the UNIX trademark in trust for the industry, and manages the UNIX trademark licensing program.

Most UNIX systems are commercial in nature.

Linux is a UNIX Clone

But if you consider Portable Operating System Interface (POSIX) standards then Linux can be considered as UNIX. To quote from Official Linux kernel README file:

Linux is a Unix clone written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. It aims towards POSIX compliance.

However, “Open Group” do not approve of the construction “Unix-like”, and consider it misuse of their UNIX trademark.

Linux Is Just a Kernel

Linux is just a kernel. All Linux distributions...

0 0

Just found the answer in one of the "Readme" files



This is the network install and rescue image. This image is designed to be burned onto a CD. You then boot your computer off the CD.


The aim of this image is to install a very basic CentOS 6.7 system, with the minimum of packages needed to have a functional system. Please burn this image onto a CD and boot your computer off it. A preselected set of packages will be installed on your system. Everything else needs to be installed using yum. The set of packages installed by this image is identical to the one installed when choosing the group named "Minimal" from the full DVD image.

CentOS-6.7-i386-bin-DVD1 (2).iso

These two dvd images contain the entire base distribution. Please burn DVD1 onto a DVD and boot your computer off it. A basic install will not need DVD2. After the installation is...

0 0

amportal restart

Please wait...

Waiting for Asterisk to Stop Gracefully...

Asterisk Stopped


Router is already stopped !

Unloading DAHDI hardware modules: done
Dahdi Stopped

No Wanrouter Cards Installed

Loading DAHDI hardware modules:
wct4xxp: [ OK ]
opvxd115: [ OK ]
wcte12xp: [ OK ]
wcte13xp: [ OK ]
wct1xxp: [ OK ]
wcte11xp: [ OK ]
tor3e: [ OK ]
r1t1: [ OK ]
rxt1: [ OK ]
wctdm24xxp: [ OK ]
wcfxo: [ OK ]
wctdm: ...

0 0

When you run the service sshd command where opt could be reload/restart it actually runs a program with a modified enviroment just like this:



env -i PATH=/sbin:/usr/sbin:/bin:/usr/bin TERM=xterm /etc/init.d/sshd reload

The sshd command does almost the same thing in both cases (restart/reload):

reload: Tries to kill the process sending a HUP signal, and as you can see on the snipet it needs the PID of the process to do it. (Works regardless of whether sshd is already running)

reload() { echo -n $"Reloading $prog: " if [ -n "`pidfileofproc $SSHD`" ] ; then killproc $SSHD -HUP else failure $"Reloading $prog" fi RETVAL=$? echo }

restart: It would just do the same as if you were to execute a stop->start.

restart() { stop start } start() { [ -x $SSHD ] || exit 5 [ -f /etc/ssh/sshd_config ] || exit 6 # Create...
0 0

I had similar unhappy incidents trying this operation on the vanilla LTS.

~$ cat /etc/os-release NAME="Ubuntu" VERSION="14.04.1 LTS, Trusty Tahr"

On this version, the key file /etc/init.d/vboxautostart-service was not installed.

As far as I know all the VitualBox and requirements were put in by apt-get, so I cannot say why the 'vboxautostart-service' file was not also provided. But to get over this here are my update to kdmurray's post.

1) /etc/default/virtualbox file existed for me. So must add vars:

VBOXAUTOSTART_DB=/etc/vbox VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg

2) Must create /etc/vbox/autostart.cfg as indicated by OP.

6b) Need to get a vboxautostart-service script and make it executable.

cd /etc/init.d/ sudo wget http://www.virtualbox.org/browser/vbox/trunk/src/VBox/Installer/linux/vboxautostart-service.sh?format=raw -O vboxautostart-service sudo chmod +x vboxautostart-service

6c) Alert the rc.d controller, but I used 24 as the...

0 0

Open terminal and run:

sudo apt-get install xinetd telnetd

The Telnet service is started automatically once the installation is done. And you can either run telnet serverip or use a Telnet client (PuTTy, SecureCRT, etc.) to access this server.

To change the port (default is 23), edit the /etc/services file with your favorite text editor. Find out and change the number in the line below:

telnet 23/tcp

To apply changes, you have to restart the service by running the command below:

sudo /etc/init.d/xinetd restart

Telnet is insecure because the communication is not encrypted, your password and all other data will be transmitted as clear text. If possible avoid Telnet, and use Secure Shell (SSH) instead.

reference here

Further you may refer...

0 0