Re: [systemd-devel] GuessMainPID=no required to make daemon reload work

2014-05-17 Thread Gerd v. Egidy
Hi Кирилл, > > What's wrong with writing the new pid from the old proccess before > > releasing the lock? > > So unless someone else has a better idea I'll try this approach and report > back. I tried this now and it works as you described. Will work on a true solution based on rewriting the pi

Re: [systemd-devel] GuessMainPID=no required to make daemon reload work

2014-05-05 Thread Gerd v. Egidy
> Generally, it's not a good idea to keep file locks for a longer period > of time... YOu should really just take them while you write a file, and > then release them, but not keep them forever... I keep the lock on the pidfile as long as the daemon is running. I think this is the best way to pre

Re: [systemd-devel] GuessMainPID=no required to make daemon reload work

2014-05-05 Thread Gerd v. Egidy
Hi Lennart, thanks for your tips. > > EnvironmentFile=/etc/sysconfig/icinga2 > > This is a Fedoraism/Redhatism, I can only recommend not adding something > like this to upstream projects. You are right. Will think of an alternative way that works everywhere. > > ExecReload=/bin/sh -c '/bin/kil

Re: [systemd-devel] GuessMainPID=no required to make daemon reload work

2014-05-05 Thread Gerd v. Egidy
Hi Кирилл, > I've just tested the way I described it and everything worked perfectly. Thanks. > What's wrong with writing the new pid from the old proccess before > releasing the lock? To get it right I have to take care of two cases of SIGTERM in the old daemon: a) the new process checked it'

Re: [systemd-devel] GuessMainPID=no required to make daemon reload work

2014-05-05 Thread Gerd v. Egidy
Hi Umut, > > Can you describe the downsides of GuessMainPID=no more specific than > > "failure detection and automatic restarting of a service will not work > > reliably"? > One down side I can mention is for the fault recovery. If your > application crashes and if systemd is configured to restart

Re: [systemd-devel] GuessMainPID=no required to make daemon reload work

2014-05-05 Thread Gerd v. Egidy
Hi Кирилл, > OK, I've just re-read your message and it looks like all you need is add > `PIDFile` to your unit. This was the first thing I tried when writing the service file. Unfortunately it does not work, the service is declared dead and the new daemon is killed (unless I switch off killing

Re: [systemd-devel] GuessMainPID=no required to make daemon reload work

2014-05-04 Thread Gerd v. Egidy
Hi Кирилл, > Have you looked into using sd_notify to update MAINPID? No, not yet. I have sd_notify on my list of things to look at in the future, but I wanted to make the service work without changing the daemon itself first. Thanks for the hint about this possibility. Kind regards, Gerd ___

[systemd-devel] GuessMainPID=no required to make daemon reload work

2014-05-04 Thread Gerd v. Egidy
Hi, I'm one of the developers of the Icinga monitoring system. We want to provide a .service file for our monitoring daemon with the next major release (Icinga 2). Due to technical reasons, the daemon can't reload it's configuration files within one process. So we implement reload like this: