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 shows 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 all running services.

LYSH@MyHostName# show service status
● MyHostName
   State: degraded
    Jobs: 0 queued
  Failed: 1 units
   Since: Mon 2021-02-01 08:07:01 KST; 2 months 24 days ago
  CGroup: /
          ├─1282556 bpfilter_umh
          ├─user.slice
          │ └─user-1000.slice
          │   ├─user@1000.service …
          │   │ └─init.scope
          │   │   ├─3743524 /lib/systemd/systemd --user
          │   │   └─3743526 (sd-pam)
          ├─init.scope
          │ └─1 /sbin/init
          └─system.slice
            ├─irqbalance.service
            │ └─777 /usr/sbin/irqbalance --foreground
            ├─dhcpv4.service
            │ └─3865233 /usr/sbin/ly_dhcpv4 --daemon --ipv4
            ├─apache2.service
             .....................

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.
  • status:
    • avail: Available IP address that can be assigned to another host.
    • decl: Declined IP address that is not assigned to another host during the "dhcpv4_decline_age" or "dhcpv6_decline_age".
    • bound: The IP address is in use.
    • offer: It is shown as "advert"(i.e. advertisement) in the DHCPv6, the IP address was offered to a host but not completed the DHCP operation.
    • invalid: The IP address is out of the DHCP pool.
  • flag: If the IP address is reserved for a host, the flag has 0x2. If the IP is excluded, it has 0x4. For example, If the flag is 0x6, the IP address is both in reserve and exclude. If a flag has 0x1, it means that the IP address is out of the pool.
  • age: It is the time that was elapsed from the latest allocation. If the status is "bound", the age is increased. if a host sends a renew to expand its lease time, the age is set to 0.

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.

  • oage: If an IP address was offered to a host and the status of the IP address remains as "offer" or "advert" for 30 seconds, the status of the IP address is changed to "avail". In other words, If a host does not complete the DHCP operation, the offered IP address to the host can be assigned to another.
  • hit-date: It is the latest response Datetime to a host.

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. If you want to see the current values, enter the show system command.

dhcpv4 / dhcpv6
LYSH@MyHostName# configure 
configure# dhcpv4 {argument} {value}	// configuring a variable of the dhcpv4 service
configure# dhcpv6 {argument} {value}	// configuring a variable of the dhcpv4 service
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
LYSH@MyHostName# configure 
configure# logexp {argument} {value}	// configuring a variable of the logexp service
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.

References