WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Service names ending in d that differ to the package name are not supported when using RPM. #140

@ximon18

Description

@ximon18

The Ploutos code contains the following:

            if [ -e "${SYSTEMD_SERVICE_UNIT_FILE}" ]; then
                mkdir -p ${TARGET_DIR}/rpm/
                cp ${SYSTEMD_SERVICE_UNIT_FILE} ${TARGET_DIR}/rpm/${MATRIX_PKG}.service
            elif [[ "${SYSTEMD_SERVICE_UNIT_FILE}" == *"*" ]]; then
                mkdir -p ${TARGET_DIR}/rpm/
                cp ${SYSTEMD_SERVICE_UNIT_FILE} ${TARGET_DIR}/rpm
            fi

The if branch wrongly assumes that ${MATRIX_PKG} is the correct name for the service file, and for a service like krill this works fine, the service and package name match, but for cascade the service is called cascaded and the above logic causes the destination service file to have the wrong name.

What needs to happen here is that the RPM SystemD unit handling (which is not present in cargo-generate-rpm like it is in cargo-deb) needs to parse the unit file name based on the rules defined at https://github.com/kornelski/cargo-deb/blob/main/systemd.md#systemd-unit-file-naming.

I.e. given:

  • <package>.<unit>.<script> - only if unit-name is specified
  • <package>.<script>
  • <unit>.<script> - only if unit-name is specified
  • <script>

If <unit> exists in the name, use the name and strip out any <package> that is present.

If <unit> does NOT exist in the name use the filename as-is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions