Skip to content

Commit

Permalink
Create the parent directory of the home directory before calling mkho…
Browse files Browse the repository at this point in the history
…medir_helper

The tool fails with exit code 6 if the top-level directory does not exist yet.

    (a39bc32231c8)root@c71fe951b480:/# getent passwd johannes
    johannes:x:1000006:1000:Johannes Meyer:/share/homes/johannes:/bin/bash
    (a39bc32231c8)root@a39bc32231c8:/# rm share -R
    (a39bc32231c8)root@a39bc32231c8:/# mkhomedir_helper johannes; echo $?
    6
    (a39bc32231c8)root@a39bc32231c8:/# mkdir share
    (a39bc32231c8)root@a39bc32231c8:/# mkhomedir_helper johannes; echo $?
    0
  • Loading branch information
meyerj committed Oct 30, 2020
1 parent fdb464c commit 8cee014
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rocker/templates/user_snippet.Dockerfile.em
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN existing_user_by_uid=`getent passwd "@(uid)" | cut -f1 -d: || true` && \

@[if not home_extension_active ]@
# Making sure a home directory exists if we haven't mounted the user's home directory explicitly
RUN mkhomedir_helper @(name)
RUN mkdir -p "$(dirname "@(dir)")" && mkhomedir_helper @(name)
@[end if]@
# Commands below run as the developer user
USER @(name)
Expand Down

0 comments on commit 8cee014

Please sign in to comment.