Nasty side effect

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Nasty side effect

Tobias Pape
Hi all

here's a nasty side effect of our way of ensuring that the heartbeat-thread thing works.
        https://github.com/dalehenrich/metacello-work/issues/427#issuecomment-281919088

TL;DR:
        (1) Run squeak w/ superuser/root rights creates the 'package-cache' directory as root
        (2) Installing something with monticello then _SILENTLY_ fails

Both is bad.
So, (1) is hard to fix. I would have said, hey, if we are root, just _don't_ run squeak but just create the heartbeat files.
But that makes no sense when we actually want to run squeak as root.

SUGGESTION:
        - Do not ship heartbeat vm in the all in one[1]
        - Ship the heartbeat vm only in system packages[2]
        - Fix handling File-open failures.

I'm onto (2), and frankly, I was surprised to learn that:

        squeak-dir$ mkdir foo
        squeak-dir$ chmod -w foo

and then
        (FileDirectory default / 'foo') newFileNamed: 'bar'. "==> nil"

this Must Not happen.

To many to-dos in one mail, I know :(

Best regards
        -Tobias


[1]: Yes, I know, performance is bad then, but the user experience is badder [sic]. That is a hard-to-cope-with tradeoff.
[2]: Wich means, that we eventually, finally, have to package debs and rpms, I'd say.

Reply | Threaded
Open this post in threaded view
|

Re: Nasty side effect

Jakob Reschke-2
2017-02-23 10:08 GMT+01:00 Tobias Pape <[hidden email]>:
> I'm onto (2), and frankly, I was surprised to learn that:
>
>         squeak-dir$ mkdir foo
>         squeak-dir$ chmod -w foo
>
> and then
>         (FileDirectory default / 'foo') newFileNamed: 'bar'. "==> nil"
>
> this Must Not happen.

What do you expect instead, an Exception? In StandardFileStream
open:forWrite: it reads

    fileID ifNil: [^ nil].  "allows sender to detect failure"

which means some indirect senders do not seem to pay attention properly.

Reply | Threaded
Open this post in threaded view
|

Re: Nasty side effect

Tobias Pape

On 23.02.2017, at 12:25, Jakob Reschke <[hidden email]> wrote:

> 2017-02-23 10:08 GMT+01:00 Tobias Pape <[hidden email]>:
>> I'm onto (2), and frankly, I was surprised to learn that:
>>
>>        squeak-dir$ mkdir foo
>>        squeak-dir$ chmod -w foo
>>
>> and then
>>        (FileDirectory default / 'foo') newFileNamed: 'bar'. "==> nil"
>>
>> this Must Not happen.
>
> What do you expect instead, an Exception? In StandardFileStream
> open:forWrite: it reads
>
>    fileID ifNil: [^ nil].  "allows sender to detect failure"
>
> which means some indirect senders do not seem to pay attention properly.
>

All of them…


Reply | Threaded
Open this post in threaded view
|

Re: Nasty side effect

David T. Lewis
In reply to this post by Tobias Pape
On Thu, Feb 23, 2017 at 10:08:11AM +0100, Tobias Pape wrote:

> Hi all
>
> here's a nasty side effect of our way of ensuring that the heartbeat-thread thing works.
> https://github.com/dalehenrich/metacello-work/issues/427#issuecomment-281919088
>
> TL;DR:
> (1) Run squeak w/ superuser/root rights creates the 'package-cache' directory as root
> (2) Installing something with monticello then _SILENTLY_ fails
>
> Both is bad.
> So, (1) is hard to fix. I would have said, hey, if we are root, just _don't_ run squeak but just create the heartbeat files.
> But that makes no sense when we actually want to run squeak as root.

Requiring that Squeak be run as root should be considered unacceptable. Period. Full Stop.

Dave


Reply | Threaded
Open this post in threaded view
|

Re: Nasty side effect

Tobias Pape

On 23.02.2017, at 13:11, David T. Lewis <[hidden email]> wrote:

> On Thu, Feb 23, 2017 at 10:08:11AM +0100, Tobias Pape wrote:
>> Hi all
>>
>> here's a nasty side effect of our way of ensuring that the heartbeat-thread thing works.
>> https://github.com/dalehenrich/metacello-work/issues/427#issuecomment-281919088
>>
>> TL;DR:
>> (1) Run squeak w/ superuser/root rights creates the 'package-cache' directory as root
>> (2) Installing something with monticello then _SILENTLY_ fails
>>
>> Both is bad.
>> So, (1) is hard to fix. I would have said, hey, if we are root, just _don't_ run squeak but just create the heartbeat files.
>> But that makes no sense when we actually want to run squeak as root.
>
> Requiring that Squeak be run as root should be considered unacceptable. Period. Full Stop.

It's not required, but people may be misguided to think it should:

        https://github.com/squeak-smalltalk/squeak-app/blob/master/templates/all-in-one/squeak.sh#L73

or simply running it with sudo once, why-so-ever …


>
> Dave
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Nasty side effect

Ben Coman


On Thu, Feb 23, 2017 at 8:40 PM, Tobias Pape <[hidden email]> wrote:

On 23.02.2017, at 13:11, David T. Lewis <[hidden email]> wrote:

> On Thu, Feb 23, 2017 at 10:08:11AM +0100, Tobias Pape wrote:
>> Hi all
>>
>> here's a nasty side effect of our way of ensuring that the heartbeat-thread thing works.
>>      https://github.com/dalehenrich/metacello-work/issues/427#issuecomment-281919088
>>
>> TL;DR:
>>      (1) Run squeak w/ superuser/root rights creates the 'package-cache' directory as root
>>      (2) Installing something with monticello then _SILENTLY_ fails
>>
>> Both is bad.
>> So, (1) is hard to fix. I would have said, hey, if we are root, just _don't_ run squeak but just create the heartbeat files.
>> But that makes no sense when we actually want to run squeak as root.
>
> Requiring that Squeak be run as root should be considered unacceptable. Period. Full Stop.

It's not required, but people may be misguided to think it should:

        https://github.com/squeak-smalltalk/squeak-app/blob/master/templates/all-in-one/squeak.sh#L73

or simply running it with sudo once, why-so-ever …

As a sys admin you might write a tool to de-duplicate files for multiple users. 
(though probably not a common use case)

cheers -ben