-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
51 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
DeploymentCloud/Deployment.Common/scripts/startmsalmsiserverservice.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
echo "Install Python Packages" | ||
pip install msal | ||
|
||
echo "Remove the existing files if they exist" | ||
sudo rm -f /usr/hdinsight/msalmsiserver.py | ||
sudo rm -f /etc/systemd/system/msalmsiserverapp.service | ||
|
||
echo "Download the files from HDFS/Blob storage" | ||
sudo hdfs dfs -copyToLocal wasbs://scriptactions@$sparkBlobAccountName.blob.core.windows.net/msalmsiserver.py /usr/hdinsight/msalmsiserver.py | ||
sudo hdfs dfs -copyToLocal wasbs://scriptactions@$sparkBlobAccountName.blob.core.windows.net/msalmsiserverapp.service /etc/systemd/system/msalmsiserverapp.service | ||
|
||
echo "Change the permission of the file" | ||
sudo chmod 644 /etc/systemd/system/msalmsiserverapp.service | ||
|
||
echo "Reload the systemd manager configuration to apply the changes" | ||
sudo systemctl daemon-reload | ||
|
||
echo "Enable MSAL service to start on boot" | ||
sudo systemctl enable msalmsiserverapp.service | ||
|
||
if sudo systemctl is-active --quiet msiserverapp.service; then | ||
echo "ADAL service is running, ending it and starting MSAL service" | ||
sudo systemctl stop msiserverapp.service | ||
sudo systemctl start msalmsiserverapp.service | ||
elif sudo systemctl is-active --quiet msalmsiserverapp.service; then | ||
echo "MSAL service is already running, restarting it" | ||
sudo systemctl restart msalmsiserverapp.service | ||
else | ||
echo "No service is running, starting MSAL service" | ||
sudo systemctl start msalmsiserverapp.service | ||
fi | ||
|
||
echo "Script execution completed" |
27 changes: 12 additions & 15 deletions
27
DeploymentCloud/Deployment.Common/scripts/startmsiserverservice.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,32 @@ | ||
#!/bin/bash | ||
|
||
echo "Install Python Packages" | ||
pip install msal | ||
|
||
echo "Remove the existing files if they exist" | ||
sudo rm -f /usr/hdinsight/msiserver.py | ||
sudo rm -f /etc/systemd/system/msiserverapp.service | ||
|
||
sudo rm -f /usr/hdinsight/msalmsiserver.py | ||
sudo rm -f /etc/systemd/system/msalmsiserverapp.service | ||
|
||
echo "Download the files from HDFS/Blob storage" | ||
sudo hdfs dfs -copyToLocal wasbs://scriptactions@$sparkBlobAccountName.blob.core.windows.net/msiserver.py /usr/hdinsight/msiserver.py | ||
sudo hdfs dfs -copyToLocal wasbs://scriptactions@$sparkBlobAccountName.blob.core.windows.net/msiserverapp.service /etc/systemd/system/msiserverapp.service | ||
|
||
sudo hdfs dfs -copyToLocal wasbs://scriptactions@$sparkBlobAccountName.blob.core.windows.net/msalmsiserver.py /usr/hdinsight/msalmsiserver.py | ||
sudo hdfs dfs -copyToLocal wasbs://scriptactions@$sparkBlobAccountName.blob.core.windows.net/msalmsiserverapp.service /etc/systemd/system/msalmsiserverapp.service | ||
|
||
echo "Change the permission of the file" | ||
sudo chmod 644 /etc/systemd/system/msiserverapp.service | ||
sudo chmod 644 /etc/systemd/system/msalmsiserverapp.service | ||
|
||
echo "Reload the systemd manager configuration to apply the changes" | ||
sudo systemctl daemon-reload | ||
|
||
echo "Enable the service to start on boot" | ||
echo "Enable ADAL service to start on boot" | ||
sudo systemctl enable msiserverapp.service | ||
sudo systemctl enable msalmsiserverapp.service | ||
|
||
echo "Start the service" | ||
sudo systemctl start msiserverapp.service | ||
sudo systemctl start msalmsiserverapp.service | ||
if sudo systemctl is-active --quiet msalmsiserverapp.service; then | ||
echo "MSAL service is running, ending it and starting ADAL service" | ||
sudo systemctl stop msalmsiserverapp.service | ||
sudo systemctl start msiserverapp.service | ||
elif sudo systemctl is-active --quiet msiserverapp.service; then | ||
echo "ADAL service is already running, restarting it" | ||
sudo systemctl restart msiserverapp.service | ||
else | ||
echo "No service is running, starting ADAL service" | ||
sudo systemctl start msiserverapp.service | ||
fi | ||
|
||
echo "Script execution completed" |