[Bug 1372051] Re: ntp postinst user/group add commands are not idempotent

Ryan Harper 1372051 at bugs.launchpad.net
Wed Aug 5 17:24:39 UTC 2015


addgroup is a perl script, so you can inspect it to see what's going on.
You can get additional information about the error running with:

sudo VERBOSE=1 addgroup --system ntp

I think what we're seeing is that your ntp group is a user group (gid >=
1000) instead of a system group (gid < 1000).

>From your output above, it looks like you're hitting this logic:


if ($action eq "addsysgroup") {

    # Check if requested group already exists and we can exit safely
    my $ret = existing_group_ok($new_name, $new_gid);

    if ($ret == 3) {
        print STDERR "$0: " if $verbose;
        printf STDERR (gtx("The group `%s' already exists as a system group. Exiting.\n"), $new_name) if $verbose;
        exit RET_OK;
    }

    if ($ret == 1) {
        print STDERR "$0: " if $verbose;
        printf STDERR (gtx("The group `%s' already exists and is not a system group. Exiting.\n"), $new_name) if $verbose;
        exit RET_OBJECT_ALREADY_EXISTS;
    }


So, you're exiting 1 due to the gid of group ntp being > 1000.  The fix here would be to apt-get remove --purge ntp ; the --purge flag will trigger the ntp.postrm script to remove the group first.  Then when you re-install, it will install the ntp group with --system flag and allocate a GID under <1000.

See if that helps you moving forward.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1372051

Title:
  ntp postinst user/group add commands are not idempotent

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ntp/+bug/1372051/+subscriptions



More information about the Ubuntu-server-bugs mailing list