LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how services and programs works at back-end ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-services-and-programs-works-at-back-end-4175425124/)

vnc 09-01-2012 09:28 AM

how services and programs works at back-end ?
 
hi..

what happens when we restart , stop or check status for any daemons/programs or do some changes to configuration file. For example when we do services network restart. what happen at backend which scripts it reads.

like when we create user so it refers to /etc/login.defs and /etc/passwd

is there any website where i can get all information.

Learning on CentOS 5.5

Thank You.

towheedm 09-01-2012 10:39 PM

This is a rather complex question with regards to what actually happens when you ask the system to run a daemon or program.

Basically, when you ask the system to run a daemon/program, the kernel assigns it a chunk of memory for it to load into. Once loaded, it get executed. Once running, it ask for any additional memory space for heap/stack etc. Depending on the daemon/program, it may then read any CLI options and/or configuration files and set it operating parameters accordingly.

When the daemon/program gets a signal to quit/exit/close, it should first ask/save any data. Within it's shutdown routine, it should release all assigned memory back to the kernel before exiting. The kernel then reclaims the memory space that the program was loaded into and returns it to the free pool.

Of course this is very simplistic and does not even consider the kernel having to move other programs into swap space to make memory available for the newly requested program.

If you would like to know exactly what files are used by any particular daemon/program, check out it's manpages. You mentioned adding a user. If you use the useradd utility, a look at the end of the manpages for useradd show:
Code:

FILES
      /etc/passwd
          User account information.

      /etc/shadow
          Secure user account information.

      /etc/group
          Group account information.

      /etc/gshadow
          Secure group account information.

      /etc/default/useradd
          Default values for account creation.

      /etc/skel/
          Directory containing default files.

      /etc/login.defs
          Shadow password suite configuration.

These are all of the files that useradd utility would access when you create a new user. Of course, the body of the manpage should explain the conditions that require the use of these files.

For more info, try:
Code:

man ld-linux
or
http://en.wikipedia.org/wiki/Executa...inkable_Format

chrism01 09-02-2012 05:36 AM

Quote:

For example when we do services network restart. what happen at backend which scripts it reads.
Basically, it runs the correspondingly named script in /etc/init.d.

As you are running Centos 5.5 (latest id 5.8 btw) you should bookmark this http://www.linuxtopia.org/online_boo...ion/index.html as Centos is a free rebuild of RHEL.


All times are GMT -5. The time now is 05:36 PM.