~benji/landscape-client/bug-1548946-xenial-test-segfault

« back to all changes in this revision

Viewing changes to debian/landscape-client.postinst

Merge bug-1546743-postinst-creates-file-in-non-existent-directory [f=1546743] [r=adam-collard,bogdana] [a=Benji York]
This branch fixes bug 1546743 which affects fresh client installs.

The client postinst script was attempting to create a file in the data
directory, but that directory is created by the client itself so if
the client had never been run before, the file creation would fail.

This branch modifies the postinst script to create the directory if
needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
        # user information.  The flag file will be removed by the client when
124
124
        # the update completes.
125
125
        DATA_PATH="`grep ^data_path /etc/landscape/client.conf | cut -d= -f2 | tr -d '[[:space:]]'`"
 
126
        install --owner=landscape --directory $DATA_PATH
126
127
        USER_UPDATE_FLAG_FILE="$DATA_PATH/user-update-flag"
 
128
        install --owner=landscape /dev/null $USER_UPDATE_FLAG_FILE
127
129
        echo "This file indicates that the Landscape client needs to send updated user information to the server." >> $USER_UPDATE_FLAG_FILE
128
 
        chown landscape $USER_UPDATE_FLAG_FILE
129
130
    ;;
130
131
 
131
132
    abort-upgrade|abort-remove|abort-deconfigure)