VirtualBox

Ignore:
Timestamp:
Dec 13, 2012 1:31:33 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
82685
Message:

Installer/linux: updated install_service.sh to work with OpenRC and fixed the test case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/install_service/install_service.sh

    r44094 r44119  
    175175for path in "${PREFIX}/init.d/rc.d" "${PREFIX}/init.d/" "${PREFIX}/rc.d/init.d" "${PREFIX}/rc.d"; do
    176176    if test -d "${path}"; then
     177        # Check permissions for the init path.
    177178        test -w "${path}" || abort "No permission to write to \"${path}\"."
     179        # And for the System V symlink directories.
    178180        for i in rc0.d rc1.d rc6.d rc.d/rc0.d rc.d/rc1.d rc.d/rc6.d; do
    179181            if test -d "${PREFIX}/${i}"; then
    180182                test -w "${PREFIX}/${i}" ||
    181                     abort "No permission to write to \"${PREFIX}/${i}\"".
     183                    abort "No permission to write to \"${PREFIX}/${i}\"."
    182184            fi
    183185        done
     186        # And for the OpenRC symlink directories.
     187        if test -d "${PREFIX}/runlevel/"; then
     188            test -w "${PREFIX}/runlevel/" ||
     189                abort "No permission to write to \"${PREFIX}/runlevel\"".
     190        fi
    184191        found_init="true"
    185192        update=""
     
    197204            # Various known combinations of sysvinit rc directories.
    198205            for i in "${PREFIX}"/rc*.d/[KS]??"${SERVICE_NAME}" "${PREFIX}"/rc.d/rc*.d/[KS]??"${SERVICE_NAME}"; do
    199                 rm -f "$i"
     206                rm -f "${i}"
    200207            done
    201208            # And OpenRC.
    202             type rc-update > /dev/null 2>&1 &&
    203                 rc-update del "${1}" > /dev/null 2>&1
     209            test -d "${PREFIX}/runlevel/" &&
     210                for i in "/${PREFIX}/runlevel"/*/"${SERVICE_NAME}"; do
     211                    rm -f "${i}"
     212                done
    204213            # Various known combinations of sysvinit rc directories.
    205214            if test -n "${ENABLE}"; then
     
    219228                done
    220229                # And OpenRC.
    221                 type rc-update > /dev/null 2>&1 &&
    222                     rc-update add "${1}" default > /dev/null 2>&1
     230                test -d "${PREFIX}/runlevel/default" &&
     231                    ln -sf "${path}/${SERVICE_NAME}" "/${PREFIX}/runlevel/default/"
    223232            fi
    224233        fi
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette