postinst script fails if data_path not set in client.conf

Bug #1728681 reported by Kellen Renshaw on 2017-10-30
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
landscape-client (Ubuntu)

Bug Description

Tested on 14.04.5, landscape-client (14.12-0ubuntu6.14.04).

If the data_path directive is not present in /etc/landscape/client.conf, the postinst script will fail with the following error:
Setting up landscape-client (14.12-0ubuntu6.14.04) ...
install: missing file operand
Try 'install --help' for more information.
dpkg: error processing package landscape-client (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Relevant section of the postinst script:
 # In response to bug 1508110 we need to trigger a complete update of
        # user information. The flag file will be removed by the client when
        # the update completes.
        DATA_PATH="`grep ^data_path /etc/landscape/client.conf | cut -d= -f2 | tr -d '[[:space:]]'`"
        install --owner=landscape --directory $DATA_PATH
        install --owner=landscape /dev/null $USER_UPDATE_FLAG_FILE

It would be helpful if the script checked for data_path's existence and emitted a more informative error message.

How to reproduce:

Install/configure/register landscape-client.
Remove landscape-client
Remove data_path from /etc/landscape/client.conf
Reinstall landscape-client.

Tags: sts Edit Tag help
tags: added: sts
Andreas Hasenack (ahasenack) wrote :

Do you have any idea how the config file ended up missing that configuration key? Just trying to gauge how frequent this is (hint: it's the fist time I saw this)

Kellen Renshaw (krenshaw) wrote :

Hello Andreas,

Currently, I suspect that it was removed (on purpose or not) manually. My default client.conf contains it. I will attempt to get more information on how/why that change was made.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers