Linux/Criar Serviço

De TheNets Wiki
Ir para: navegação, pesquisa

Crie um arquivo no diretório do Systemd:

/etc/systemd/system/my_daemon.service

 1 [Unit]
 2 Description=My Miscellaneous Service
 3 After=network.target
 4 
 5 [Service]
 6 Type=simple
 7 # Another Type option: forking
 8 User=nanodano
 9 WorkingDirectory=/home/nanodano
10 ExecStart=/home/nanodano/my_daemon --option=123
11 Restart=on-failure
12 # Other Restart options: or always, on-abort, etc
13 
14 [Install]
15 WantedBy=multi-user.target


Referência

https://www.devdungeon.com/content/creating-systemd-service-files