Services
You can see the status of all services for the imRAD system by the show service
command.
LYSH@MyHostName# show service name status version enable runtime-log uptime dhcpv4 active 6.1.2059.137 linked enabled since Thu 2021-04-08 16:11:35 KST; 1 weeks 4 days ago dhcpv6 active 6.1.2059.137 linked enabled since Mon 2021-04-05 14:55:22 KST; 2 weeks 1 days ago failover inactive 6.1.1939.49 disabled enabled - logexp active 1.1.2043.208 linked enabled since Mon 2021-03-29 09:21:54 KST; 3 weeks 1 days ago radiusd active 3.0.21.1751 linked enabled since Tue 2021-04-13 14:53:06 KST; 1 weeks 0 days ago smgr active 6.0.2060.1 linked enabled since Tue 2021-03-23 16:01:00 KST; 3 weeks 6 days ago startup active 1.1.1955.1 enabled enabled since Mon 2021-02-01 08:07:05 KST; 2 months 17 days ago
The status show the unit state, one of active, reloading, inactive, failed, activating, deactivating. The "active" indicates that the unit is running and the "Inactive" indicates that the unit is stopped normally. If the status is "failed", it indicates that the unit is terminated abnormally. [1]
The "enable" is either "linked", "disabled", or "enabled". The "enabled" indicates that the unit is starting at boot. The "linked" is manual start and the "disabled" means the unit is not using.
If you want to see the status of a service, enter the systemctl status {name}
or show service status {name}
command.
LYSH@MyHostName# systemctl status smgr ● smgr.service - System Management service Loaded: loaded (/lib/systemd/system/smgr.service; linked; vendor preset: enabled) Active: active (running) since Tue 2021-03-23 16:01:00 KST; 3 weeks 6 days ago Main PID: 203770 (ly_smgr) Tasks: 1 (limit: 9387) Memory: 28.9M CGroup: /system.slice/smgr.service └─203770 /usr/bin/php7.2 /usr/sbin/ly_smgr sys
If you enter the show service status
command without a service name, it shows runtime status information about services.
Control the Service
Start, Stop, and Restart
You can start, stop, and restart a service(daemon) using the systemctl
command.
You can't control all services in the operating system but only the imRAD services and some services.
The following services are the names controllable.
- smgr
- dhcpv4
- dhcpv6
- failover
- startup
- logexp
- radiusd
- mysql
- apache2
- rsyslog
LYSH@MyHostName# systemctl start smgr // Starting the smgr service. LYSH@MyHostName# show service // display all services LYSH@MyHostName# systemctl stop smgr // Stopping the smgr service. LYSH@MyHostName# show service // display all services LYSH@MyHostName# systemctl restart smgr // Restarting the smgr service. LYSH@MyHostName# show service // display all services
Enable and Disable
If you disable a service, the service will not start. you can enable or disable with systemctl enable
or systemctl disable
command.
LYSH@MyHostName# systemctl disable failover
Note that DO NOT disable the startup and smgr service that are required services.
Runtime Data
Some services are loading data from the database or configuration files before running. Changed configurations or database records are applied in a few seconds to each service. We call it "Runtime Data".
The "Runtime Data" must same as the data shown in the management interface. For example, If you add a DHCP pool from the management interface, the same pool must be shown in the "Runtime Data".
In other words, It indicates that data between management interfaces and services were synchronized.
To display the "Runtime data" of each service, enter the show service {service name} {data type}
command.
LYSH@MyHostName# show service dhcpv4 pool DHCP-Scope> written at 2021-04-20 16:10:09 (KST, +0900) -------------------------------------------------------------------------------------------------------- ssid ipver stateful ptn T(preferred) T(valid) sid ena gateway start ip count IA -------------------------------------------------------------------------------------------------------- 119 4 - 0 10m 6h #250 y 192.168.5.1/24 192.168.5.200 20 0x01
Note than if the service is not running, the show service {service name} {data type}
command will show error.
LYSH@MyHostName# show service dhcpv4 pool sending request> message[0], ipver[4] [E-11] No response from service...
Only the dhcpv4, dhcpv6, and failover service have the Runtime Data.
dhcpv4/dhcpv6
argument | Description |
---|---|
failover | Displays the status of DHCP Failover. |
host | Displays all IP addresses in all DHCP Pools. You can get only filtered results by specifying keywords.
If the age is greater than or equal to the Lease Time of its DHCP Pool, the status of the IP address is changed to "avail". In other words, the Lease of the IP address expires.
You can also find some terms in the IP Address list section. |
option | It show all DHCP options. |
reserv | It show all reserved IP address. You can get only filtered results by specifying keywords. |
setting | It shows information that was loaded from the service configuration setting. |
logexp
argument | Description |
---|---|
server | It shows the result of exporting logs. |
setting | It shows the variables generated by the failover service. |
table | It shows the result of exporting each log table. |
Runtime Log
The Runtime Log is the logs that were generated in real-time during the runtime of a service. You can enable the Runtime log of service for the purpose of analyzing or feedback.
LYSH@MyHostName# configure configure# rtlog enable {service_name} configure# exit LYSH@MyHostName# show log {service_name} -w
If you enable the Runtime Log of a service, you can watch the logs by the show log
command. For more options to show logs, please refer to the CLI - Log section
LYSH@MyHostName# show log dhcpv4
Note that you should disable it after doing your job because the service may generate a log of Runtime Logs.
Configuring the Service Setting
You can configure the variables of the DHCP and logexp Service in the configuration mode.
LYSH@MyHostName# configure configure# dhcpv4 {argument} // configuring a variable of the dhcpv4 service configure# dhcpv6 {argument} // configuring a variable of the dhcpv4 service
dhcpv4 / dhcpv6
argument | variable | Description |
---|---|---|
dbpool | dhcpvN_dbpool | configuring the number of database pools. |
decline | dhcpvN_decline_age | configuring the time in seconds to change the status from "decl" to "avail" of the declined IP addresses. |
entid | entid_from_hostname | Whether to read the enterprise number from the hostname or not. |
expire | dhcpvN_expire_check_intv | configuring the interval in seconds to check the lease expiration. |
postdhcp | postdhcp_success | Whether to record all results or not. |
rcvbuf | dhcpvN_socket_rcvbuf | configuring the receiving buffer size of the socket. |
sndbuf | dhcpvN_socket_sndbuf | configuring the sending buffer size of the socket. |
logexp
argument | variable | Description |
---|---|---|
dbpool | logexp_dbpool | configuring the number of database pools. |
lsyslog | lsyslog_priority | configuring the highest syslog priority to read. |
syslog | syslog_priority | configuring the highest syslog priority to read. |
Note that you should read what the variable means before configuring a variable.