VirtualBox

Changeset 56842 in vbox for trunk/src/VBox/Installer


Ignore:
Timestamp:
Jul 7, 2015 3:36:24 PM (10 years ago)
Author:
vboxsync
Message:

Installers/linux: do not depend on non-standard init script verbs.

Location:
trunk/src/VBox/Installer/linux
Files:
3 edited

Legend:

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

    r56777 r56842  
    376376
    377377    # Install runlevel scripts
    378     # Note: vboxdrv is also handled by setup_init_script. This function will
    379     #       use chkconfig to adjust the sequence numbers, therefore vboxdrv
    380     #       numbers here should match the numbers in the vboxdrv.sh check
    381     #       header!
    382378    install_init_script vboxdrv.sh vboxdrv
    383379    install_init_script vboxballoonctrl-service.sh vboxballoonctrl-service
     
    480476        cur=`pwd`
    481477        log ""
    482         setup_init_script vboxdrv
     478        ./vboxdrv.sh setup
    483479        # Start VirtualBox kernel module
    484480        if [ $RETVAL -eq 0 ] && ! start_init_script vboxdrv; then
  • trunk/src/VBox/Installer/linux/routines.sh

    r56777 r56842  
    239239    ## The action to perform, normally "start", "stop" or "status".
    240240    action="${2}"
    241     ## The optional expression to check for in the script before starting.
    242     expression="${3}"
    243241    test ! -z "${name}" && test ! -z "${action}" || \
    244242        { log "${self}: missing argument" && return 1; }
     
    253251        return 1
    254252    fi
    255     test -n "${expression}" && ! grep -q "${expression}" "${script}" && return 0
    256     case "${action}" in
    257     start|stop|reload|restart|try-restart|force-reload|status)
    258         if test -x "`which service 2>/dev/null`"
    259         then
    260             service "${name}" ${action}
    261         elif test -x "`which invoke-rc.d 2>/dev/null`"
    262         then
    263             invoke-rc.d "${name}" ${action}
    264         else
    265             "${script}" "${action}"
    266         fi
    267         ;;
    268     *)
     253    if test -x "`which service 2>/dev/null`"
     254    then
     255        service "${name}" ${action}
     256    elif test -x "`which invoke-rc.d 2>/dev/null`"
     257    then
     258        invoke-rc.d "${name}" ${action}
     259    else
    269260        "${script}" "${action}"
    270         ;;
    271     esac
     261    fi
    272262}
    273263
     
    282272{
    283273    do_sysvinit_action "${1}" stop
    284 }
    285 
    286 ## Do initial setup of an installed service
    287 setup_init_script()
    288 {
    289     do_sysvinit_action "${1}" setup '^# *setup_script *$'
    290 }
    291 
    292 ## Do pre-removal cleanup of an installed service
    293 cleanup_init_script()
    294 {
    295     do_sysvinit_action "${1}" cleanup '^# *cleanup_script *$'
    296274}
    297275
  • trunk/src/VBox/Installer/linux/run-inst.sh

    r56777 r56842  
    151151    for i in $UNINSTALL_SCRIPTS; do
    152152        stop_init_script "$i"
    153         cleanup_init_script "$i" 1>&2 2>> "$LOGFILE"
    154         test -x "./$i" && "./$i" cleanup 1>&2 2>> "$LOGFILE"
     153        test -z "$NO_CLEANUP" && test -x "./$i" && "./$i" cleanup 1>&2 2>> "$LOGFILE"
    155154        delrunlevel "$i"
    156155        remove_init_script "$i"
     156    done
     157    for i in "/opt/$PACKAGE-"*/init/*; do
     158      test -z "$NO_CLEANUP" && grep -q '^# *cleanup_script *$' "${i}" && "${i}" cleanup 1>&2 2>> "$LOGFILE"
    157159    done
    158160
     
    421423    install_init_script "$i" "`basename "$i"`"
    422424    addrunlevel "`basename "$i"`"
    423     test -n "$DO_SETUP" && setup_init_script "`basename "$i"`" 1>&2
     425    test -n "$DO_SETUP" && grep -q '^# *setup_script *$' "${i}" && "${i}" setup 1>&2
    424426    start_init_script "`basename "$i"`"
    425427  fi
     
    461463    if test -r "\$i"; then
    462464        stop_init_script "\`basename "\$i"\`"
    463         test -z "\$NO_CLEANUP" && cleanup_init_script "\`basename "\$i"\`" 2>> "\$LOGFILE"
     465        test -z "\${NO_CLEANUP}" && grep -q '^# *cleanup_script *$' "\${i}" && "\${i}" cleanup 2>> "\$LOGFILE"
    464466        delrunlevel "\`basename "\$i"\`"
    465467        remove_init_script "\`basename "\$i"\`"
Note: See TracChangeset for help on using the changeset viewer.

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