Forum > Unix

DaemonSystemdInstallerUnit

<< < (2/2)

AlexTP:
Added the found URL to the wiki topic.

Чебурашка:
At the end what I did was:

- make the daemon (easy, just see the examples)
- create a systemd config file and make sure to have:


--- Code: INI  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---[Unit]Description=TT daemon [Service]Type=forkingWorkingDirectory=/home/user_tt/.tt_daemonExecStart=/usr/local/bin/tt_daemon -r -bUser=user_ttGroup=users  

- the option -r in the ExecStart line tells the daemon to run
- the option -b in the ExecStart line tells the daemon created with fpc to daemonize itself = fork and become background process
- the Type=forking is designed to deal with processes capable of daemonizing

in alternative


--- Code: INI  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---[Unit]Description=TT daemon [Service]Type=simpleWorkingDirectory=/home/user_tt/.tt_daemonExecStart=/usr/local/bin/tt_daemon -rUser=user_ttGroup=users  
- skip the option -b in the ExecStart so that the daemon will start and not daemonize itself (it will keep runnig until stopped from outside or it crashes)
- in this case I have to use Type=simple (is the default) which is designed to deal with processes that do not daemonize, and systemd will go ahead with other services without being locked by my process.

Navigation

[0] Message Index

[*] Previous page

Go to full version