Re: [systemd-devel] How to control socket activation when it run respawn infinitely.
the room means a possibility. sorry, I make you confused because of that word. Thanks 2014/1/7 David Timothy Strauss da...@davidstrauss.net On Mon, Jan 6, 2014 at 8:56 AM, Tony Seo tonys...@gmail.com wrote: But, I suspect that systemd has room not to get ACK from the server process executed by service unit. I concentrated on 3-way handshaking when I studied to analyze this problem. Isn't it right when we consider the systemd? I'm not sure what you mean by room here. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] How to control socket activation when it run respawn infinitely.
Yeah, I got the process what you explain, thanks. But, I suspect that systemd has room not to get ACK from the server process executed by service unit. I concentrated on 3-way handshaking when I studied to analyze this problem. Isn't it right when we consider the systemd? 2014/1/1 David Timothy Strauss da...@davidstrauss.net On Tue, Dec 31, 2013 at 9:20 AM, Tony Seo tonys...@gmail.com wrote: But What I really want to know is why the server process always waited in the accept stage, when I executed client process for the first after system boot. It may hang in accept() if the service is Accept=true and the daemon still tries to accept(). It may also hang on accept() if it's simply blocking until the next connection. As you know that socket activation makes a service related with socket unit executed with connection of client process. If the procedure for socket activation would run like that, the server process executed for the first may not prepare the passive connection which should be set beforehand because of client connection. In my view, this waiting problem will be continue as far as the server process is simultaneously executed with the client process. what do you think about it? There is no race condition, if that's what you mean. systemd waits using epoll for the appropriate event for starting a child daemon (for Accept=false) or child processes (for Accept=true). For Accept=false, it's the same effect as if a daemon used epoll on the listener socket and only ran accept() in a callback, just possibly with a bit more delay. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Is there any way to stop services in cgroup?
In my case, PartOf is the most proper among your suggestions. I wonder why PartOf=.target didn't work when I typed systemctl command. Thanks. 2014/1/3 Mantas Mikulėnas graw...@gmail.com On Thu, Jan 2, 2014 at 4:02 PM, Tony Seo tonys...@gmail.com wrote: Hello. I wonder that systemd has a method to stop all services in specific cgroup. Actually, I have looked for a method to stop all services as the same time. I have searched many manual in systemd site. I couldn't find any method to stop all services which I want to stop. If you're trying to stop all instances of a service, systemd-git recently had wildcard support added, so `systemctl stop sshd@*.service` will now work. Otherwise, use a .target and BindsTo. -- Mantas Mikulėnas graw...@gmail.com ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Is there any way to stop services in cgroup?
Hello. I wonder that systemd has a method to stop all services in specific cgroup. Actually, I have looked for a method to stop all services as the same time. I have searched many manual in systemd site. I couldn't find any method to stop all services which I want to stop. I need some advices for solving this problem. Thanks. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] How to control socket activation when it run respawn infinitely.
First of all, thank you for advice you said. You are right, I am a novice on TCP/IP, so I had studied that for a few days. Now, I understand that UDS Protocol and the difference between Accept=true and Accept=false. But What I really want to know is why the server process always waited in the accept stage, when I executed client process for the first after system boot. As you know that socket activation makes a service related with socket unit executed with connection of client process. If the procedure for socket activation would run like that, the server process executed for the first may not prepare the passive connection which should be set beforehand because of client connection. In my view, this waiting problem will be continue as far as the server process is simultaneously executed with the client process. what do you think about it? Thanks. 2013/12/31 David Timothy Strauss da...@davidstrauss.net On Mon, Dec 30, 2013 at 7:59 AM, Tony Seo tonys...@gmail.com wrote: That situation continued whether Accept= true or not in service unit. The reason I encouraged you to learn more about socket programming is because this Accept= option isn't some sort of optimization or nuanced thing you just try either way until you get it working. What layer handles accept() for connection-oriented protocols (systemd versus a daemon) is a fundamental aspect of socket programming. If you don't understand what Accept=true and Accept=false are supposed to do and just go about trying both, you still have more learning to do. Specifically, Accept=true means systemd handles the accept() calls and spawns an instance of the service for each connection. The socket passed into the service is one corresponding to a single client's connection. It is therefore appropriate to simply read from and write to fd=3. Trying to accept() from fd=3 will probably block forever if it works at all. Accept=false (the default) means systemd merely handles the listener socket. The service must make its own accept() calls to get sockets corresponding to individual client connections. The service should not directly read from and write from fd=3; it should do that with the socket instantiated by accept(). ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] How to control socket activation when it run respawn infinitely.
Hello. Since I had gotten the message from you, I had learned socket program for normal test. After making sample processes like server and client, I tested them in many cases. But, when I tested my sample codes, the common problem was founded that the server process always waited for acceptance in accept function(). That situation continued whether Accept= true or not in service unit. In order to get a string sent from client, I should execute the client process once again. Below messages are log while I executed client process. - root#:./clinet server[906]: SD_LISTEN_FDS_START: 3 server[906]: Creating Server Socket in Server server[906]: Set Memset in Server server[906]: Set Address family as AF_UNIX in Server server[906]: Copy socket path in Server server[906]: Unlink Socket in Server server[906]: Bind Server Socket server[906]: Listen to Client in Server server[906]: Taking acception in Server- there was no respond, waiting... root#:./client server[906]: Read Buffer from client in Server server[906]: read 100 bytes: welocome to socket world - the string sent from clinet process server[906]: Taking accept in Server - why(?) - But, when I executed them without socket unit in each other, the server process passed accept function and result was normal. I wonder why it is repeated in server process. Thanks. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] How to control socket activation when it run respawn infinitely.
Hello. As you recommend me to use Accept=, I set this as true. But Client process waited for a few minute, it showed error message connection was refused. In this case, The best case to execute the service unit is to set Accept= false. But It will definitely present error message and be hanged. systemd[1]: test_server.service start request repeated too quickly, refusing to start. systemd[1]: Failed to start test_server.service.systemd[1]: test_server.service start request repeated too quickly, refusing to start. Frankly speaking, I don't understand why service daemon is infinitely spawned when I set the option Accept= false. And Why couldn't the client process connect to socket unit that I made by setting Accept= true. Thanks. 2013/12/19 Tony Seo tonys...@gmail.com Hello. I tried to execute a process by using socket activation. As it is referred at systemd manual, I made server and client process by using sd-daemon.h and sd-daemon.c. when I made those processes, I used UDS(Unix Domain Socket) to make communication between server and client. (I also made /run/test_server which executes like /run/foobar.sk in example of systemd manual for socket activation) http://0pointer.de/blog/projects/socket-activation.html And then, In order to make the process started, I made test_server.socket and test_server.service. those thing have contents like below: test_server.socket--- [Socket] ListenStream=/run/test_server [Install] WantedBy=sockets.target test_server.service--- [Service] Type=oneshot ExecStart=/bin/sh /usr/bin/kill-avn-process.sh StandardOutput=journal+console TTYPath=/dev/ttyTCC0 [Install] WantedBy=multi-user.target As soon as I executed the client process, test_server.service worked rapidly but it seemed to run in infinite loop with changing it's PID and then, it showed that error messages like: systemd[1]: test_server.service start request repeated too quickly, refusing to start. systemd[1]: Failed to start test_server.service. I already knew that a process executed by socket activation would be respawn. But, what the important thing is that I don't know how to control the number of respawn. And, why does systemd make the error about request timing. Thanks. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] (no subject)
Hello. I tried to execute a process by using socket activation. As it is referred at systemd manual, I made server and client process by using sd-daemon.h and sd-daemon.c. when I made those processes, I used UDS(Unix Domain Socket) to make communication between server and client. (I also made /run/test_server which executes like /run/foobar.sk in example of systemd manual for socket activation) http://0pointer.de/blog/projects/socket-activation.html And then, In order to make the process started, I made test_server.socket and test_server.service. those thing have contents like below: test_server.socket--- [Socket] ListenStream=/run/test_server [Install] WantedBy=sockets.target test_server.service--- [Service] Type=oneshot ExecStart=/bin/sh /usr/bin/kill-avn-process.sh StandardOutput=journal+console TTYPath=/dev/ttyTCC0 [Install] WantedBy=multi-user.target As soon as I executed the client process, test_server.service worked rapidly but it seemed to run in infinite loop with changing it's PID and then, it showed that error messages like: systemd[1]: test_server.service start request repeated too quickly, refusing to start. systemd[1]: Failed to start test_server.service. I already knew that a process executed by socket activation would be respawn. But, what the important thing is that I don't know how to control the number of respawn. And, why does systemd make the error about request timing. Thanks. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] How to control socket activation when it run respawn infinitely.
Hello. I tried to execute a process by using socket activation. As it is referred at systemd manual, I made server and client process by using sd-daemon.h and sd-daemon.c. when I made those processes, I used UDS(Unix Domain Socket) to make communication between server and client. (I also made /run/test_server which executes like /run/foobar.sk in example of systemd manual for socket activation) http://0pointer.de/blog/projects/socket-activation.html And then, In order to make the process started, I made test_server.socket and test_server.service. those thing have contents like below: test_server.socket--- [Socket] ListenStream=/run/test_server [Install] WantedBy=sockets.target test_server.service--- [Service] Type=oneshot ExecStart=/bin/sh /usr/bin/kill-avn-process.sh StandardOutput=journal+console TTYPath=/dev/ttyTCC0 [Install] WantedBy=multi-user.target As soon as I executed the client process, test_server.service worked rapidly but it seemed to run in infinite loop with changing it's PID and then, it showed that error messages like: systemd[1]: test_server.service start request repeated too quickly, refusing to start. systemd[1]: Failed to start test_server.service. I already knew that a process executed by socket activation would be respawn. But, what the important thing is that I don't know how to control the number of respawn. And, why does systemd make the error about request timing. Thanks. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Is it possible to start other service units by a service unit which was killed?
Because I have managed a few processes in systemd, I'd like to just start all processes at the same time when one of the process was failed or dead with kill signal. But I'm curious about fail from your answer, now. What is the fail signal in systemd? I don't know how to make systemd take fail by some signal or method in source code. Thanks ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Is it possible to start other service units by a service unit which was killed
Hello. I send this mail to know whether systemd have options to solve this problem without socket activation. what I have experienced situation is like: If I have A.service, B.service and C.service, I'd like to set [service] in A.service to make others started when A.service is exited(fail, exit .. are not important) A.service-- [service] ExecStart=/bin/program Restart=always --?(I don't know that some options to start B.service and C.service) So, I have checked some options in [service] manual, but I have not detected some options to start other units when A.service was killed. I really want to know that systemd have methods or options to solve my problem without socket activation. Thanks ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] How to use systemctl preset ?
Hello. I have tried to use systemctl preset command. As you know that systemd.org already explained preset in manual page, So I read those things about preset and some example to use systemctl preset. http://www.freedesktop.org/software/systemd/man/systemd.preset.html But, when I try systemctl preset command, systemd print error like below. $systemctl preset Too few arguments.(error msg) $ls 00-first.preset $systemctl preset 00-first.preset Failed to issue method call: Invalid argument(error msg) I think I have been experiencing him who already sent a mail related with me. https://bugs.freedesktop.org/show_bug.cgi?id=64215 But I couldn't understand what Lennart said like below. * If you specify just test as parameter, then this would cause test.service to be reset to the preset default, but since test.service doesn't exist on your machine this fails.* i hope someone who shall explain how to apply systemctl preset to enable/disable many units at once. thanks. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] How to use systemctl preset ?
Hello. I have tried to use systemctl preset command. As you know that systemd.org already explained preset in manual page, So I read those things about preset and some example to use systemctl preset. http://www.freedesktop.org/software/systemd/man/systemd.preset.html But, when I try systemctl preset command, systemd print error like below. $systemctl preset Too few arguments.(error msg) $ls 00-first.preset $systemctl preset 00-first.preset Failed to issue method call: Invalid argument(error msg) I think I have been experiencing same problem as him who already sent a mail related with me. https://bugs.freedesktop.org/show_bug.cgi?id=64215 But I couldn't understand what Lennart said like below. * If you specify just test as parameter, then this would cause test.service to be reset to the preset default, but since test.service doesn't exist on your machine this fails.* I hope someone who shall explain how to apply systemctl preset to enable/disable many units at once. Thanks. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Re:Re: How to use systemctl preset ?
Thanks your answer, Andrey. But what is remove policy, I can't understand what you mean. Would you plz explain more abou it? I already added all units which I'd like to disable in 00-first.preset file. 00-first.preset include: disable connman.service disable wpa_supplicant.service As you said, systemctl preset connman.service command worked well and cancel symlink from installed .want folder. So, Is there any way to remove many units which I want to disable at once? Thanks. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] How to implement a demon process by socket activation
Hi I have been aiming to make a demon process by socket activation in systemd. you know that, it was provided for socket activation in systemd homepage like below . http://0pointer.de/blog/projects/socket-activation.html I refered that guide for making a daemon process started using socket activation. I just followed the explanation in that site and tried to make a pair of server/client program on TCP/IP.( I just only added a sd_listen_fds() library fuction in server process using sd-daemon library) But it didn't work when I started server process. those processes include almost same code with following the guide. Is that all to make a daemon process by socket activation in homepage? Thanks, tonyseo ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] How to delete device units presented in systemd-analyze plot.
Hi. Today, I would want to share dramatic results through your good aids. Could you visit my blog to check the results? blog: http://best-dream-boy.blogspot.kr/ (subject: 2013.08.11 - Test1, 2013.08.11 - Test2) If you visit to my blog, you can see test1 and test2 picture. Those things were results from my test board. Since the beginning of my test, I have erased many service units thought as unnecessary for working my board. Yeah, I want to optimize systemd to work my board. Finally, I got a result like test 2 picture. As you see two pictures, Different things are avplayer.unit and some device units. In those test, I didn't use /etc/fstab in my systemd, The only dissimilarity was the existence of avplayer unit, and some device units came up. I wonder why device unit was appeared in spite of erasing /etc/fstab. I sincerely ask you a relationship between device unit and boot time if I remove unnecessary device unit. And also, can I ask you detail process of making device unit by systemd? (I alread read the manual page related with device unit) Thanks. Tony Seo. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] How to delete device units presented in systemd-analyze plot.
Hello. Now, I have studied systemd for optimizing systemd on my board. After edited several units, I would like to delete some device configuration units existing on my picture from systemd-analyze(best-dream-boy.blogspot) I read the manual pages about systemd.device, I tried to delete device units through editing /etc/fstab and systemctl mask. But I couldn't delete those device units, at least existing units on the picture. So I would ask you a question about it. Thanks. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [Re] I wanna construct server-client model with systemd option
Thank you for your friendly answer. After I recevied your mail, I have aimed to complete to make server-client model. In my view, I didn't still know how to use a service option in service configuration file. The seceario I want to make is like this: *A..service is a server program and it should be remained continuously.* *And B.service as a client program can access to A.service which has been living in systemd.* In this case, What should I use options each service which I said. Thanks. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] How to delete device units presented in systemd-analyze plot.
I understand what you mean, but I think that I will cut the time for loading device unit if I keep those from appearing on my plot. I want to do a try to temporarily disappear some kinds of device units and then I'm supposed to measure boot speed depending a board of mine.(Actually, I believe that loading time for device unit affects to boot speed) What do think that loading time for device units doesn't affect to boot speed at machine? Thanks. 2013/8/8 Mantas Mikulėnas graw...@gmail.com On Wed, Aug 7, 2013 at 8:03 PM, Tony Seo tonys...@gmail.com wrote: Hello. Now, I have studied systemd for optimizing systemd on my board. After edited several units, I would like to delete some device configuration units existing on my picture from systemd-analyze(best-dream-boy.blogspot) I read the manual pages about systemd.device, I tried to delete device units through editing /etc/fstab and systemctl mask. But I couldn't delete those device units, at least existing units on the picture. You cannot delete these units because they do not exist anywhere except in memory – they're only a way to represent device status in the format of systemd units. In other words, they do not cause the problems you're having; they only make the problems visible in your bootchart. -- Mantas Mikulėnas graw...@gmail.com ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] I wanna construct server-client model with systemd option.
Hello. I'm Tony. I have aimed to construct server-client model. In order to build that mode, I supposed that there was X_server and A_client. I tried to do several time to operate that model properly, but I have failed to do that operation. In my view, I need to edit my service option which have been used for execution , but I'm not accustomed to using service option and confused a few option related with execution like Type=and Execstart=. I would suppose the procedure to successfully do that. 1. X_server should start first. 2. After X_server finished the start-up process, but it keeps it's activated state, A_client start and connect to X_server. What should I do something to build a procedure like above and what should I use options to operate that scheme properly? Consequently, I wonder what kind of thing will be used to make that procedure. Thanks. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Does systemd have points to spend many times to complete its process?
Hello I'm Tony Seo. I've analyzed a plot resulted in systemd-analyze plot. As you can see an attached image file, I got this image from my systemd. While I have analyzed it, I have several questions. 1. what is -.mount ? when I first saw -.mout, I was confused how to configure it. 2. I doubt that there are critical points which make systemd more delayed for several reasons. I have tried to test my systemd for optimization in perspective of time consume. So, I changed the order of unit dependency and sequence among units. But I found that I may not reduce the time to activate getty.target, multi-user.target and graphical.target. And I doubt that there are critical points or span of stage to make the systemd more delayed. I want to know whether I'm wrong or not. what do you think about it? If you know some tip to improve a systemd in optimize perspective, could you give some tips to make my systemd more fast? 3. I need a clear knowledge about transaction stage. I read a manpage which introduces a few contents of transaction, but I would like to get more information about it. Thanks, Tony Seo ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] I want to ask you a fundamental question to you about dependency and starting sequence among units.
Hello. As I'm a starter in systemd, I want to ask you a fundamental question. That is how to understand existing relation from dependent and starting perspective. If you check a image file I attached, it' more clear. Actually, I have studied systemd structure to add my processes in systemd structure. Although I have read many manpage whicn is on freedesktop.org, I thought that I might not yet understand dependency and boot sequence among units after comparing results from systemd-analyze plot and dot tool. So, I want to get clear conception of dependency and boot sequence. When I first read a manpage which explains [Unit] option, I find a Wants=. For example, I make a A.service which has an Want = B.service. If A.service is started by systemd, I think that B.service will be started after A.service is totally completed. ( Is it right to use a words totally completed to explain execution of A.sevice? And I'm confused words which explain some parts of Wants=, I couldn't understand the expression start-up. Does it mean that a unit listed in Want= option will be started after the configuring unit is finished? ) if so, I think this relationship like below 1. B.service is a dependency of A.service. 2. A.service is started before B.service is started in sequential perspective of boot sequence among units. 3. if B.service is in A.service.want folder, a implicit dependency is made between A.service and B.service( result will be same as No.1) In my view, this is a critical time to develop the knowledge of systemd. I wait someone who explains those things more definite than before. Thanks Tony Seo ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] I caught a something wrong when I analyzed a systemd on my board by systemd-analyze plot
Hello. I had analyzed my systemd by using systemd-analyze plot. But I caught a something wrong related with boot sequence time. After I started my board, I checked the first boot image about 8 sec. But the plot resulted by systemd-analyze plot showed that it took about 1min 30s to complete all system unit. I was confused how to understand between plot result and physical screen out. Now, I doubt that the last unit as a factor which makes boot time more delayed and it also generates like the long plot. Does this plot depend on the last unit which started at last? I will wait clean answer about it . Thank you, Tony Seo ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel