ubuntu

systemd

최진한 2023. 6. 7. 16:14

/etc/systemd/system/testchk.service

 

[Unit]
Description=Systemd Test Deamon

[Service]
ExecStart=/root/testchk.sh

[Install]
WantedBy=user. Target

 

/root/testchk.sh


#!/bin/bash
/root/a.out

 

$chmod 777 testchk.sh

$systemctl start testchk

$systemctl status testchk

 

● testchk.service - Systemd Test Deamon
   Loaded: loaded (/etc/systemd/system/testchk.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2023-06-07 16:14:33 KST; 6s ago
 Main PID: 16286 (testchk.sh)
   CGroup: /system.slice/testchk.service
           ├─16286 /bin/bash /root/testchk.sh
           └─16287 /root/a.out

Jun 07 16:14:33 sh2597.cafe24.com systemd[1]: Started Systemd Test Deamon.

'ubuntu' 카테고리의 다른 글

Makefile  (1) 2023.06.01
vsftpd  (0) 2023.05.27
kernel compile  (0) 2023.03.12
teamviewer wayland warning  (0) 2023.03.06
Access denied with code 403  (0) 2022.11.22