Double Noticed

Other talk about Salix
User avatar
ghostdawg
Posts: 56
Joined: 21. Sep 2011, 02:56
Location: STLMO

Double Noticed

Post by ghostdawg »

When I came home this evening, I saw two package update notification icons in the bottom tray. After running the update and upgrade, it was only upgrading Firefox to version 8.0. I'm running Xfce4 with Salix 13.37.

I just thought I would mention this, as it seems odd to have two notification icons showing.

Thnx.
Dell Optiplex 760 | Quad-Core | 4gb | 250gb | Salix-14.2 - Xfce4 & Openbox
HP DX5150 AMD64 | 1.5gb | 40gb | SalixOS-13.0 - Xfce4
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: Double Noticed

Post by gapan »

This has come up before. But it is very hard to reproduce, I haven't been able to do so, yet. If we can't see what's wrong, it can't be fixed. If you find a way to faithfully reproduce it, please post a follow up and we'll see what we can do.
Image
Image
User avatar
ghostdawg
Posts: 56
Joined: 21. Sep 2011, 02:56
Location: STLMO

Re: Double Noticed

Post by ghostdawg »

Thanks for the reply. I'll try to see what I can find. What is the name of the notification program that runs when updates are ready?

Thnx.
Dell Optiplex 760 | Quad-Core | 4gb | 250gb | Salix-14.2 - Xfce4 & Openbox
HP DX5150 AMD64 | 1.5gb | 40gb | SalixOS-13.0 - Xfce4
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: Double Noticed

Post by gapan »

salix-update-notifier
Image
Image
User avatar
ghostdawg
Posts: 56
Joined: 21. Sep 2011, 02:56
Location: STLMO

Re: Double Noticed

Post by ghostdawg »

Here is image of the double notification icons. Just to show how it looks.

Image

Thnx.
Dell Optiplex 760 | Quad-Core | 4gb | 250gb | Salix-14.2 - Xfce4 & Openbox
HP DX5150 AMD64 | 1.5gb | 40gb | SalixOS-13.0 - Xfce4
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Double Noticed

Post by Shador »

I was able to reproduce this problem (xfce livecd rc and openbox beta). Boot your computer and log in. Now check for running salix-update-notifier processes. There should be exactly one. Now log out and log in again (I only tried with the same user). Now checking there are two instances.
So apparently salix-update-notifier doesn't quit properly with the session.
Image
User avatar
ghostdawg
Posts: 56
Joined: 21. Sep 2011, 02:56
Location: STLMO

Re: Double Noticed

Post by ghostdawg »

Shador, you are correct, there are two instances of salix-update-notifier listed. Also I found there are two instances of gdm-binary listed. I'm not sure if it is related or not, but thought I bring it up.

Good catch on that double notifier.

Thnx.
Dell Optiplex 760 | Quad-Core | 4gb | 250gb | Salix-14.2 - Xfce4 & Openbox
HP DX5150 AMD64 | 1.5gb | 40gb | SalixOS-13.0 - Xfce4
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Double Noticed

Post by Shador »

Wrapping the salix-update-notifier code with this, should kill previous instances of the same user:

Code: Select all

#!/bin/bash

# the per-user lockfile
LOCK="$HOME/.salix-update-notifier.lock"

(

if ! flock -n 200; then
	# kill the other one (childs too just to be sure)
	OPID=`cat "$LOCK"`
	if [ -n "$OPID" ]; then
		CPIDS=$(pgrep -P $OPID)
		kill -TERM $OPID $CPIDS >/dev/null 2>&1
		(sleep 30; kill -KILL $OPID $CPIDS ) >/dev/null 2>&1 &
	fi
	# now free the lockfile and reopen it
	rm -f "$LOCK" >/dev/null 2>&1
	exec 200>"$LOCK"
	if ! flock -w 60 200; then
		# this shouldn't usually happen
		echo "Couldn't acquire lock on: '$LOCK'"
		exit 1
	fi
fi
# ready to go so store our pid
echo $$ >"$LOCK"

# now start working
while true; do
	echo "still there"
	sleep 10s
done

) 200>>"$LOCK"
This is not optimal because when logging of the salix-update-notifier instance continues running (possibly for ever?). But at least it ensures, we don't get two instances for the same user.
Image
User avatar
ghostdawg
Posts: 56
Joined: 21. Sep 2011, 02:56
Location: STLMO

Re: Double Noticed

Post by ghostdawg »

Well, up to this point, I haven't seen another two instances of the update notifier showing. I did have one a couple of days ago. So I'll keep an eye out and see if it happens again.

Thnx.
Dell Optiplex 760 | Quad-Core | 4gb | 250gb | Salix-14.2 - Xfce4 & Openbox
HP DX5150 AMD64 | 1.5gb | 40gb | SalixOS-13.0 - Xfce4
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Double Noticed

Post by Shador »

Yes, but that's just because it's quite unlikely. How often do you logout and relogin without rebooting? How often do you get updates? Low * low probability = very low probability.
Image
Post Reply