@@ -195,7 +195,12 @@ def _check_user_scratch_subdir(self, path: Path) -> Path | None:
195
195
if not user :
196
196
self ._logger .warning ("Could not determine user from environment" )
197
197
return None
198
+ schema = self ._env .get ("HOMEDIR_SCHEMA" , "username" )
198
199
user_scratch_path = scratch_path / user / path
200
+ # This is pretty ad-hoc, but USDF uses the first letter in the
201
+ # username for both home and scratch
202
+ if schema == "initialThenUsername" :
203
+ user_scratch_path = scratch_path / user [0 ] / user / path
199
204
try :
200
205
user_scratch_path .mkdir (parents = True , exist_ok = True , mode = 0o700 )
201
206
except OSError as exc :
@@ -651,8 +656,13 @@ def _launch(self) -> None:
651
656
652
657
def _modify_interactive_settings (self ) -> None :
653
658
self ._logger .debug ("Modifying interactive settings if needed" )
654
- self ._manage_access_token ()
655
- self ._increase_log_limit ()
659
+ # These both write files; if either fails, start up but warn
660
+ # the user their experience is likely to be bad.
661
+ try :
662
+ self ._manage_access_token ()
663
+ self ._increase_log_limit ()
664
+ except OSError as exc :
665
+ self ._set_abnormal_startup (exc )
656
666
657
667
def _increase_log_limit (self ) -> None :
658
668
self ._logger .debug ("Increasing log limit if needed" )
0 commit comments