Moxa V2403-C3-W-T [12/90] Enabling and disabling daemons

Moxa V2403-C7-W-T [12/90] Enabling and disabling daemons
V2403 Series Linux Software Software Configuration
2-6
Enabling and Disabling Daemons
Only the following daemons are enabled in the V2403 by default:
sftpd SFTP Server / Client daemon
sshd Secure Shell Server daemon
You may manage what services to run in the background by the command insserv. Below example shows how
to add the apache daemon in current runlevel.
moxa@Moxa:~$ sudo insserv –d apache2
Apache will not activate 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
Linux daemons can be started or stopped in the current boot session by using of the scripts in /etc/init.d. 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
CronDaemon for Executing Scheduled
Commands
The Cron daemon will search /etc/crontab for crontab files.
Cron wakes up every minute and checks each command to see if it should be run in that minute. When
executing commands, output is mailed to the owner of the crontab (or to the user named in the MAILTO
environment variable in the crontab, if such a user exists).
Modify the file /etc/crontab to set up your scheduled applications. Crontab files have the following format:
mm h dom mon dow user command
minute hour date month week user command
0-59 0-23 1-31 1-12 0-6 (0 is Sunday)
For example, if you want to launch a program at 8:00 every day.
#minute hour date month week user command
0 8 * * * root /path/to/your/program
The following example demonstrates how to use Cron to update the system time and RTC time every day at
8:00.
1. Write a shell script named fixtime.sh and save it to /home/.
#!/bin/sh
ntpdate time.stdtime.gov.tw
hwclock –w
exit 0
2. Change mode of fixtime.sh
moxa@Moxa:~# chmod 755 fixtime.sh
3. Modify /etc/crontab file to run fixtime.sh at 8:00 every day.
Add the following line to the end of crontab:
0 8 * * * root /home/fixtime.sh

Содержание

Похожие устройства

Скачать