Re: [Pharo-dev] [Pharo-users] Pharo6 server deployment and no home directory
On 8. Jun 2017, at 23:16, Holger Freyther <holger@freyther.de> wrote:
Hey Juraj!
Hey! this will most likely block more people trying to deploy a headless Pharo6 image but I am not so sure how to properly fix it.
$ unset HOME $ pharo ... Error: Can't find the requested origin ...
UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:
$HOME is not set so cantFindOriginError will be executed.
UnixResolver>>home [ self home / '.config' ] in UnixResolver>>preferences in Block: [ self home / '.config' ]
XDG_CONFIG_DIR can not be found and then "self home" will be executed...
FileLocator(AbstractFileReference)>>exists
(FileLocator preferences / '.config' / ...) resolve exists a.) Behave like unix and resolve $HOME to '' $ unset HOME $ echo $HOME/.config /.config self home / '.config' => '/.config' b.) FileLocator>>#exists If something can not be resolved, one can argue that it doesn't exist? So I wonder if the exception should be catched and false be returned? c.) ??? I don't see an obvious/good approach. Do you? holger
On 9. Jun 2017, at 11:09, Holger Freyther <holger@freyther.de> wrote:
a.) Behave like unix and resolve $HOME to ''
$ unset HOME $ echo $HOME/.config /.config
self home / '.config' => '/.config'
Implementing UnixResolver>>#home as home ^ self directoryFromEnvVariableNamed: 'HOME' or: [self resolveString: ''] will lead to something creating /.config/pharo (if possible). By itself this change is not good enough but when adding --no-default-preferences. Comments? Opinions? holger
Why would $HOME not be set ? And if it is not set / seems like a reasonable default.
On 9 Jun 2017, at 06:06, Holger Freyther <holger@freyther.de> wrote:
On 9. Jun 2017, at 11:09, Holger Freyther <holger@freyther.de> wrote:
a.) Behave like unix and resolve $HOME to ''
$ unset HOME $ echo $HOME/.config /.config
self home / '.config' => '/.config'
Implementing UnixResolver>>#home as
home ^ self directoryFromEnvVariableNamed: 'HOME' or: [self resolveString: '']
will lead to something creating /.config/pharo (if possible). By itself this change is not good enough but when adding --no-default-preferences.
Comments? Opinions?
holger
On 9. Jun 2017, at 13:26, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Hey,
Why would $HOME not be set ?
In this specific case runit doesn't export HOME when starting my service but looking at systemd and picking a random service like exim4.service I see: $ strings /proc/946/environ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin LANG=C _SYSTEMCTL_SKIP_REDIRECT=true PWD=/ I think it is safe to assume this applies to other services started by systemd as well.
And if it is not set / seems like a reasonable default.
In Shell it would be "" but with >>resolveString: '' it seems to be / but that seems to be fair enough. E.g. as {home} / '.config' is used anyway. holger
participants (2)
-
Holger Freyther -
Sven Van Caekenberghe