systemd를 사용하여 로그인하는 방법

systemd를 사용하여 로그인하는 방법

주어진 시스템 서비스 파일:envoy-ratelimit.service

[Unit]
Description=envoy-ratelimit
Requires=network-online.target
After=network-online.target
After=syslog.target

[Service]
Type=simple
User=root
EnvironmentFile=/etc/sysconfig/envoy-ratelimit
ExecStart=/usr/local/sbin/ratelimit $OPTIONS
ExecStop=/bin/kill -s TERM $MAINPID
Restart=on-failure
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=envoy-ratelimit

[Install]
WantedBy=multi-user.target

그리고 그 주장/etc/sysconfig/envoy-ratelimit

OPTIONS=""
RUNTIME_SUBDIRECTORY=ratelimit
LOG_LEVEL=info
PORT=8082
GRPC_PORT=8081
REDIS_SOCKET_TYPE=tcp
REDIS_URL=127.0.0.1:6389
USE_STATSD=false

명령을 통해 속도 제한 서비스를 실행하면 로그를 볼 수 있습니다.

# RUNTIME_SUBDIRECTORY=ratelimit PORT=8082 REDIS_SOCKET_TYPE=tcp REDIS_URL=172.31.141.233:6389 LOG_LEVEL=WARN USE_STATSD=false /usr/local/sbin/ratelimit 
WARN[0000] statsd is not in use                         
WARN[0000] connecting to redis on tcp 172.31.141.233:6389 with pool size 10 
WARN[0000] Listening for HTTP on ':8082'                
WARN[0000] Listening for debug on ':6070'               
WARN[0000] Listening for gRPC on ':8081'   

위의 서비스를 시스템 서비스로 실행할 때 로그가 나타나는 위치를 제안할 수 있는 사람이 있습니까?

# systemctl status envoy-ratelimit.service 
● envoy-ratelimit.service - envoy-ratelimit
   Loaded: loaded (/etc/systemd/system/envoy-ratelimit.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2019-10-28 22:37:04 CET; 5s ago
  Process: 22110 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
 Main PID: 22161 (ratelimit)
   CGroup: /system.slice/envoy-ratelimit.service
           └─22161 /usr/local/sbin/ratelimit
# journalctl -f -u envoy-ratelimit
-- Logs begin at Sat 2019-03-16 05:00:02 CET. --

^C

/var/log/messages에 대한 기록도 없습니다.envoy-ratelimit

관련 정보