°Ô½Ã¹° 259°Ç
   
[redhat7.2] systemd ¼­ºñ½º Ãß°¡ ¹æ¹ý
±Û¾´ÀÌ : theko ³¯Â¥ : 2016-09-13 (È­) 09:35 Á¶È¸ : 7297
 systemd ¼­ºñ½º Ãß°¡ ¹æ¹ý Àü´Þµå¸³´Ï´Ù.


1. /etc/systemd/system/ µð·ºÅ丮³» ¼­ºñ½º¸í.service ÆÄÀÏ »ý¼º

2. ÀÓÀÇ »ý¼ºÇÑ .service ÆÄÀϳ» ³»¿ë Ãß°¡


------------------------------
¿¹Á¦1)

[Unit]

Description= Test Service - ÇØ´ç ¼­ºñ½º¿¡ ´ëÇÑ °£·«ÇÑ ¼³¸í

[Service]
Type=forking
ExecStart=/home/test/test start - ¼­ºñ½º ½ÃÀ۽à ½ÇÇàÇÒ ¸í·É¾î ȤÀº ½ºÅ©¸³Æ®¸¦ ÁöÁ¤ÇÕ´Ï´Ù.
ExecStop=/home/test/test stop - ¼­ºñ½º ÁßÁö½Ã ½ÇÇàÇÒ ¸í·É¾î ȤÀº ½ºÅ©¸³Æ®¸¦ ÁöÁ¤ÇÕ´Ï´Ù. [Install] WantedBy=multi-user.target

¿¹Á¦2) tomcat ¼­ºñ½º µî·Ï

[Unit]
Description=tomcat service
After=syslog.target network.target - ÇØ´ç ¶óÀο¡ µî·ÏµÇ¾î ÀÖ´Â ¼­ºñ½º°¡ ¿ì¼± ½ÇÇàµÇ¾î¾ß  tomcat ¼­ºñ½º°¡ ½ÇÇàµË´Ï´Ù.

[Service]
Type=forking
User=tomcat       - ÇØ´ç ¼­ºñ½º¸¦ ½ÇÇàÇÒ À¯Àú/±×·ìÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
Group=tomcat
ExecStart=/tomcat/bin/catalina.sh start
ExecStop=/tomcat/bin/catalina.sh stop

[Install]
WantedBy=multi-user.target

3. ¼­ºñ½º ³»¿ë Ãß°¡ ÈÄ daemon-reload
]# systemctl daemon-reload

4. ¼­ºñ½º ½ÃÀÛ ¹× ÀçºÎÆýà ½ÇÇà È°¼ºÈ­
]# systemctl enable NAME.service  

]# systemctl start NAME.service

------------------------------

À§ ¿¹Á¦´Â ±âº»ÀûÀÎ ³»¿ëÀ̸ç, µî·ÏÀÌ ÇÊ¿äÇÑ ¼­ºñ½º¿¡ µû¶ó ³»¿ë Ãß°¡/¼öÁ¤ÀÌ ÇÊ¿äÇÒ ¼ö ÀÖ½À´Ï´Ù.

»ç¿ëÀÚ ¼­ºñ½º µî·Ï¿¡ °üÇÑ Á» ´õ ÀÚ¼¼ÇÑ ³»¿ëÀº ´ÙÀ½ ÆäÀÌÁö¿¡¼­ È®ÀÎÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.

'CREATING AND MODIFYING SYSTEMD UNIT FILES'

À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

miwit.com sir.co.kr DNS Powered by DNSEver.com DNS Powered by DNSEver.com