Moxa UC-8410A-T-LX [18/86] Enabling and disabling daemons

Moxa UC-8410A-LX [18/86] Enabling and disabling daemons
UC-8410A Series Linux Software Getting Started
2-12
Enabling and Disabling Daemons
By default, only the following daemons are enabled in the UC-8410A-LX:
sftpd SFTP server / client daemon
sshd Secure shell server daemon
You can use the
insserv command to manage which services will run in the background. The following
example shows how to add the Apache daemon to the current run level.
moxa@Moxa:~$ sudo insserv –d apache2
The Apache daemon will not get activated in the current boot session, but will be running in the background
from the next boot session.
To disable the Apache daemon, use the following command:
moxa@Moxa:~$ sudo insserv -r apache2
You can also write your own script to start and stop a daemon during the system initstage:
### BEGIN INIT INFO
# Provides: scriptname
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
YOUR SCRIPT
Linux daemons can be started or stopped in a current boot session by using the scripts in the /etc/init.d.
file. To start the apache daemon, use:
moxa@Moxa:~$ sudo /etc/init.d/apache2 start
To stop the apache daemon, use:
moxa@Moxa:~$ sudo /etc/init.d/apache2 stop
In comparison to insserv, scripts in /etc/init.d/ will only start or stop the services in the current boot
session. Once you reboot the UC-8410A-LX, it will go back to the default settings managed by
insserv.

Содержание

Скачать