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'