[opensuse-packaging] Killing processes in %post?
Hi, I'm wondering if it's fine to kill processes in %post. Obviously, it should be avoided in general, but I'm faced with a case where it could be appropriate. Here's some bits from the NEWS file in dconf 0.9: ========= There has been an extremely minor incompatible change in the D-Bus API of dconf this release. From a practical standpoint, this change will have no effect. However, it serves as a reminder that the dconf D-Bus API is private and can change from version to version (and will likely change in the future). As such, it is appropriate for those packaging dconf to kill all running instances of dconf ('killall dconf-service') as part of their postinst for the package. It will be dbus-activated again on the next use. ========= How do people feel about this? Vincent -- Les gens heureux ne sont pas pressés. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 07/27/2011 12:34 PM, Vincent Untz wrote:
Hi,
I'm wondering if it's fine to kill processes in %post. Obviously, it should be avoided in general, but I'm faced with a case where it could be appropriate.
Here's some bits from the NEWS file in dconf 0.9:
========= There has been an extremely minor incompatible change in the D-Bus API of dconf this release. From a practical standpoint, this change will have no effect. However, it serves as a reminder that the dconf D-Bus API is private and can change from version to version (and will likely change in the future).
As such, it is appropriate for those packaging dconf to kill all running instances of dconf ('killall dconf-service') as part of their postinst for the package. It will be dbus-activated again on the next use. =========
How do people feel about this?
Vincent
for me if it's not noticed by a zypper ps, then it should be done by the rpm. After that, how much people will launch an update when their session will be open and then don't notice this change and will have random crash for whatever. -- Bruno Friedmann Ioda-Net Sàrl www.ioda-net.ch openSUSE Member & Ambassador GPG KEY : D5C9B751C4653227 irc: tigerfoot -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wed, Jul 27, 2011 at 12:34:37PM +0200, Vincent Untz wrote:
Hi,
I'm wondering if it's fine to kill processes in %post. Obviously, it should be avoided in general, but I'm faced with a case where it could be appropriate.
Here's some bits from the NEWS file in dconf 0.9:
========= There has been an extremely minor incompatible change in the D-Bus API of dconf this release. From a practical standpoint, this change will have no effect. However, it serves as a reminder that the dconf D-Bus API is private and can change from version to version (and will likely change in the future).
As such, it is appropriate for those packaging dconf to kill all running instances of dconf ('killall dconf-service') as part of their postinst for the package. It will be dbus-activated again on the next use. =========
How do people feel about this?
It is a bad idea I think, you can not easily know if its your dconf-service binary. Ciao, Marcus -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 07/27/2011 01:35 PM, Marcus Meissner wrote:
It is a bad idea I think, you can not easily know if its your dconf-service binary.
I think that's the idea behind the script - to kill ALL running instances of dconf-service for ALL users. -- Best Regards / S pozdravom, Pavol RUSNAK SUSE LINUX, s.r.o openSUSE Boosters Team Lihovarska 1060/12 PGP 0xA6917144 19000 Praha 9 prusnak[at]opensuse.org Czech Republic -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wed, Jul 27, 2011 at 02:37:49PM +0200, Pavol Rusnak wrote:
On 07/27/2011 01:35 PM, Marcus Meissner wrote:
It is a bad idea I think, you can not easily know if its your dconf-service binary.
I think that's the idea behind the script - to kill ALL running instances of dconf-service for ALL users.
How do you know some other programs are not called dconf-service? If such a thing is required in an online update, you would mark it as a "rebootneeded" patch. Ciao, Marcus -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wed, 27 Jul 2011, Marcus Meissner wrote:
On Wed, Jul 27, 2011 at 02:37:49PM +0200, Pavol Rusnak wrote:
On 07/27/2011 01:35 PM, Marcus Meissner wrote:
It is a bad idea I think, you can not easily know if its your dconf-service binary.
I think that's the idea behind the script - to kill ALL running instances of dconf-service for ALL users.
How do you know some other programs are not called dconf-service?
If such a thing is required in an online update, you would mark it as a "rebootneeded" patch.
Or if you kill it in a moment of ongoing communication which applications
do not expect to abort and thus causes them to crash.
Indeed a bad idea.
Richard.
--
Richard Guenther
Richard Guenther wrote:
On Wed, 27 Jul 2011, Marcus Meissner wrote:
On Wed, Jul 27, 2011 at 02:37:49PM +0200, Pavol Rusnak wrote:
On 07/27/2011 01:35 PM, Marcus Meissner wrote:
It is a bad idea I think, you can not easily know if its your dconf-service binary.
I think that's the idea behind the script - to kill ALL running instances of dconf-service for ALL users.
How do you know some other programs are not called dconf-service?
If such a thing is required in an online update, you would mark it as a "rebootneeded" patch.
Or if you kill it in a moment of ongoing communication which applications do not expect to abort and thus causes them to crash.
Indeed a bad idea.
We do the same with %restart_on_update for system services though so things wouldn't get worse. cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.de/ SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wed, 27 Jul 2011, Ludwig Nussel wrote:
Richard Guenther wrote:
On Wed, 27 Jul 2011, Marcus Meissner wrote:
On Wed, Jul 27, 2011 at 02:37:49PM +0200, Pavol Rusnak wrote:
On 07/27/2011 01:35 PM, Marcus Meissner wrote:
It is a bad idea I think, you can not easily know if its your dconf-service binary.
I think that's the idea behind the script - to kill ALL running instances of dconf-service for ALL users.
How do you know some other programs are not called dconf-service?
If such a thing is required in an online update, you would mark it as a "rebootneeded" patch.
Or if you kill it in a moment of ongoing communication which applications do not expect to abort and thus causes them to crash.
Indeed a bad idea.
We do the same with %restart_on_update for system services though so things wouldn't get worse.
But I guess we send them a SIGHUP and they react gracefully to that, no?
Richard.
--
Richard Guenther
On Wed, 27 Jul 2011 14:46, Richard Guenther
On Wed, 27 Jul 2011, Marcus Meissner wrote:
On Wed, Jul 27, 2011 at 02:37:49PM +0200, Pavol Rusnak wrote:
On 07/27/2011 01:35 PM, Marcus Meissner wrote:
It is a bad idea I think, you can not easily know if its your dconf-service binary.
I think that's the idea behind the script - to kill ALL running instances of dconf-service for ALL users.
How do you know some other programs are not called dconf-service?
If such a thing is required in an online update, you would mark it as a "rebootneeded" patch.
Or if you kill it in a moment of ongoing communication which applications do not expect to abort and thus causes them to crash.
Indeed a bad idea.
That only shows one thing: dconf-service is not able to do a "graceful-restart", apache2 can do it, this means it is possible per se, but not in dconf-service as it is. Marking it as a "rebootneeded" like the kernel or (g|eg|m|n)libc is the best way at this time, not the best way at all (graceful-restart) but for now. Just killing ANY program that is not able to do a graceful-restart is disrupting for a user and needs a warning beforhand (e.g. rebootneeded). Just my 2ct on this, Yamaban. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 07/27/2011 02:56 PM, Yamaban wrote:
That only shows one thing: dconf-service is not able to do a "graceful-restart",
So what seems like a good idea is to use "killall -SIGHUP dconf-service" or "killall -SIGUSR1 dconf-service" and patch dconf-service to do a graceful restart when these signals are received, right? -- Best Regards / S pozdravom, Pavol RUSNAK SUSE LINUX, s.r.o openSUSE Boosters Team Lihovarska 1060/12 PGP 0xA6917144 19000 Praha 9 prusnak[at]opensuse.org Czech Republic -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wed, 27 Jul 2011 15:04, Pavol Rusnak
On 07/27/2011 02:56 PM, Yamaban wrote:
That only shows one thing: dconf-service is not able to do a "graceful-restart",
So what seems like a good idea is to use "killall -SIGHUP dconf-service" or "killall -SIGUSR1 dconf-service" and patch dconf-service to do a graceful restart when these signals are received, right?
Yes, this is exactly what I meant to say. But during the change from the version without this ability and the first with it caution is still needed to get a clean shutdown of the old / still running version. Thanks, Yamaban. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Am Wed, 27 Jul 2011 15:04:24 +0200
schrieb Pavol Rusnak
On 07/27/2011 02:56 PM, Yamaban wrote:
That only shows one thing: dconf-service is not able to do a "graceful-restart",
So what seems like a good idea is to use "killall -SIGHUP dconf-service" or "killall -SIGUSR1 dconf-service" and patch dconf-service to do a graceful restart when these signals are received, right?
No. If I have a script "dconf-service" which has nothing to do with your dconf-service, it will get killed. You need to make sure to only kill the dconf-services that belong to your package. Which is very hard. Slap the authors with a very big clue stick. If they break it like this, they need some way to restart it, be it via a dbus signal or by at least writing proper pidfiles somewhere so that you can check if you are killing the correct program. -- Stefan Seyfried "Dispatch war rocket Ajax to bring back his body!" -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 29 July 2011 08:44, Stefan Seyfried
Am Wed, 27 Jul 2011 15:04:24 +0200 schrieb Pavol Rusnak
: On 07/27/2011 02:56 PM, Yamaban wrote:
That only shows one thing: dconf-service is not able to do a "graceful-restart",
So what seems like a good idea is to use "killall -SIGHUP dconf-service" or "killall -SIGUSR1 dconf-service" and patch dconf-service to do a graceful restart when these signals are received, right?
No. If I have a script "dconf-service" which has nothing to do with your dconf-service, it will get killed.
You need to make sure to only kill the dconf-services that belong to your package. Which is very hard.
Slap the authors with a very big clue stick. If they break it like this, they need some way to restart it, be it via a dbus signal or by at least writing proper pidfiles somewhere so that you can check if you are killing the correct program.
Does netstat output help any? I don't have "dconf" running on my system but the socket path may be an attribute of the right service : # netstat -lp |grep dbus unix 2 [ ACC ] STREAM LISTENING 15540 4439/dbus-daemon @/tmp/dbus-U3uo82lGlj unix 2 [ ACC ] STREAM LISTENING 7291 1337/dbus-daemon /var/run/dbus/system_bus_socket # netstat --unix -p | grep dbus { copious output } Agree that a "RESTART" or "STOP" feature in protocol makes sense. Rob -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Le vendredi 29 juillet 2011, à 09:10 +0100, Rob Davies a écrit :
Does netstat output help any? I don't have "dconf" running on my system but the socket path may be an attribute of the right service :
# netstat -lp |grep dbus unix 2 [ ACC ] STREAM LISTENING 15540 4439/dbus-daemon @/tmp/dbus-U3uo82lGlj unix 2 [ ACC ] STREAM LISTENING 7291 1337/dbus-daemon /var/run/dbus/system_bus_socket # netstat --unix -p | grep dbus { copious output }
Agree that a "RESTART" or "STOP" feature in protocol makes sense.
dconf-service is a per-user service, not a system daemon. Some restart/stop message like this would involve sending a message on the user bus for each user, which is not really an option, I guess. Vincent -- Les gens heureux ne sont pas pressés. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 29 July 2011 09:13, Vincent Untz
Agree that a "RESTART" or "STOP" feature in protocol makes sense.
dconf-service is a per-user service, not a system daemon. Some restart/stop message like this would involve sending a message on the user bus for each user, which is not really an option, I guess.
echo "Please log out & back in" | wall Gave me a "notification" in GUI, not sure if GNOME3 handles that though. Rob -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 07/29/2011 09:44 AM, Stefan Seyfried wrote:
So what seems like a good idea is to use "killall -SIGHUP dconf-service" or "killall -SIGUSR1 dconf-service" and patch dconf-service to do a graceful restart when these signals are received, right?
No. If I have a script "dconf-service" which has nothing to do with your dconf-service, it will get killed.
You need to make sure to only kill the dconf-services that belong to your package. Which is very hard.
Hrm, maybe creating a "dconf-package" cgroup, put all dconf-service instances in that group on process start and send a signal to this group's members instead of using killall. Sounds a little bit overengineered, though :-) -- Best Regards / S pozdravom, Pavol RUSNAK SUSE LINUX, s.r.o openSUSE Boosters Team Lihovarska 1060/12 PGP 0xA6917144 19000 Praha 9 prusnak[at]opensuse.org Czech Republic -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (9)
-
Bruno Friedmann
-
Ludwig Nussel
-
Marcus Meissner
-
Pavol Rusnak
-
Richard Guenther
-
Rob Davies
-
Stefan Seyfried
-
Vincent Untz
-
Yamaban