Ansible job under linux (1)

topic

1. Execute the id command with the all host group as the target

2. Use the copy module to modify the content of the /etc/motd file on all hosts to welcome to ansible

3. Use the command module to view the contents of the /etc/motd file

4. Use the user module to create user wukong with uid 2000

5. Use the yum module to install the httpd package and use the service module to start the service

Answer

Preparation

# 创建ansible.cfg
[admin@centos7_server ~]$ vim ansible.cfg
[defaults]
inventory = ./inventory
remote_user = xiaoming
ask_pass = false

[privilege_escalation]
become = True
become_method = sudo
become_user = root
become_ask_pass = False

# 创建inventory
[admin@centos7_server ~]$ vim ./inventory
[all]
node1
node2

1. Execute the id command with the all host group as the target

[admin@centos7_server ~]$ ansible all -m command -a 'id xiaoming' 
node2 | CHANGED | rc=0 >>
uid=1001(xiaoming) gid=1001(xiaoming) groups=1001(xiaoming)
node1 | CHANGED | rc=0 >>
uid=1001(xiaoming) gid=1001(xiaoming) groups=1001(xiaoming)

2. Use the copy module to modify the content of the /etc/motd file on all hosts to welcome to ansible

[admin@centos7_server ~]$ ansible all -m copy -a 'content="welcome to ansible" dest=/etc/motd'
node1 | CHANGED => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    }, 
    "changed": true, 
    "checksum": "fbd71829ae30ac85a1e06b9f09d9b018919c38aa", 
    "dest": "/etc/motd", 
    "gid": 0, 
    "group": "root", 
    "md5sum": "fbbeea0f49b13d2a742b4b2e69b36fc9", 
    "mode": "0644", 
    "owner": "root", 
    "secontext": "system_u:object_r:etc_t:s0", 
    "size": 18, 
    "src": "/home/xiaoming/.ansible/tmp/ansible-tmp-1669109460.51-2671-31606008763786/source", 
    "state": "file", 
    "uid": 0
}
node2 | CHANGED => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    }, 
    "changed": true, 
    "checksum": "fbd71829ae30ac85a1e06b9f09d9b018919c38aa", 
    "dest": "/etc/motd", 
    "gid": 0, 
    "group": "root", 
    "md5sum": "fbbeea0f49b13d2a742b4b2e69b36fc9", 
    "mode": "0644", 
    "owner": "root", 
    "secontext": "system_u:object_r:etc_t:s0", 
    "size": 18, 
    "src": "/home/xiaoming/.ansible/tmp/ansible-tmp-1669109460.53-2672-232739280073562/source", 
    "state": "file", 
    "uid": 0
}

3. Use the command module to view the contents of the /etc/motd file

[admin@centos7_server ~]$ ansible all -m command -a 'cat /etc/motd'
node2 | CHANGED | rc=0 >>
welcome to ansible
node1 | CHANGED | rc=0 >>
welcome to ansible

4. Use the user module to create user wukong with uid 2000

[admin@centos7_server ~]$ ansible all -m user -a 'name=wukong uid=2000'
node2 | CHANGED => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    }, 
    "changed": true, 
    "comment": "", 
    "create_home": true, 
    "group": 2000, 
    "home": "/home/wukong", 
    "name": "wukong", 
    "shell": "/bin/bash", 
    "state": "present", 
    "system": false, 
    "uid": 2000
}
node1 | CHANGED => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    }, 
    "changed": true, 
    "comment": "", 
    "create_home": true, 
    "group": 2000, 
    "home": "/home/wukong", 
    "name": "wukong", 
    "shell": "/bin/bash", 
    "state": "present", 
    "system": false, 
    "uid": 2000
}

5. Use the yum module to install the httpd package and use the service module to start the service

[admin@centos7_server ~]$ ansible all -m yum -a 'name=httpd state= latest'
node2 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    }, 
    "changed": false, 
    "msg": "Nothing to do", 
    "rc": 0, 
    "results": []
}
node1 | CHANGED => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    }, 
    "changed": true, 
    "msg": "", 
    "rc": 0, 
    "results": [
        "Installed: apr-util-1.6.1-6.el8.x86_64", 
        "Installed: apr-util-bdb-1.6.1-6.el8.x86_64", 
        "Installed: httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64", 
        "Installed: mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86_64", 
        "Installed: apr-util-openssl-1.6.1-6.el8.x86_64", 
        "Installed: centos-logos-httpd-85.8-2.el8.noarch", 
        "Installed: httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64", 
        "Installed: apr-1.6.3-12.el8.x86_64", 
        "Installed: httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch"
    ]
}

[admin@centos7_server ~]$ ansible all -m service -a 'name=httpd state=started'
node1 | CHANGED => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    }, 
    "changed": true, 
    "name": "httpd", 
    "state": "started", 
    "status": {
        "ActiveEnterTimestampMonotonic": "0", 
        "ActiveExitTimestampMonotonic": "0", 
        "ActiveState": "inactive", 
        "After": "basic.target remote-fs.target -.mount httpd-init.service sysinit.target tmp.mount systemd-tmpfiles-setup.service nss-lookup.target systemd-journald.socket system.slice network.target", 
        "AllowIsolate": "no", 
        "AllowedCPUs": "", 
        "AllowedMemoryNodes": "", 
        "AmbientCapabilities": "", 
        "AssertResult": "no", 
        "AssertTimestampMonotonic": "0", 
        "Before": "shutdown.target", 
        "BlockIOAccounting": "no", 
        "BlockIOWeight": "[not set]", 
        "CPUAccounting": "no", 
        "CPUAffinity": "", 
        "CPUAffinityFromNUMA": "no", 
        "CPUQuotaPerSecUSec": "infinity", 
        "CPUQuotaPeriodUSec": "infinity", 
        "CPUSchedulingPolicy": "0", 
        "CPUSchedulingPriority": "0", 
        "CPUSchedulingResetOnFork": "no", 
        "CPUShares": "[not set]", 
        "CPUUsageNSec": "[not set]", 
        "CPUWeight": "[not set]", 
        "CacheDirectoryMode": "0755", 
        "CanFreeze": "yes", 
        "CanIsolate": "no", 
        "CanReload": "yes", 
        "CanStart": "yes", 
        "CanStop": "yes", 
        "CapabilityBoundingSet": "cap_chown cap_dac_override cap_dac_read_search cap_fowner cap_fsetid cap_kill cap_setgid cap_setuid cap_setpcap cap_linux_immutable cap_net_bind_service cap_net_broadcast cap_net_admin cap_net_raw cap_ipc_lock cap_ipc_owner cap_sys_module cap_sys_rawio cap_sys_chroot cap_sys_ptrace cap_sys_pacct cap_sys_admin cap_sys_boot cap_sys_nice cap_sys_resource cap_sys_time cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_audit_control cap_setfcap cap_mac_override cap_mac_admin cap_syslog cap_wake_alarm cap_block_suspend cap_audit_read cap_perfmon cap_bpf", 
        "CollectMode": "inactive", 
        "ConditionResult": "no", 
        "ConditionTimestampMonotonic": "0", 
        "ConfigurationDirectoryMode": "0755", 
        "Conflicts": "shutdown.target", 
        "ControlPID": "0", 
        "DefaultDependencies": "yes", 
        "DefaultMemoryLow": "0", 
        "DefaultMemoryMin": "0", 
        "Delegate": "no", 
        "Description": "The Apache HTTP Server", 
        "DevicePolicy": "auto", 
        "Documentation": "man:httpd.service(8)", 
        "DynamicUser": "no", 
        "EffectiveCPUs": "", 
        "EffectiveMemoryNodes": "", 
        "Environment": "LANG=C", 
        "ExecMainCode": "0", 
        "ExecMainExitTimestampMonotonic": "0", 
        "ExecMainPID": "0", 
        "ExecMainStartTimestampMonotonic": "0", 
        "ExecMainStatus": "0", 
        "ExecReload": "{ path=/usr/sbin/httpd ; argv[]=/usr/sbin/httpd $OPTIONS -k graceful ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", 
        "ExecStart": "{ path=/usr/sbin/httpd ; argv[]=/usr/sbin/httpd $OPTIONS -DFOREGROUND ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", 
        "FailureAction": "none", 
        "FileDescriptorStoreMax": "0", 
        "FragmentPath": "/usr/lib/systemd/system/httpd.service", 
        "FreezerState": "running", 
        "GID": "[not set]", 
        "GuessMainPID": "yes", 
        "IOAccounting": "no", 
        "IOSchedulingClass": "0", 
        "IOSchedulingPriority": "0", 
        "IOWeight": "[not set]", 
        "IPAccounting": "no", 
        "IPEgressBytes": "18446744073709551615", 
        "IPEgressPackets": "18446744073709551615", 
        "IPIngressBytes": "18446744073709551615", 
        "IPIngressPackets": "18446744073709551615", 
        "Id": "httpd.service", 
        "IgnoreOnIsolate": "no", 
        "IgnoreSIGPIPE": "yes", 
        "InactiveEnterTimestampMonotonic": "0", 
        "InactiveExitTimestampMonotonic": "0", 
        "JobRunningTimeoutUSec": "infinity", 
        "JobTimeoutAction": "none", 
        "JobTimeoutUSec": "infinity", 
        "KeyringMode": "private", 
        "KillMode": "mixed", 
        "KillSignal": "28", 
        "LimitAS": "infinity", 
        "LimitASSoft": "infinity", 
        "LimitCORE": "infinity", 
        "LimitCORESoft": "0", 
        "LimitCPU": "infinity", 
        "LimitCPUSoft": "infinity", 
        "LimitDATA": "infinity", 
        "LimitDATASoft": "infinity", 
        "LimitFSIZE": "infinity", 
        "LimitFSIZESoft": "infinity", 
        "LimitLOCKS": "infinity", 
        "LimitLOCKSSoft": "infinity", 
        "LimitMEMLOCK": "65536", 
        "LimitMEMLOCKSoft": "65536", 
        "LimitMSGQUEUE": "819200", 
        "LimitMSGQUEUESoft": "819200", 
        "LimitNICE": "0", 
        "LimitNICESoft": "0", 
        "LimitNOFILE": "262144", 
        "LimitNOFILESoft": "1024", 
        "LimitNPROC": "6930", 
        "LimitNPROCSoft": "6930", 
        "LimitRSS": "infinity", 
        "LimitRSSSoft": "infinity", 
        "LimitRTPRIO": "0", 
        "LimitRTPRIOSoft": "0", 
        "LimitRTTIME": "infinity", 
        "LimitRTTIMESoft": "infinity", 
        "LimitSIGPENDING": "6930", 
        "LimitSIGPENDINGSoft": "6930", 
        "LimitSTACK": "infinity", 
        "LimitSTACKSoft": "8388608", 
        "LoadState": "loaded", 
        "LockPersonality": "no", 
        "LogLevelMax": "-1", 
        "LogRateLimitBurst": "0", 
        "LogRateLimitIntervalUSec": "0", 
        "LogsDirectoryMode": "0755", 
        "MainPID": "0", 
        "MemoryAccounting": "yes", 
        "MemoryCurrent": "[not set]", 
        "MemoryDenyWriteExecute": "no", 
        "MemoryHigh": "infinity", 
        "MemoryLimit": "infinity", 
        "MemoryLow": "0", 
        "MemoryMax": "infinity", 
        "MemoryMin": "0", 
        "MemorySwapMax": "infinity", 
        "MountAPIVFS": "no", 
        "MountFlags": "", 
        "NFileDescriptorStore": "0", 
        "NRestarts": "0", 
        "NUMAMask": "", 
        "NUMAPolicy": "n/a", 
        "Names": "httpd.service", 
        "NeedDaemonReload": "no", 
        "Nice": "0", 
        "NoNewPrivileges": "no", 
        "NonBlocking": "no", 
        "NotifyAccess": "main", 
        "OOMScoreAdjust": "0", 
        "OnFailureJobMode": "replace", 
        "PermissionsStartOnly": "no", 
        "Perpetual": "no", 
        "PrivateDevices": "no", 
        "PrivateMounts": "no", 
        "PrivateNetwork": "no", 
        "PrivateTmp": "yes", 
        "PrivateUsers": "no", 
        "ProtectControlGroups": "no", 
        "ProtectHome": "no", 
        "ProtectKernelModules": "no", 
        "ProtectKernelTunables": "no", 
        "ProtectSystem": "no", 
        "RefuseManualStart": "no", 
        "RefuseManualStop": "no", 
        "RemainAfterExit": "no", 
        "RemoveIPC": "no", 
        "Requires": "-.mount system.slice sysinit.target", 
        "RequiresMountsFor": "/var/tmp", 
        "Restart": "no", 
        "RestartUSec": "100ms", 
        "RestrictNamespaces": "no", 
        "RestrictRealtime": "no", 
        "RestrictSUIDSGID": "no", 
        "Result": "success", 
        "RootDirectoryStartOnly": "no", 
        "RuntimeDirectoryMode": "0755", 
        "RuntimeDirectoryPreserve": "no", 
        "RuntimeMaxUSec": "infinity", 
        "SameProcessGroup": "no", 
        "SecureBits": "0", 
        "SendSIGHUP": "no", 
        "SendSIGKILL": "yes", 
        "Slice": "system.slice", 
        "StandardError": "inherit", 
        "StandardInput": "null", 
        "StandardInputData": "", 
        "StandardOutput": "journal", 
        "StartLimitAction": "none", 
        "StartLimitBurst": "5", 
        "StartLimitIntervalUSec": "10s", 
        "StartupBlockIOWeight": "[not set]", 
        "StartupCPUShares": "[not set]", 
        "StartupCPUWeight": "[not set]", 
        "StartupIOWeight": "[not set]", 
        "StateChangeTimestampMonotonic": "0", 
        "StateDirectoryMode": "0755", 
        "StatusErrno": "0", 
        "StopWhenUnneeded": "no", 
        "SubState": "dead", 
        "SuccessAction": "none", 
        "SyslogFacility": "3", 
        "SyslogLevel": "6", 
        "SyslogLevelPrefix": "yes", 
        "SyslogPriority": "30", 
        "SystemCallErrorNumber": "0", 
        "TTYReset": "no", 
        "TTYVHangup": "no", 
        "TTYVTDisallocate": "no", 
        "TasksAccounting": "yes", 
        "TasksCurrent": "[not set]", 
        "TasksMax": "11088", 
        "TimeoutStartUSec": "1min 30s", 
        "TimeoutStopUSec": "1min 30s", 
        "TimerSlackNSec": "50000", 
        "Transient": "no", 
        "Type": "notify", 
        "UID": "[not set]", 
        "UMask": "0022", 
        "UnitFilePreset": "disabled", 
        "UnitFileState": "disabled", 
        "UtmpMode": "init", 
        "Wants": "httpd-init.service", 
        "WatchdogTimestampMonotonic": "0", 
        "WatchdogUSec": "0"
    }
}
node2 | CHANGED => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    }, 
    "changed": true, 
    "name": "httpd", 
    "state": "started", 
    "status": {
        "ActiveEnterTimestampMonotonic": "0", 
        "ActiveExitTimestampMonotonic": "0", 
        "ActiveState": "inactive", 
        "After": "tmp.mount network.target nss-lookup.target remote-fs.target systemd-tmpfiles-setup.service systemd-journald.socket sysinit.target basic.target system.slice httpd-init.service -.mount", 
        "AllowIsolate": "no", 
        "AllowedCPUs": "", 
        "AllowedMemoryNodes": "", 
        "AmbientCapabilities": "", 
        "AssertResult": "no", 
        "AssertTimestampMonotonic": "0", 
        "Before": "shutdown.target", 
        "BlockIOAccounting": "no", 
        "BlockIOWeight": "[not set]", 
        "CPUAccounting": "no", 
        "CPUAffinity": "", 
        "CPUAffinityFromNUMA": "no", 
        "CPUQuotaPerSecUSec": "infinity", 
        "CPUQuotaPeriodUSec": "infinity", 
        "CPUSchedulingPolicy": "0", 
        "CPUSchedulingPriority": "0", 
        "CPUSchedulingResetOnFork": "no", 
        "CPUShares": "[not set]", 
        "CPUUsageNSec": "[not set]", 
        "CPUWeight": "[not set]", 
        "CacheDirectoryMode": "0755", 
        "CanFreeze": "yes", 
        "CanIsolate": "no", 
        "CanReload": "yes", 
        "CanStart": "yes", 
        "CanStop": "yes", 
        "CapabilityBoundingSet": "cap_chown cap_dac_override cap_dac_read_search cap_fowner cap_fsetid cap_kill cap_setgid cap_setuid cap_setpcap cap_linux_immutable cap_net_bind_service cap_net_broadcast cap_net_admin cap_net_raw cap_ipc_lock cap_ipc_owner cap_sys_module cap_sys_rawio cap_sys_chroot cap_sys_ptrace cap_sys_pacct cap_sys_admin cap_sys_boot cap_sys_nice cap_sys_resource cap_sys_time cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_audit_control cap_setfcap cap_mac_override cap_mac_admin cap_syslog cap_wake_alarm cap_block_suspend cap_audit_read cap_perfmon cap_bpf", 
        "CollectMode": "inactive", 
        "ConditionResult": "no", 
        "ConditionTimestampMonotonic": "0", 
        "ConfigurationDirectoryMode": "0755", 
        "Conflicts": "shutdown.target", 
        "ControlPID": "0", 
        "DefaultDependencies": "yes", 
        "DefaultMemoryLow": "0", 
        "DefaultMemoryMin": "0", 
        "Delegate": "no", 
        "Description": "The Apache HTTP Server", 
        "DevicePolicy": "auto", 
        "Documentation": "man:httpd.service(8)", 
        "DynamicUser": "no", 
        "EffectiveCPUs": "", 
        "EffectiveMemoryNodes": "", 
        "Environment": "LANG=C", 
        "ExecMainCode": "0", 
        "ExecMainExitTimestampMonotonic": "0", 
        "ExecMainPID": "0", 
        "ExecMainStartTimestampMonotonic": "0", 
        "ExecMainStatus": "0", 
        "ExecReload": "{ path=/usr/sbin/httpd ; argv[]=/usr/sbin/httpd $OPTIONS -k graceful ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", 
        "ExecStart": "{ path=/usr/sbin/httpd ; argv[]=/usr/sbin/httpd $OPTIONS -DFOREGROUND ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", 
        "FailureAction": "none", 
        "FileDescriptorStoreMax": "0", 
        "FragmentPath": "/usr/lib/systemd/system/httpd.service", 
        "FreezerState": "running", 
        "GID": "[not set]", 
        "GuessMainPID": "yes", 
        "IOAccounting": "no", 
        "IOSchedulingClass": "0", 
        "IOSchedulingPriority": "0", 
        "IOWeight": "[not set]", 
        "IPAccounting": "no", 
        "IPEgressBytes": "18446744073709551615", 
        "IPEgressPackets": "18446744073709551615", 
        "IPIngressBytes": "18446744073709551615", 
        "IPIngressPackets": "18446744073709551615", 
        "Id": "httpd.service", 
        "IgnoreOnIsolate": "no", 
        "IgnoreSIGPIPE": "yes", 
        "InactiveEnterTimestampMonotonic": "0", 
        "InactiveExitTimestampMonotonic": "0", 
        "JobRunningTimeoutUSec": "infinity", 
        "JobTimeoutAction": "none", 
        "JobTimeoutUSec": "infinity", 
        "KeyringMode": "private", 
        "KillMode": "mixed", 
        "KillSignal": "28", 
        "LimitAS": "infinity", 
        "LimitASSoft": "infinity", 
        "LimitCORE": "infinity", 
        "LimitCORESoft": "0", 
        "LimitCPU": "infinity", 
        "LimitCPUSoft": "infinity", 
        "LimitDATA": "infinity", 
        "LimitDATASoft": "infinity", 
        "LimitFSIZE": "infinity", 
        "LimitFSIZESoft": "infinity", 
        "LimitLOCKS": "infinity", 
        "LimitLOCKSSoft": "infinity", 
        "LimitMEMLOCK": "65536", 
        "LimitMEMLOCKSoft": "65536", 
        "LimitMSGQUEUE": "819200", 
        "LimitMSGQUEUESoft": "819200", 
        "LimitNICE": "0", 
        "LimitNICESoft": "0", 
        "LimitNOFILE": "262144", 
        "LimitNOFILESoft": "1024", 
        "LimitNPROC": "6930", 
        "LimitNPROCSoft": "6930", 
        "LimitRSS": "infinity", 
        "LimitRSSSoft": "infinity", 
        "LimitRTPRIO": "0", 
        "LimitRTPRIOSoft": "0", 
        "LimitRTTIME": "infinity", 
        "LimitRTTIMESoft": "infinity", 
        "LimitSIGPENDING": "6930", 
        "LimitSIGPENDINGSoft": "6930", 
        "LimitSTACK": "infinity", 
        "LimitSTACKSoft": "8388608", 
        "LoadState": "loaded", 
        "LockPersonality": "no", 
        "LogLevelMax": "-1", 
        "LogRateLimitBurst": "0", 
        "LogRateLimitIntervalUSec": "0", 
        "LogsDirectoryMode": "0755", 
        "MainPID": "0", 
        "MemoryAccounting": "yes", 
        "MemoryCurrent": "[not set]", 
        "MemoryDenyWriteExecute": "no", 
        "MemoryHigh": "infinity", 
        "MemoryLimit": "infinity", 
        "MemoryLow": "0", 
        "MemoryMax": "infinity", 
        "MemoryMin": "0", 
        "MemorySwapMax": "infinity", 
        "MountAPIVFS": "no", 
        "MountFlags": "", 
        "NFileDescriptorStore": "0", 
        "NRestarts": "0", 
        "NUMAMask": "", 
        "NUMAPolicy": "n/a", 
        "Names": "httpd.service", 
        "NeedDaemonReload": "no", 
        "Nice": "0", 
        "NoNewPrivileges": "no", 
        "NonBlocking": "no", 
        "NotifyAccess": "main", 
        "OOMScoreAdjust": "0", 
        "OnFailureJobMode": "replace", 
        "PermissionsStartOnly": "no", 
        "Perpetual": "no", 
        "PrivateDevices": "no", 
        "PrivateMounts": "no", 
        "PrivateNetwork": "no", 
        "PrivateTmp": "yes", 
        "PrivateUsers": "no", 
        "ProtectControlGroups": "no", 
        "ProtectHome": "no", 
        "ProtectKernelModules": "no", 
        "ProtectKernelTunables": "no", 
        "ProtectSystem": "no", 
        "RefuseManualStart": "no", 
        "RefuseManualStop": "no", 
        "RemainAfterExit": "no", 
        "RemoveIPC": "no", 
        "Requires": "sysinit.target -.mount system.slice", 
        "RequiresMountsFor": "/var/tmp", 
        "Restart": "no", 
        "RestartUSec": "100ms", 
        "RestrictNamespaces": "no", 
        "RestrictRealtime": "no", 
        "RestrictSUIDSGID": "no", 
        "Result": "success", 
        "RootDirectoryStartOnly": "no", 
        "RuntimeDirectoryMode": "0755", 
        "RuntimeDirectoryPreserve": "no", 
        "RuntimeMaxUSec": "infinity", 
        "SameProcessGroup": "no", 
        "SecureBits": "0", 
        "SendSIGHUP": "no", 
        "SendSIGKILL": "yes", 
        "Slice": "system.slice", 
        "StandardError": "inherit", 
        "StandardInput": "null", 
        "StandardInputData": "", 
        "StandardOutput": "journal", 
        "StartLimitAction": "none", 
        "StartLimitBurst": "5", 
        "StartLimitIntervalUSec": "10s", 
        "StartupBlockIOWeight": "[not set]", 
        "StartupCPUShares": "[not set]", 
        "StartupCPUWeight": "[not set]", 
        "StartupIOWeight": "[not set]", 
        "StateChangeTimestampMonotonic": "0", 
        "StateDirectoryMode": "0755", 
        "StatusErrno": "0", 
        "StopWhenUnneeded": "no", 
        "SubState": "dead", 
        "SuccessAction": "none", 
        "SyslogFacility": "3", 
        "SyslogLevel": "6", 
        "SyslogLevelPrefix": "yes", 
        "SyslogPriority": "30", 
        "SystemCallErrorNumber": "0", 
        "TTYReset": "no", 
        "TTYVHangup": "no", 
        "TTYVTDisallocate": "no", 
        "TasksAccounting": "yes", 
        "TasksCurrent": "[not set]", 
        "TasksMax": "11088", 
        "TimeoutStartUSec": "1min 30s", 
        "TimeoutStopUSec": "1min 30s", 
        "TimerSlackNSec": "50000", 
        "Transient": "no", 
        "Type": "notify", 
        "UID": "[not set]", 
        "UMask": "0022", 
        "UnitFilePreset": "disabled", 
        "UnitFileState": "disabled", 
        "UtmpMode": "init", 
        "Wants": "httpd-init.service", 
        "WatchdogTimestampMonotonic": "0", 
        "WatchdogUSec": "0"
    }
}

Guess you like

Origin blog.csdn.net/bo1029/article/details/127989347