[go: up one dir, main page]

|
|
Log in / Subscribe / Register

Systemd and ConsoleKit

Systemd and ConsoleKit

Posted May 6, 2011 15:15 UTC (Fri) by nybble41 (subscriber, #55106)
In reply to: Systemd and ConsoleKit by aniou
Parent article: Systemd and ConsoleKit

There doesn't seem to be any explicit support for reloading services, but you could use something like "pre-stop exec /usr/sbin/nginx -t" to keep the service running unless there is a valid configuration to restart into.


to post comments

Systemd and ConsoleKit

Posted May 6, 2011 16:09 UTC (Fri) by aniou (guest, #74708) [Link] (5 responses)

I know that upstart has default support for reloading (HUP) daemons. But - for example - script in Debian has support for testing configuration (nginx -t) and conditional reload (HUP). And I want configuration reloading NOT service restarting.

Systemd and ConsoleKit

Posted May 6, 2011 18:55 UTC (Fri) by anselm (subscriber, #2796) [Link]

Doesn't sound like a feature that would be impossible to add.

Systemd and ConsoleKit

Posted May 7, 2011 9:31 UTC (Sat) by mezcalero (subscriber, #45103) [Link] (3 responses)

In systemd we decided not to do any kind of SIGHUP magic implicitly, and that for a reason. The thing with SIGHUP-based reloading is that it is fully async: a client requesting a reload has no way to know or wait until the reload in the daemon is actually completed. In general we however try to make behaviour of the service operations as dependable as possible and that includes that users should be able to expects synchronous reloads.

That all said we do give you the option to use SIGHUP for reloading (in in a few cases that's even OK to use, since there is no effective difference between async/sync reloading for the particular case) simply by invoking the /bin/kill command from ExecReload=.

But yeah, in general think twice: the traditional SIGHUP reloading of Unix daemons is problematic.

Lennart

Systemd and ConsoleKit

Posted May 9, 2011 8:21 UTC (Mon) by marcH (subscriber, #57642) [Link] (2 responses)

> In general we however try to make behaviour of the service operations as dependable as possible and that includes that users should be able to expects synchronous reloads.

Having suffered a lot from it in various cases I think I understand the "fire-and-forget" programming problem with SIGHUP reloads. BTW, even some "start" commands are asynchronous by default. This is an incredible bad idea: it is trivial to make a synchronous command asynchronous (&) as a speed hack, while extremely hard to check for completion of a dependency that escapes by making itself asynchronous.

However asynchronous commands are usually not a problem for end-users. Human end-users are quite different from programs: they more often than not know how much time the command will take, are able to poll intelligently, know how to verify whether the service has actually been reloaded,... so removing the whole feature just because it cannot be made synchronous would sound a bit harsh.

I do not know about systemd (yet...), but other init systems could probably make more difference between their programming versus user interfaces. Something like: "SIGUP commands are only for end-users, do not use in scripts". I have no idea how this could be achieved though.

Systemd and ConsoleKit

Posted May 9, 2011 11:44 UTC (Mon) by vonbrand (subscriber, #4458) [Link] (1 responses)

But you said it yourself: Just "... &" the regular command.

Systemd and ConsoleKit

Posted May 9, 2011 13:41 UTC (Mon) by marcH (subscriber, #57642) [Link]

I do not see which point you are answering to.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds