more than one instance

Bug #478255 reported by frank
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lrcShow-X
Fix Released
Low
Unassigned

Bug Description

use r' ps -ef | grep "python\\s*lrcShow-X\\.py" | wc -l', but lrcShow-X still could be run more than one instance.

gentoo python-2.6

Revision history for this message
OutLikeAShoe (outlikeashoe) wrote :

Could you please post the output of "ps -ef" ?
So I'll change the RegEx.

Revision history for this message
frank (xujia19) wrote :
Download full text (7.4 KiB)

frank@localhost ~ $ ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 20:26 ? 00:00:00 init [3]
root 2 0 0 20:26 ? 00:00:00 [kthreadd]
root 3 2 0 20:26 ? 00:00:00 [migration/0]
root 4 2 0 20:26 ? 00:00:00 [ksoftirqd/0]
root 5 2 0 20:26 ? 00:00:00 [watchdog/0]
root 6 2 0 20:26 ? 00:00:00 [events/0]
root 7 2 0 20:26 ? 00:00:00 [khelper]
root 12 2 0 20:26 ? 00:00:00 [async/mgr]
root 120 2 0 20:26 ? 00:00:00 [kblockd/0]
root 123 2 0 20:26 ? 00:00:00 [kacpid]
root 124 2 0 20:26 ? 00:00:00 [kacpi_notify]
root 125 2 0 20:26 ? 00:00:00 [kacpi_hotplug]
root 194 2 0 20:26 ? 00:00:00 [ksuspend_usbd]
root 199 2 0 20:26 ? 00:00:00 [khubd]
root 202 2 0 20:26 ? 00:00:00 [kseriod]
root 259 2 0 20:26 ? 00:00:00 [khungtaskd]
root 260 2 0 20:26 ? 00:00:00 [pdflush]
root 261 2 0 20:26 ? 00:00:00 [pdflush]
root 262 2 0 20:26 ? 00:00:00 [kswapd0]
root 263 2 0 20:26 ? 00:00:00 [aio/0]
root 264 2 0 20:26 ? 00:00:00 [nfsiod]
root 863 1 0 20:26 ? 00:00:00 /sbin/v86d
root 864 2 0 20:26 ? 00:00:00 [cqueue]
root 1040 2 0 20:26 ? 00:00:00 [kpsmoused]
root 1043 2 0 20:26 ? 00:00:00 [kstriped]
root 1045 2 0 20:26 ? 00:00:00 [kondemand/0]
root 1046 2 0 20:26 ? 00:00:00 [kconservative/0]
root 1073 2 0 20:26 ? 00:00:00 [usbhid_resumer]
root 1078 2 0 20:26 ? 00:00:00 [rpciod/0]
root 1085 2 0 20:26 ? 00:00:00 [reiserfs/0]
root 1227 1 0 20:26 ? 00:00:00 /sbin/udevd --daemon
root 1611 1 0 20:26 ? 00:00:00 /sbin/mount.ntfs-3g /dev/hda6 /mnt/hda6 -o
101 2146 1 0 20:26 ? 00:00:00 /usr/bin/dbus-daemon --system
root 2166 1 0 20:26 ? 00:00:00 supervising syslog-ng
root 2167 2166 0 20:26 ? 00:00:00 /usr/sbin/syslog-ng
root 2184 1 0 20:26 ? 00:00:00 /usr/sbin/console-kit-daemon
102 2265 1 0 20:26 ? 00:00:00 /usr/sbin/hald --use-syslog --verbose=no
root 2266 2265 0 20:26 ? 00:00:00 hald-runner
root 2291 2266 0 20:26 ? 00:00:00 hald-addon-input: Listening on /dev/input/
root 2299 2266 0 20:26 ? 00:00:00 hald-addon-storage: polling /dev/hdc (ever
root 2308 2266 0 20:26 ? 00:00:00 /usr/libexec/hald-addon-cpufreq
102 2309 2266 0 20:26 ? 00:00:00 /usr/libexec/hald-addon-acpi
root 2465 1227 0 20:26 ? 00:00:00 /sbin/udevd --daemon
root 2476 1 0 20:27 ? 00:00:00 /usr/sbin/p...

Read more...

Revision history for this message
OutLikeAShoe (outlikeashoe) wrote :

> frank 2983 2909 4 20:33 pts/2 00:00:00 /usr/bin/python2.6 ./lrcShow-X.py

The regex only searches for "python", in your case it's "python2.6".

We can match for "python(version)?".
In this case the regex should be something like
"python[\\d\\.]*\\s*lrcShow-X\\.py"
Please try if it matches, if so we can update the regex.

Revision history for this message
OutLikeAShoe (outlikeashoe) wrote :

Oh.. another thing: in your case the regex does not match yet, the path to lrcShow-X.py is "./lrcShow-X.py" and the regex onlye searches for "lrcShow-X.py".

Now.. I think the best thing is to do a step backward, using the lock file, but instead of only creating it, we'll write into that the PID (process identifier) of the running lrcShow-X instance.

So when trying to create another instance we should only check if a process with that PID exists and matches "lrcShow-X" without checking it with a strong regex.

Changed in lrcshow-x:
importance: Undecided → Low
status: New → In Progress
Revision history for this message
frank (xujia19) wrote :

to keep simple, how about just keep the previous code "grep python | grep lrcShow-X" ?

Revision history for this message
babiloe (babiloe) wrote :

hmm i guess i have same problem. or not?
Just installed ubuntu 9.10 with banshee audio player and py-qt4 dependency for installing lrcshow-x.
run banshee than run ./lrcshow-x.py on terminal, .the lrcshow-x came with another pop-up of new banshee audio player.
So 2 banshee audio player came out, no connectivity between them.
the lrcshow-x works with the new banshee that came pop-up. like the first audio player just fishin' the lrcshow to came out.

Revision history for this message
frank (xujia19) wrote :

Hi babiloe:

I really have no idea about this issue. lrcShow-X is impossible to start another banshee instance. You have this problem with which version of lrcShow-X, or all version? And is there extra output in terminal?

frank (xujia19)
Changed in lrcshow-x:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.