LibrePhotos / librephotos-linux

Here you can find the installation script for a local Linux install.
MIT License
47 stars 15 forks source link

Install script fails silently when home directory does not exist #25

Closed derneuere closed 2 years ago

derneuere commented 3 years ago

When I cleaned up after the early failures I deleted directory /usr/lib/librephotos but not the corresponding linux username, so on the subsequent runs the installer script failed silently because the home directory of user librephotos didn't exist. I suggest something like adding

[ -d /usr/lib/librephotos ] || mkdir -p /usr/lib/librephotos/ chown -R librephotos:librephotos /usr/lib/librephotos/ before id -u librephotos > /dev/null || useradd --home-dir /usr/lib/librephotos --comment "librephotos user" -g librephotos -mr -s /usr/sbin/nologin librephotos so that if the user exists but not the home directory it can be recreated.

Also why not have a USRLIB_DIR variable defaulted to /user/lib/librephotos and then use that everywhere instead as it would enable this to be reconfigured if necessary.