This move the setting of user and group permissions in the startup script to its own function.
This commit starts to remove some code redundancy from the startup scripts for easier maintenance.