Restart script doesn't get executed

Discussion in 'Spigot Help' started by illuminator3, Feb 10, 2020.

  1. Soo my problem is if I restart the server (/restart) my restart.sh script should be executed, as I set it in the spigot.yml, but it's not. My spigot.yml:

    Code (YAML):
    # This is the main configuration file for Spigot.
    # As you can see, there's tons to configure. Some options may impact gameplay, so use
    # with caution, and make sure you know what each option does before configuring.
    # For a reference for any variable inside this file, check out the Spigot wiki at
    # http://www.spigotmc.org/wiki/spigot-configuration/
    #
    # If you need help with the configuration or have any questions related to Spigot,
    # join us at the IRC or drop by our forums and leave a post.
    #
    # IRC: #spigot @ irc.spi.gt ( http://www.spigotmc.org/pages/irc/ )
    # Forums: http://www.spigotmc.org/

    config-version
    : 8
    messages
    :
      whitelist
    : You are not whitelisted on this server!
      unknown-command
    : Unknown command. Type "/help" for help.
      server-full
    : The server is full!
      outdated-client
    : Outdated client! Please use {0}
      outdated-server
    : Outdated server! I'm still on {0}
      restart
    : Server is restarting
    settings
    :
      save-user-cache-on-stop-only
    : false
      bungeecord
    : true
      late-bind
    : false
      sample-count
    : 12
      player-shuffle
    : 0
      filter-creative-items
    : true
      user-cache-size
    : 1000
      int-cache-limit
    : 1024
      moved-wrongly-threshold
    : 0.0625
      moved-too-quickly-threshold
    : 100.0
      timeout-time
    : 60
      restart-on-crash
    : true
      restart-script
    : ./restart.sh
      netty-threads
    : 4
      attribute
    :
        maxHealth
    :
          max
    : 2048.0
        movementSpeed
    :
          max
    : 2048.0
        attackDamage
    :
          max
    : 2048.0
      debug
    : false
    timings
    :
      enabled
    : true
      verbose
    : true
      server-name-privacy
    : false
      hidden-config-entries
    :
     - database
      - settings.bungeecord-addresses
      history-interval
    : 300
      history-length
    : 3600
    commands
    :
      tab-complete
    : 0
      log
    : true
      spam-exclusions
    :
     - /skill
      silent-commandblock-console
    : false
      replace-commands
    :
     - setblock
      - summon
      - testforblock
      - tellraw
    stats
    :
      disable-saving
    : false
      forced-stats
    : {}
    world-settings
    :
      default
    :
        verbose
    : true
        mob-spawn-range
    : 4
        nerf-spawner-mobs
    : false
        growth
    :
          cactus-modifier
    : 100
          cane-modifier
    : 100
          melon-modifier
    : 100
          mushroom-modifier
    : 100
          pumpkin-modifier
    : 100
          sapling-modifier
    : 100
          wheat-modifier
    : 100
          netherwart-modifier
    : 100
        entity-activation-range
    :
          animals
    : 32
          monsters
    : 32
          misc
    : 16
        anti-xray
    :
          enabled
    : true
          engine-mode
    : 1
          hide-blocks
    :
         - 14
          - 15
          - 16
          - 21
          - 48
          - 49
          - 54
          - 56
          - 73
          - 74
          - 82
          - 129
          - 130
          replace-blocks
    :
         - 1
          - 5
        entity-tracking-range
    :
          players
    : 48
          animals
    : 48
          monsters
    : 48
          misc
    : 32
          other
    : 64
        ticks-per
    :
          hopper-transfer
    : 8
          hopper-check
    : 8
        hopper-amount
    : 1
        random-light-updates
    : false
        save-structure-info
    : true
        max-bulk-chunks
    : 10
        max-entity-collisions
    : 8
        dragon-death-sound-radius
    : 0
        seed-village
    : 10387312
        seed-feature
    : 14357617
        hunger
    :
          walk-exhaustion
    : 0.2
          sprint-exhaustion
    : 0.8
          combat-exhaustion
    : 0.3
          regen-exhaustion
    : 3.0
        max-tnt-per-tick
    : 100
        max-tick-time
    :
          tile
    : 50
          entity
    : 50
        merge-radius
    :
          item
    : 2.5
          exp
    : 3.0
        item-despawn-rate
    : 6000
        arrow-despawn-rate
    : 1200
        enable-zombie-pigmen-portal-spawns
    : true
        wither-spawn-sound-radius
    : 0
        view-distance
    : 10
        hanging-tick-frequency
    : 100
        zombie-aggressive-towards-villager
    : true
        chunks-per-tick
    : 650
        clear-tick-list
    : false
     
    My restart script:

    PHP:
    touch restart.log

    sleep 5

    echo "removing world" >> restart.log

    rm -r world

    echo "starting again" >> restart.log

    ./start.sh

    echo "-----------" >> restart.log
     
  2. Is the restart script in the same directory as your spigot.yml? If so, you can just put restart.sh
    Btw, how is your script named?
     
  3. I tried just restart.sh still not working and the script is named restart.sh smh. The restart script is in the same directory
     
  4. My bad use ./restart.sh
    In your restart script just put your start.sh's script and see if it works
     
  5. But I need to delete the current world folder
     
  6. Just try it, without any plugin or anything
     
  7. Did still not working
     
  8. You're telling me that if you put restart-script: ./start.sh and use /restart nothing happens?
    Maybe some file permission issues?

    EDIT: actually wait, what is your start.sh script? Are you using screen?

    See https://www.spigotmc.org/threads/restart-script.369436/