Uploaded image for project: 'Chukwa'
  1. Chukwa
  2. CHUKWA-630

Chukwa's RPM should create the user 'chukwa' before installation

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.4.0
    • Fix Version/s: 0.6.0
    • Component/s: Build and Test Code
    • Labels:
    • Environment:

      Redhat, RPM based

      Description

      Chukwa's RPM, as built with 'ant rpm', sets the ownership of all files to user 'chukwa', but it does not create this user before installation. The rpm should create user 'chukwa' before installation and it should remove the user when the package is un-installed.

        Activity

        Hide
        noelduffy Noel Duffy added a comment -

        Patch to make the chukwa rpm create a new user called 'chukwa' upon installation and remove it when the rpm is uninstalled.

        Show
        noelduffy Noel Duffy added a comment - Patch to make the chukwa rpm create a new user called 'chukwa' upon installation and remove it when the rpm is uninstalled.
        Hide
        noelduffy Noel Duffy added a comment -

        Stupid patch submission dialog has no place to actually put the friggin patch.

        Show
        noelduffy Noel Duffy added a comment - Stupid patch submission dialog has no place to actually put the friggin patch.
        Hide
        noelduffy Noel Duffy added a comment -

        This small patch updates the RPM spec file to create a new user 'chukwa' when the RPM is installed and to remove it when the rpm is uninstalled.

        Show
        noelduffy Noel Duffy added a comment - This small patch updates the RPM spec file to create a new user 'chukwa' when the RPM is installed and to remove it when the rpm is uninstalled.
        Hide
        noelduffy Noel Duffy added a comment -

        I've written a small patch to add the new user, 'chukwa', when the rpm is installed. It will remove the user when the rpm is uninstalled.

        Per feedback from Eric Yang on chukwa-users, the useradd call has been modified as follows:

        • Long form of some useradd switches used for readability.
        • -r switch added, so that the chukwa user's uid will be in the system range, that is, below 500.
        • The command does not return an error if the rpm is being upgraded.

        Changes that I haven't made, and the reason:

        • -u 210. Does Chukwa need to select a specific uid? How should we handle that uid being already in use?
        • --shell /bin/bash. Does Chukwa need a Bash shell? I would expect system accounts to not have valid shells.
        • -M Not necessary. If -r is used, useradd will not create a home directory, regardless of login.defs, unless -m is given.
        • -g hadoop. Does Chukwa need to be group hadoop? The user hadoop won't exist on most agent nodes, I would expect. On collectors, maybe.

        Given the triviality of the patch, a prolonged argument isn't in anyone's interests, so if you think these should just be done, I will happily do so.

        Show
        noelduffy Noel Duffy added a comment - I've written a small patch to add the new user, 'chukwa', when the rpm is installed. It will remove the user when the rpm is uninstalled. Per feedback from Eric Yang on chukwa-users, the useradd call has been modified as follows: Long form of some useradd switches used for readability. -r switch added, so that the chukwa user's uid will be in the system range, that is, below 500. The command does not return an error if the rpm is being upgraded. Changes that I haven't made, and the reason: -u 210. Does Chukwa need to select a specific uid? How should we handle that uid being already in use? --shell /bin/bash. Does Chukwa need a Bash shell? I would expect system accounts to not have valid shells. -M Not necessary. If -r is used, useradd will not create a home directory, regardless of login.defs, unless -m is given. -g hadoop. Does Chukwa need to be group hadoop? The user hadoop won't exist on most agent nodes, I would expect. On collectors, maybe. Given the triviality of the patch, a prolonged argument isn't in anyone's interests, so if you think these should just be done, I will happily do so.
        Hide
        eyang Eric Yang added a comment -

        The intent to use fixed uid as a work around to ensure that we don't accidentally use the same uid as populated from central LDAP server. The conflict of uid may cause another user to have the same rights as the chukwa user.

        I am fine with leaving out --shell -g hadoop and -M.

        Show
        eyang Eric Yang added a comment - The intent to use fixed uid as a work around to ensure that we don't accidentally use the same uid as populated from central LDAP server. The conflict of uid may cause another user to have the same rights as the chukwa user. I am fine with leaving out --shell -g hadoop and -M.
        Hide
        noelduffy Noel Duffy added a comment -

        Updated patch to add -u 210.

        Show
        noelduffy Noel Duffy added a comment - Updated patch to add -u 210.
        Hide
        eyang Eric Yang added a comment -

        +1 Looks good

        Show
        eyang Eric Yang added a comment - +1 Looks good
        Hide
        eyang Eric Yang added a comment -

        I just committed this, thanks Noel.

        Show
        eyang Eric Yang added a comment - I just committed this, thanks Noel.

          People

          • Assignee:
            noelduffy Noel Duffy
            Reporter:
            noelduffy Noel Duffy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development