Differences in controlling daemons & applications

拟墨画扇 提交于 2019-12-31 03:54:11

问题


With respect to this excellent post:

What's the difference between nohup and a daemon?

I would like to ask the following:

After launching an application from my terminal, the application keeps running either in the background or the foreground and the only thing I can do to interact with it is by sending it signals from my terminal (given that stdin is still in place).

However, after a daemon process is launched, I realized that it can be controlled with other means like querying it or restarting it (arch way):

# /etc/rc.d/daemon-name {start|stop|restart|status|...}

Could someone explain to me if that feature is built-into the general "daemon framework" and applies to every daemon process as a special feature or is it just a provision that processes designed to run as a daemon will have to handle internally?

And to add more to the matter, how on earth are we able to "control" daemons from the terminal using their name (i.e. sambad stop) while applications always have to be referred using their name (i.e. kill -9 1234)?

Thank you in advance!


回答1:


# /etc/rc.d/daemon-name {start|stop|restart|status|...}

it is not a querying to the daemons directly. It is launching scripts by standart interface and these scripts in turn operate with daemon process by PID and signals. This scripts are creating during installation process of daemons-programs.



来源:https://stackoverflow.com/questions/11695138/differences-in-controlling-daemons-applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!