본문 바로가기

카테고리 없음

Linux Service 제어 명령(게스트 dhcp 받아서 호스트 IP 받기)

출처 : https://doll6777.github.io/etc/2020/03/24/linux-systemd-service-add/

 

 

Linux systemd에 서비스 등록하고 상태 확인하기 · ranlog

Linux systemd에 서비스 등록하고 상태 확인하기 24 Mar 2020 | linux systemd에 사용자가 자주 사용하는 service를 등록하고 관리할 수 있다. 리눅스에서 서비스를 자동으로 실행되도록 설정하는 것이 편하

doll6777.github.io

 

https://ma.ttias.be/auto-restart-crashed-service-systemd/

 

Auto-restart a crashed service in systemd

Systemd allows you to configure a service so that it automatically restarts in case it’s crashed.

ma.ttias.be

시스템 등록 옵션을 참고해서 만듬.

 

 

매번 브릿지가 게스트가 올라온 뒤 DHCP가 돌아간 뒤에 가능해지는데,

이를 수동으로 할 수 없으니 서비스 형태로 올렸다

총 1개의 서비스가 올라간다. 머신.

콘솔은 이거 안해도 됨(스태틱이라)

 

[Unit]
Description=Console bridge service with Firewall VM
After=core_system.service

[Service]
Type=simple
User=root
ExecStart=/usr/sbin/brctl addif console vnet1
Restart=always
RestartSec=300s
[Install]
WantedBy=multi-user.target
~