mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-23 09:20:20 +08:00
systemd
This commit is contained in:
parent
635791785d
commit
9cee8b0c4a
@ -1,32 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# check credentials exists
|
|
||||||
check_file_exists() {
|
|
||||||
file_path=$1
|
|
||||||
max_attempts=$2
|
|
||||||
|
|
||||||
for ((i=1; i<=max_attempts; i++))
|
|
||||||
do
|
|
||||||
if [ -f "$file_path" ]; then
|
|
||||||
echo "$file_path exists"
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
echo "$file_path is not exists, wait a moment.."
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
if ((i==max_attempts)); then
|
|
||||||
echo "$file_path is not exists, app may be work normally."
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
set +e
|
|
||||||
check_file_exists "/websoft9/credentials/credential_proxy" 1
|
|
||||||
check_file_exists "/websoft9/credentials/credential_deployment" 1
|
|
||||||
check_file_exists "/websoft9/credentials/credential_git" 1
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# start by supervisord
|
# start by supervisord
|
||||||
/usr/bin/supervisord
|
/usr/bin/supervisord
|
||||||
supervisorctl start apphub
|
supervisorctl start apphub
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Websoft9 Linux AppStore
|
Description=Websoft9 Linux AppStore
|
||||||
Requires=network.target docker
|
Requires=network.target docker
|
||||||
After=network.target docker
|
After=network.target docker.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/opt/websoft9/systemd
|
WorkingDirectory=/opt/websoft9/systemd
|
||||||
|
Loading…
Reference in New Issue
Block a user