[systemd-devel] question about socket activation

eshark eshark77 at 163.com
Tue Jan 2 02:09:49 UTC 2018


The program source codes and the foobar.service , the foobar.socket are as the attachments.


Thanks for any suggestion! 






At 2017-12-29 16:19:35, "eshark" <eshark77 at 163.com> wrote:

Hi, All
      I tried to test the socket activation by a simple foobar.socket and foobar.service, which are as the following:
      foobar.socket: 
       [Socket]
       ListenStream=/dev/socket/foobar


       [Install]
       WantedBy=sockets.target 


      foobar.service: 
       [Service]
       Type=simple
       ExecStart=/usr/bin/test-socket
      Restart=no


     I also wrote a simple program to connect to /dev/socket/foobar , in order to activitate the foobar.service.
    When I ran the program,  the foobar.service  was started by systemd , and the foobar.socket changed from 'listening' state to 'running' state. 
     All works OK as expected,  but  when I killed the  test-socket,  it was started again by the systemd, even if I didn't run my program.
    And from the system journal logs , I found  that
    "
Line 2035: 31,29604,571630004,-;systemd[1]: foobar.socket got notified about service death (failed permanently: no)
Line 2038: 31,29605,571630065,-;systemd[1]: foobar.socket changed running -> listening
Line 2050: 31,29609,571632385,-;systemd[1]: Incoming traffic on foobar.socket
Line 2056: 28,29611,571633087,-;systemd[1]: Cannot add dependency job for unit systemd-bus-proxyd.socket, ignoring: Unit systemd-bus-proxyd.socket failed to load: No such file or directory.
Line 2056: 28,29611,571633087,-;systemd[1]: Cannot add dependency job for unit systemd-bus-proxyd.socket, ignoring: Unit systemd-bus-proxyd.socket failed to load: No such file or directory.
Line 2065: 31,29614,571633544,-;systemd[1]: foobar.socket changed listening -> running   
"
 It seems that immediately after the death of foobar.service,    some unknown incoming traffic  on foobar.socket   made the foobar.service started again by the systemd .
  Could anyone give me some suggestion that  who connected to the foobar.socket  ?   Any idea about how to debug this problem  is very appreciated.


 Thanks a lot.




 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180102/e97cacb1/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: require.c
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180102/e97cacb1/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foobar.service
Type: application/octet-stream
Size: 68 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180102/e97cacb1/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foobar.socket
Type: application/octet-stream
Size: 79 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180102/e97cacb1/attachment-0001.obj>


More information about the systemd-devel mailing list