Managing Services (Daemons)
Services, also know as daemons
on Linux, are typically controlled through init scripts and the
chkconfig command as described in Chapter 6. If you want to start
or stop services on-the-fly, use the appropriate init script from
the /etc/init.d directory. However, since these services are just
running processes, you can manipulate them in that way as well.
Examining Running Services
The service commandcan be
used to check the status of configured services using the
--status-all option. The service command should be run as root.
# service
--status-all
acpid (pid 2320) is running...
anacron is stopped
atd (pid 2528) is running...
auditd (pid 1946) is running...
automount (pid 2295) is running...
...
xfs (pid 2497) is running...
xinetd (pid 2394) is running...
ypbind is stopped
yum-updatesd (pid 2609) is running...
The service command produces a lot of output, so it may be best
to use grep to reduce the output, just like with the ps command.
Stopping Running Services
Since these services are just processes running in the
background, they can also be seen using the ps command.
In the following output, the ssh daemon (/usr/sbin/sshd) and other
ssh processes can be seen in the ps output.
# ps -ef |
grep sshd
root 2361 1 0 06:47 ? 00:00:00
/usr/sbin/sshd
root 2897 2361 0 07:14 ? 00:00:00
sshd: oracle [priv]
oracle 2899 2897 0 07:14 ? 00:00:01
sshd: oracle@pts/1
root 11869 2361 0 11:36 ? 00:00:00
sshd: oracle [priv]
oracle 11871 11869 0 11:36 ? 00:00:00
sshd: oracle@pts/0
root 13236 12564 0 12:18 pts/1 00:00:00 grep
sshd
NOTE: Though any
user can see the processes for services, typically only root
will be able to manipulate or kill these processes.
|
While it is best to use the init scripts
to stop services, it may sometimes be necessary to use the kill
command as described earlier for other processes.
Forcing a Service to Reread Its Configuration
The kill commandcan also be
used to send a request to tell a service to reread its configuration
file without restarting. Typically, this is done with the -sighup
option.
# kill -sighup
2361
The ability to reread a configuration file with kill -sighup is
dependent on the specific service. Check the service's man page to
confirm that this will not interrupt the service.
Conclusion
Everything that happens on the system is dependent on the
processes running on it. Though simple, many of the tools described
in this chapter are ones that will end up being used daily to
monitor and manage processes.
The next chapter will examine managing the installed software
with attention given to the RPM Package Manager.
|
|
|
Get the Complete Details on
Linux System Management for Oracle DBAs
The landmark book
"Linux for the Oracle DBA: The
Definitive Reference"
provides comprehensive yet specific
knowledge on administering Oracle on Linux. A
must-have reference for every DBA running or planning to run
Oracle on a Linux platform.
Buy it
for 30% off directly from the publisher.
|
|
|
|
Burleson is the American Team

Note:
This Oracle
documentation was created as a support and Oracle training reference for use by our
DBA performance tuning consulting professionals.
Feel free to ask questions on our
Oracle forum.
Verify
experience!
Anyone
considering using the services of an Oracle support expert should
independently investigate their credentials and experience, and not rely on
advertisements and self-proclaimed expertise. All legitimate Oracle experts
publish
their Oracle
qualifications.
Errata?
Oracle technology is changing and we
strive to update our BC Oracle support information. If you find an error
or have a suggestion for improving our content, we would appreciate your
feedback. Just
e-mail:
and include the URL for the page.
Copyright © 1996 - 2020
All rights reserved by
Burleson
Oracle ®
is the registered trademark of Oracle Corporation.
|
|