[systemd-devel] what is the best way to connect to another user's service (when root)?

2017-11-23 Thread Jeff Solomon
Hi, More questions about the systemd user service. Inside a script running as root, I want to control another user's service. I have found two ways to do this: systemd-run -t --setenv=XDG_RUNTIME_DIR=/run/user/ --uid= systemctl --user ... or: su -l -c "XDG_RUNTIME_DIR=/run/user/

Re: [systemd-devel] [systemd memory-leak] leak in systemd version 195

2017-11-23 Thread Shekhar arya
My system uses poky 1.6 and it uses systemd v195. Since, it is stable till now, we have not upgraded the systemd, On Thu, Nov 23, 2017 at 10:06 PM, Reindl Harald wrote: > > > Am 23.11.2017 um 17:30 schrieb Shekhar arya: > >> I am using systemd v195 >> > didn't you find

Re: [systemd-devel] [systemd memory-leak] leak in systemd version 195

2017-11-23 Thread Shekhar arya
Thanks. I will check it. On Thu, Nov 23, 2017 at 10:09 PM, Mantas Mikulėnas wrote: > On Thu, Nov 23, 2017, 18:30 Shekhar arya wrote: > >> Hi Guys, >> >> I am using systemd v195. With normal system operation, there is a little >> increase in the

Re: [systemd-devel] [systemd memory-leak] leak in systemd version 195

2017-11-23 Thread Mantas Mikulėnas
On Thu, Nov 23, 2017, 18:30 Shekhar arya wrote: > Hi Guys, > > I am using systemd v195. With normal system operation, there is a little > increase in the system's memory. But, when I run certain commands to get > big files over ssh every 30 minutes, I see that the

Re: [systemd-devel] [systemd memory-leak] leak in systemd version 195

2017-11-23 Thread Reindl Harald
Am 23.11.2017 um 17:30 schrieb Shekhar arya: I am using systemd v195 didn't you find any older version? even CentOS7 has v219 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org

[systemd-devel] [systemd memory-leak] leak in systemd version 195

2017-11-23 Thread Shekhar arya
Hi Guys, I am using systemd v195. With normal system operation, there is a little increase in the system's memory. But, when I run certain commands to get big files over ssh every 30 minutes, I see that the system go unresponsive after 3 days. Further analysis led to the root cause of the issue

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Lennart Poettering
On Do, 23.11.17 12:40, Gena Makhomed (g...@csdoc.com) wrote: > On 23.11.2017 2:30, Reindl Harald wrote: > > > > > > > or just remove the pid-file stuff from the systemd-unit, > > > > > > systemd don't need it really > > > > You are talking about GuessMainPID= option? > > > no i talk about

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Lennart Poettering
On Do, 23.11.17 11:32, Gena Makhomed (g...@csdoc.com) wrote: > On 23.11.2017 7:45, Mantas Mikulėnas wrote: > > > > This is bug in nginx code? And this bug should be fixed in nginx? > > > > > > But "daemon(); write_pidfile();" is common pattern > > > used by many services and even in library

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Lennart Poettering
On Mi, 22.11.17 22:27, Reindl Harald (h.rei...@thelounge.net) wrote: > Am 22.11.2017 um 21:37 schrieb Gena Makhomed: > > I am use nginx web server (http://nginx.org/) with systemd. > > But I see errors in /var/log/messages when running nginx: > > > > systemd: Starting nginx - high performance

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Lennart Poettering
On Do, 23.11.17 00:02, Gena Makhomed (g...@csdoc.com) wrote: > On 22.11.2017 23:27, Reindl Harald wrote: > > > > I am use nginx web server (http://nginx.org/) with systemd. > > > But I see errors in /var/log/messages when running nginx: > > > > > > systemd: Starting nginx - high performance web

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Lennart Poettering
On Mi, 22.11.17 22:37, Gena Makhomed (g...@csdoc.com) wrote: > But nginx is forking daemon - when start process exited - > no warranty what pidfile already created by child process. > > This is bug in nginx code? And this bug should be fixed in nginx? Yes, and that's not just broken in the

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Colin Guthrie
Gena Makhomed wrote on 23/11/17 12:38: > On 23.11.2017 12:53, Michael Chapman wrote: > >> Many other deficiencies with the BSD daemon() function are documented >> in systemd's daemon(7) manpage. > > Michael, thank you for reference to daemon(7) manpage, > this is exactly that I am looking for. >

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Gena Makhomed
On 23.11.2017 12:53, Michael Chapman wrote: Many other deficiencies with the BSD daemon() function are documented in systemd's daemon(7) manpage. Michael, thank you for reference to daemon(7) manpage, this is exactly that I am looking for. I will try to ask nginx developers for implementing

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Gena Makhomed
On 23.11.2017 11:52, Clemens Gruber wrote: Can you try this on a newer systemd version? Yours is pretty old. I'm on systemd 235 (ArchLinux). Maybe systemd 219 behaved differently for forking services? This is does not help, as I understand from the latest systemd sources - this is common

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Reindl Harald
Am 23.11.2017 um 11:40 schrieb Gena Makhomed: On 23.11.2017 2:30, Reindl Harald wrote: i know that all, httpd and postfix are typically forking services and are working fine without any PID file since 2011 # grep PIDFile /usr/lib/systemd/system/postfix.service

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Michael Chapman
On Thu, 23 Nov 2017, Gena Makhomed wrote: On 23.11.2017 7:45, Mantas Mikulėnas wrote: This is bug in nginx code? And this bug should be fixed in nginx? But "daemon(); write_pidfile();" is common pattern used by many services and even in library functions. It may be common, but not

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Gena Makhomed
On 23.11.2017 2:30, Reindl Harald wrote: or just remove the pid-file stuff from the systemd-unit, systemd don't need it really You are talking about GuessMainPID= option? no i talk about nearly 6 years systemd expierience in production and that i yet need to see a real world case where

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Reindl Harald
Am 23.11.2017 um 10:32 schrieb Gena Makhomed: On 23.11.2017 7:45, Mantas Mikulėnas wrote: This is bug in nginx code? And this bug should be fixed in nginx? But "daemon(); write_pidfile();" is common pattern used by many services and even in library functions. It may be common, but not

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Clemens Gruber
On Thu, Nov 23, 2017 at 01:22:21AM +0200, Gena Makhomed wrote: > nginx is build with "--pid-path=/var/run/nginx.pid" > and "PIDFile=/var/run/nginx.pid" is in nginx.service file. OK. > All ok with pid file, it located at /var/run/nginx.pid > and no directive pid defined in nginx.conf file.

Re: [systemd-devel] How to run forking daemon with systemd in correct way, without errors?

2017-11-23 Thread Gena Makhomed
On 23.11.2017 7:45, Mantas Mikulėnas wrote: This is bug in nginx code? And this bug should be fixed in nginx? But "daemon(); write_pidfile();" is common pattern used by many services and even in library functions. It may be common, but not necessarily correct. The parent process should only