Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.mac.system > #125790 > unrolled thread

photolibraryd

Started byme@home.spamsucks.ca (Király)
First post2019-08-16 16:15 +0000
Last post2019-08-27 23:09 +0000
Articles 16 — 4 participants

Back to article view | Back to comp.sys.mac.system


Contents

  photolibraryd me@home.spamsucks.ca (Király) - 2019-08-16 16:15 +0000
    Re: photolibraryd ~BD~ <dgb@nomail.invalid> - 2019-08-16 17:25 +0100
    Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-16 16:41 +0000
      Re: photolibraryd me@home.spamsucks.ca (Király) - 2019-08-17 04:44 +0000
        Re: photolibraryd gtr <xxx@yyy.zzz> - 2019-08-16 22:49 -0700
        Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-17 17:00 +0000
          Re: photolibraryd me@home.spamsucks.ca (Király) - 2019-08-17 22:29 +0000
            Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-18 22:40 +0000
              Re: photolibraryd me@home.spamsucks.ca (Király) - 2019-08-22 15:34 +0000
                Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-22 15:52 +0000
                  Re: photolibraryd gtr <xxx@yyy.zzz> - 2019-08-22 21:49 -0700
                    Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-23 18:31 +0000
                      Re: photolibraryd gtr <xxx@yyy.zzz> - 2019-08-23 17:39 -0700
                        Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-24 19:27 +0000
                      Re: photolibraryd me@home.spamsucks.ca (Király) - 2019-08-26 15:41 +0000
                        Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-27 23:09 +0000

#125790 — photolibraryd

Fromme@home.spamsucks.ca (Király)
Date2019-08-16 16:15 +0000
Subjectphotolibraryd
Message-ID<qj6kqu$ov0$1@dont-email.me>
Spouse and I share the same Photos library between our two user accounts 
on the same Mac (MacOS 10.13.6, Photos 3.0.) Library is on an external 
volume with ownership ignored. 

After one of us uses (and quits) Photos, photolibraryd continues 
running, and the other user can't open the library. We have to either 
force quit the photolibraryd process using Activity Monitor, or log out 
the other user. Any way around this? Why does photolibraryd keep running 
after the user has quit the app?

-- 
K.

Connection closed by foreign host.

[toc] | [next] | [standalone]


#125791

From~BD~ <dgb@nomail.invalid>
Date2019-08-16 17:25 +0100
Message-ID<9OA5F.12$3e2.6@fx05.fr7>
In reply to#125790
On 16/08/2019 17:15, Király wrote:
> Spouse and I share the same Photos library between our two user accounts
> on the same Mac (MacOS 10.13.6, Photos 3.0.) Library is on an external
> volume with ownership ignored.
> 
> After one of us uses (and quits) Photos, photolibraryd continues
> running, and the other user can't open the library. We have to either
> force quit the photolibraryd process using Activity Monitor, or log out
> the other user. Any way around this? Why does photolibraryd keep running
> after the user has quit the app?

Is there some reason for you not upgrading to the current OS - 10.14.6 
and current Photos which is Version 4.0 (3461.7.140)?

Perhaps if you upgrade, all will work as you wish!

Good luck! :-)

-- 
David B.
Devon

[toc] | [prev] | [next] | [standalone]


#125792

FromJolly Roger <jollyroger@pobox.com>
Date2019-08-16 16:41 +0000
Message-ID<gro4l0F75egU1@mid.individual.net>
In reply to#125790
On 2019-08-16, Király <me@home.spamsucks.ca> wrote:
> Spouse and I share the same Photos library between our two user accounts 
> on the same Mac (MacOS 10.13.6, Photos 3.0.) Library is on an external 
> volume with ownership ignored. 
>
> After one of us uses (and quits) Photos, photolibraryd continues 
> running, and the other user can't open the library. We have to either 
> force quit the photolibraryd process using Activity Monitor, or log out 
> the other user. Any way around this? Why does photolibraryd keep running 
> after the user has quit the app?

It's possible that behavior is due to a bug. It's also possible that
Apple hasn't considered this use case (two users sharing the same
library on a volume whose ownership & permissions are ignored.

Seems like a great candidate for a bug report.

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

[toc] | [prev] | [next] | [standalone]


#125800

Fromme@home.spamsucks.ca (Király)
Date2019-08-17 04:44 +0000
Message-ID<qj80nf$klh$1@dont-email.me>
In reply to#125792
Jolly Roger <jollyroger@pobox.com> wrote:
> It's possible that behavior is due to a bug. It's also possible that
> Apple hasn't considered this use case (two users sharing the same
> library on a volume whose ownership & permissions are ignored.
> 
> Seems like a great candidate for a bug report.

Yeah, but I doubt Apple will fix this for me. I'm using a 10 year old 
iMac, so stuck on High Sierra. Was hoping for a homemade solution, like 
some way to automate the force quitting of photolibraryd when the Photos 
app is quit.

-- 
K.

Connection closed by foreign host.

[toc] | [prev] | [next] | [standalone]


#125801

Fromgtr <xxx@yyy.zzz>
Date2019-08-16 22:49 -0700
Message-ID<qj84hg$lef$1@news.albasani.net>
In reply to#125800
On 2019-08-17 04:44:31 +0000, Király said:

> Jolly Roger <jollyroger@pobox.com> wrote:
>> It's possible that behavior is due to a bug. It's also possible that
>> Apple hasn't considered this use case (two users sharing the same
>> library on a volume whose ownership & permissions are ignored.
>> 
>> Seems like a great candidate for a bug report.
> 
> Yeah, but I doubt Apple will fix this for me. I'm using a 10 year old
> iMac, so stuck on High Sierra. Was hoping for a homemade solution, like
> some way to automate the force quitting of photolibraryd when the Photos
> app is quit.

I have no idea if it will fix your oddities but sometimes Photos sorts 
out occasional lunacy by rebuilding the library.  I think you hold down 
option while starting the program.  Or maybe it's command.

[toc] | [prev] | [next] | [standalone]


#125808

FromJolly Roger <jollyroger@pobox.com>
Date2019-08-17 17:00 +0000
Message-ID<grqq5eFoonbU1@mid.individual.net>
In reply to#125800
On 2019-08-17, Király <me@home.spamsucks.ca> wrote:
> Jolly Roger <jollyroger@pobox.com> wrote:
>>
>> It's possible that behavior is due to a bug. It's also possible that
>> Apple hasn't considered this use case (two users sharing the same
>> library on a volume whose ownership & permissions are ignored.
>> 
>> Seems like a great candidate for a bug report.
>
> Yeah, but I doubt Apple will fix this for me. I'm using a 10 year old
> iMac, so stuck on High Sierra. Was hoping for a homemade solution,
> like some way to automate the force quitting of photolibraryd when the
> Photos app is quit.

That's easy to do with most scripting languages, including AppleScript.
Put this code into a new Script Editor window and save it as Format:
Application with the Stay open after run handler option enabled. Then
you can run it at login by adding it to your System Preferences > Users
& Groups > Login Items panel:

-- begin script
property waiting : false

on run
	set waiting to false
end run

on idle
	if waiting then
		if not AppIsRunning("Photos") then
			set pid to ProcessIsRunning("photolibraryd")
			if pid is not "" then
				set killResults to do shell script ("kill -9 " & pid as text)
				if killResults is not "" then
					tell application "System Events" to display alert "Potential Error" message ("Kill command returned unexpected results: " & return & return & killResults as text) buttons {"Thanks"} default button 1
				end if
			end if
		end if
	else
		if AppIsRunning("Photos") then
			set waiting to true
		end if
	end if

	return 1
end idle

on AppIsRunning(appName)
	tell application "System Events"
		set isRunning to (appName is in (name of every process))
	end tell
	return isRunning
end AppIsRunning

on ProcessIsRunning(processName)
	set pid to ""
	try
		set pid to do shell script ("pgrep " & processName as text)
	end try
	return pid
end ProcessIsRunning
-- end script

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

[toc] | [prev] | [next] | [standalone]


#125812

Fromme@home.spamsucks.ca (Király)
Date2019-08-17 22:29 +0000
Message-ID<qj9v3h$s56$1@dont-email.me>
In reply to#125808
Jolly Roger <jollyroger@pobox.com> wrote:
> Put this code into a new Script Editor window

Wow Roger, I'm always so impressed by people who know how to write 
Applescripts, and even more impressed when they can whip them up so fast 
to solve a problem for me! Many thanks, I'll try that out.

-- 
K.

Connection closed by foreign host.

[toc] | [prev] | [next] | [standalone]


#125825

FromJolly Roger <jollyroger@pobox.com>
Date2019-08-18 22:40 +0000
Message-ID<gru2euFfn7fU1@mid.individual.net>
In reply to#125812
On 2019-08-17, Király <me@home.spamsucks.ca> wrote:
> Jolly Roger <jollyroger@pobox.com> wrote:
>> Put this code into a new Script Editor window
>
> Wow Roger, I'm always so impressed by people who know how to write
> Applescripts, and even more impressed when they can whip them up so
> fast to solve a problem for me! Many thanks, I'll try that out.

Welcome. : )

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

[toc] | [prev] | [next] | [standalone]


#125887

Fromme@home.spamsucks.ca (Király)
Date2019-08-22 15:34 +0000
Message-ID<qjmclf$me6$1@dont-email.me>
In reply to#125825
Jolly Roger <jollyroger@pobox.com> wrote:
> Welcome. : )

Hi JR,

The script sort of works intermittently. If often fails with this error: 
sh: line 0: kill: 49979
49986: arguments must be process or job IDs

Do you know what's wrong?
Thank you.

-- 
K.

Connection closed by foreign host.

[toc] | [prev] | [next] | [standalone]


#125888

FromJolly Roger <jollyroger@pobox.com>
Date2019-08-22 15:52 +0000
Message-ID<gs7s1mFio16U1@mid.individual.net>
In reply to#125887
On 2019-08-22, Király <me@home.spamsucks.ca> wrote:
> Jolly Roger <jollyroger@pobox.com> wrote:
>> Welcome. : )
>
> Hi JR,
>
> The script sort of works intermittently. If often fails with this error: 
> sh: line 0: kill: 49979
> 49986: arguments must be process or job IDs
>
> Do you know what's wrong?
> Thank you.

It looks like pgrep returned two PIDs, which must mean there are two
photolibraryd processes running at the time. Could it be that Photos was
open in two macOS user accounts at the time?

At any rate, I've modified the script to handle that case by killing
each process in the list:

-- begin script
property waiting : false

on run
	set waiting to false
end run

on idle
	if waiting then
		if not AppIsRunning("Photos") then
			set processIDs to ProcessIsRunning("photolibraryd")
			repeat with nextPID in the paragraphs of processIDs
				if nextPID is not "" then
					set killResults to do shell script ("kill -9 " & nextPID as text)
					if killResults is not "" then
						tell application "System Events" to display alert "Potential Error" message ("Kill command returned unexpected results: " & return & return & killResults as text) buttons {"Thanks"} default button 1
					end if
				end if
			end repeat
		end if
	else
		if AppIsRunning("Photos") then
			set waiting to true
		end if
	end if
	
	return 1
end idle

on AppIsRunning(appName)
	tell application "System Events"
		set isRunning to (appName is in (name of every process))
	end tell
	return isRunning
end AppIsRunning

on ProcessIsRunning(processName)
	set processIDs to ""
	try
		set processIDs to do shell script ("pgrep " & processName as text)
	end try
	return processIDs
end ProcessIsRunning
-- end script

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

[toc] | [prev] | [next] | [standalone]


#125913

Fromgtr <xxx@yyy.zzz>
Date2019-08-22 21:49 -0700
Message-ID<qjnr9h$5m5$1@news.albasani.net>
In reply to#125888
On 2019-08-22 15:52:22 +0000, Jolly Roger said:

> On 2019-08-22, Király <me@home.spamsucks.ca> wrote:
>> Jolly Roger <jollyroger@pobox.com> wrote:
>>> Welcome. : )
>> 
>> Hi JR,
>> 
>> The script sort of works intermittently. If often fails with this error:
>> sh: line 0: kill: 49979
>> 49986: arguments must be process or job IDs
>> 
>> Do you know what's wrong?
>> Thank you.
> 
> It looks like pgrep returned two PIDs, which must mean there are two
> photolibraryd processes running at the time. Could it be that Photos was
> open in two macOS user accounts at the time?
> 
> At any rate, I've modified the script to handle that case by killing
> each process in the list:
> 
> -- begin script
> property waiting : false
> 
> on run
> 	set waiting to false
> end run
> 
> on idle
> 	if waiting then
> 		if not AppIsRunning("Photos") then
> 			set processIDs to ProcessIsRunning("photolibraryd")
> 			repeat with nextPID in the paragraphs of processIDs
> 				if nextPID is not "" then
> 					set killResults to do shell script ("kill -9 " & nextPID as text)
> 					if killResults is not "" then
> 						tell application "System Events" to display alert "Potential 
> Error" message ("Kill command returned unexpected results: " & return & 
> return & killResults as text) buttons {"Thanks"} default button 1
> 					end if
> 				end if
> 			end repeat
> 		end if
> 	else
> 		if AppIsRunning("Photos") then
> 			set waiting to true
> 		end if
> 	end if
> 	
> 	return 1
> end idle
> 
> on AppIsRunning(appName)
> 	tell application "System Events"
> 		set isRunning to (appName is in (name of every process))
> 	end tell
> 	return isRunning
> end AppIsRunning
> 
> on ProcessIsRunning(processName)
> 	set processIDs to ""
> 	try
> 		set processIDs to do shell script ("pgrep " & processName as text)
> 	end try
> 	return processIDs
> end ProcessIsRunning
> -- end script

Many you rock!

[toc] | [prev] | [next] | [standalone]


#125925

FromJolly Roger <jollyroger@pobox.com>
Date2019-08-23 18:31 +0000
Message-ID<gsapoiF7p29U1@mid.individual.net>
In reply to#125913
On 2019-08-23, gtr <xxx@yyy.zzz> wrote:
>
> Man you rock!

Nah! But thanks! : D

One thing I love about AppleScript is how easy it is for someone who
really doesn't know much about software development to understand and
use. On the flip side of that, AppleScript does have significant
idiosyncrasies that tend to complicate things for people who are new to
the language. And knowing how to avoid or work around those potential
issues is often the key to success!

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

[toc] | [prev] | [next] | [standalone]


#125941

Fromgtr <xxx@yyy.zzz>
Date2019-08-23 17:39 -0700
Message-ID<qjq0vm$s4$1@news.albasani.net>
In reply to#125925
On 2019-08-23 18:31:47 +0000, Jolly Roger said:

> On 2019-08-23, gtr <xxx@yyy.zzz> wrote:
>> 
>> Man you rock!
> 
> Nah! But thanks! : D
> 
> One thing I love about AppleScript is how easy it is for someone who
> really doesn't know much about software development to understand and
> use. On the flip side of that, AppleScript does have significant
> idiosyncrasies that tend to complicate things for people who are new to
> the language. And knowing how to avoid or work around those potential
> issues is often the key to success!

I'm sure that's true.  I've bought a few books on AppleScript over the 
years, and malingered in the earlier chapters.  I've then usually found 
a way to avoid it with utilties of one kind or another.

In fact, I've been wanting to sit down and write some AScripts to help 
hot-key Apple's Numbers application for simple things like "Add Line 
Below" and such.  When gathering ammo for a first pass, I recently saw 
that the program has now added drop-down entries, making it feasible 
for me to simply use Keyboard Maestro.

Saved again!

[toc] | [prev] | [next] | [standalone]


#125948

FromJolly Roger <jollyroger@pobox.com>
Date2019-08-24 19:27 +0000
Message-ID<gsdhcpFppvqU2@mid.individual.net>
In reply to#125941
On 2019-08-24, gtr <xxx@yyy.zzz> wrote:
> On 2019-08-23 18:31:47 +0000, Jolly Roger said:
>> On 2019-08-23, gtr <xxx@yyy.zzz> wrote:
>>> 
>>> Man you rock!
>> 
>> Nah! But thanks! : D
>> 
>> One thing I love about AppleScript is how easy it is for someone who
>> really doesn't know much about software development to understand and
>> use. On the flip side of that, AppleScript does have significant
>> idiosyncrasies that tend to complicate things for people who are new
>> to the language. And knowing how to avoid or work around those
>> potential issues is often the key to success!
>
> I'm sure that's true.  I've bought a few books on AppleScript over the
> years, and malingered in the earlier chapters.  I've then usually
> found a way to avoid it with utilties of one kind or another.
>
> In fact, I've been wanting to sit down and write some AScripts to help
> hot-key Apple's Numbers application for simple things like "Add Line
> Below" and such.  When gathering ammo for a first pass, I recently saw
> that the program has now added drop-down entries, making it feasible
> for me to simply use Keyboard Maestro.
>
> Saved again!

The problem with using a macro utility to automate mouse clicks, key
presses, and so on is you have to avoid doing anything with the device
or you'll screw up the macro and those clicks and key presses will be
misplaced. The nice thing about AppleScript is generally rather than
controlling the user interface, you're sending commands directly to the
app in question, which means it doesn't matter what the user is doing at
the time with the mouse or keyboard. In some cases, though, like when an
app doesn't support a command to do what you want, user interface
automation is the only way to get it done. 

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

[toc] | [prev] | [next] | [standalone]


#126005

Fromme@home.spamsucks.ca (Király)
Date2019-08-26 15:41 +0000
Message-ID<qk0ujn$a2g$1@dont-email.me>
In reply to#125925
Jolly Roger <jollyroger@pobox.com> wrote:
> Nah! But thanks! : D

You do rock, JR!
But there's another bug. While the script is running and I quit Photos, 
it fails with this error"

sh: line 0: kill: (70034) - Operation not permitted

Many thanks for all your generous expert help so far.

-- 
K.

Connection closed by foreign host.

[toc] | [prev] | [next] | [standalone]


#126053

FromJolly Roger <jollyroger@pobox.com>
Date2019-08-27 23:09 +0000
Message-ID<gslrh5Fk0lfU1@mid.individual.net>
In reply to#126005
On 2019-08-26, Király <me@home.spamsucks.ca> wrote:
> Jolly Roger <jollyroger@pobox.com> wrote:
>> Nah! But thanks! : D
>
> You do rock, JR!
> But there's another bug. While the script is running and I quit Photos, 
> it fails with this error"
>
> sh: line 0: kill: (70034) - Operation not permitted
>
> Many thanks for all your generous expert help so far.

I'm betting that's because the process isn't owned by you. The next time
you see that error, find out more about the process by doing a "ps au
PID" (where PID is the process ID in the message). 

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.mac.system


csiph-web