3

I would like to mount /Users to /home on my macbook (Catalina Version 10.15.6).

I have three systems: an Ubuntu laptop, a rhel server and a macbook. I have some python scripts (written by others) that uses configuration files where full file paths need to be mentioned (no ~). I don't like changing the home path in the scripts from /Users/x to /home/x multiple times.

There's this question on SO about the same thing but three years have passed and I wonder if anything has changed. The person who wrote the accepted answer himself recommend doing something else and I can not do that. I am genuinely concerned about two things:

  1. Automatic back up of this folder.
  2. Will a system update wipe this folder out?
rivu
  • 133
  • 2
    Related https://apple.stackexchange.com/questions/195441/how-to-remove-home-directory?rq=1, https://apple.stackexchange.com/questions/10445/what-is-the-function-of-home-in-snow-leopard, https://apple.stackexchange.com/questions/88797/how-to-execute-mkdir-in-home-directory – nohillside Sep 24 '20 at 12:15
  • 3
    scripts should not have /home/x as the home directory for user x. It is not a standard - For most of my 30 years of Unix most systems were elsewhere and could differ in the same organisation. There is a standard though use $HOME for the current user or ~x for user x , if not using Bourne shell. – mmmmmm Sep 24 '20 at 12:16
  • There is no script, there are config files that are used by some python codes. – rivu Sep 24 '20 at 12:19
  • In any case, I don't have control over the codes – rivu Sep 24 '20 at 12:20

1 Answers1

3

Personally I'm convinced that any software requiring hard coded paths to home directories is broken and needs to be fixed, but I understand that this isn't possible sometimes. So in your situation I would just disable the auto mounter for /home (see How to remove '/home' directory?) and then symlink /home to /Users. This also solves the backup issue.

PS: Biggest risk probably is that a future update will rewrite auto_master but that you can easily fix again.

nohillside
  • 100,768
  • 1
    Seems you can not just create a symlink sudo ln -s /Users/ /home returns ln: /home: Read-only file system. I think you have to disable SIP https://apple.stackexchange.com/questions/208478/how-do-i-disable-system-integrity-protection-sip-aka-rootless-on-macos-os-x . – rivu Sep 25 '20 at 09:42
  • @rivu Uhh, with SIP and Catalina this may become a challenge anyway. – nohillside Sep 25 '20 at 09:50