Skip to content

Added hook for cron script on nfs or gluster for configuration of vss nodes#120

Merged
hosungsmsft merged 1 commit into
Azure:masterfrom
Edunao:master
May 23, 2018
Merged

Added hook for cron script on nfs or gluster for configuration of vss nodes#120
hosungsmsft merged 1 commit into
Azure:masterfrom
Edunao:master

Conversation

@Edunao
Copy link
Copy Markdown

@Edunao Edunao commented May 23, 2018

Added hook for cron script on nfs or gluster for configuration of vss nodes

Copy link
Copy Markdown

@hosungsmsft hosungsmsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks much for your contribution @Edunao . Looks good to me and this will be merged right after for your current urgent needs, but later we'll be integrating this hook with the sync script above.

@hosungsmsft hosungsmsft merged commit 1b8a9a2 into Azure:master May 23, 2018
@Edunao
Copy link
Copy Markdown
Author

Edunao commented May 23, 2018

Many thanks for the merge.
It might actually be good to keep 2 separate sync scripts here - the first one copies the latest code snapshot, whatever it contains. The second executes any processes that haven't yet been run on the system. The two concepts are not quite the same and so may merit independent treatment.

@hosungsmsft
Copy link
Copy Markdown

Interesting. I look forward to seeing your /moodle/bin/update-vmss-config later. Hopefully you'll share that with us after all these are done. Thanks much again for your contribution!

@Edunao
Copy link
Copy Markdown
Author

Edunao commented May 23, 2018

The general form of the bin file is this:

#!/bin/bash

# Lookup the version number corresponding to the next process to be run on the machine
VERSION=1
VERSION_FILE=/root/vmss_config_version
[ -f ${VERSION_FILE} ] && VERSION=$(<${VERSION_FILE})

# iterate over processes that haven't yet been run on this machine, executing them one by one
while true
do
    case $VERSION in
        1)
            # create local directories on fast storage for moodle to work with
            # ...
        ;;
        2)
            # update php configuration
            # ...
        ;;
        3)
            # installer mailer packages and configure them
            # ...
        ;;
        *)
            # nothing more to do so exit
            exit 0
        ;;
    esac

    # increment the version number and store it away to mark the successful end of the process
    VERSION=$(( $VERSION + 1 ))
    echo $VERSION > ${VERSION_FILE}

done

@nelsontalag
Copy link
Copy Markdown

Thanks This was very useful

was able to update /etc configurations with this hook

naioja pushed a commit that referenced this pull request Dec 29, 2025
Added hook for cron script on nfs or gluster for configuration of vss nodes
vibehero100 pushed a commit to vibehero100/Moodle that referenced this pull request Apr 7, 2026
Added hook for cron script on nfs or gluster for configuration of vss nodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants