Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FoD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Schmitz
FoD
Commits
9ad82245
Commit
9ad82245
authored
Jan 13, 2023
by
David Schmitz
Browse files
Options
Downloads
Patches
Plain Diff
install-centos.sh: add systemd support
parent
e7aecfcd
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
install-centos.sh
+53
-4
53 additions, 4 deletions
install-centos.sh
with
53 additions
and
4 deletions
install-centos.sh
+
53
−
4
View file @
9ad82245
...
@@ -15,6 +15,7 @@ inside_docker=0
...
@@ -15,6 +15,7 @@ inside_docker=0
install_basesw
=
1
install_basesw
=
1
install_fodproper
=
1
install_fodproper
=
1
install_systemd_services
=
0
ensure_installed_pythonenv_wrapper
=
1
ensure_installed_pythonenv_wrapper
=
1
# workaround for old Django with old OS sqlite3 (CENTOS7 only):
# workaround for old Django with old OS sqlite3 (CENTOS7 only):
...
@@ -29,8 +30,18 @@ if [ -e "/.dockerenv" ]; then
...
@@ -29,8 +30,18 @@ if [ -e "/.dockerenv" ]; then
echo
"running inside docker assummed"
1>&2
echo
"running inside docker assummed"
1>&2
inside_docker
=
1
inside_docker
=
1
fi
fi
if
grep
-q
-E
'^systemd$'
/proc/1/comm
;
then
echo
"system is running systemd as init process, setting default install_systemd_services=1"
1>&2
install_systemd_services
=
1
elif
[
"
$inside_docker
"
=
1
]
;
then
echo
"inside_docker=
$inside_docker
, so setting default install_systemd_services=0"
1>&2
install_systemd_services
=
0
fi
##############################################################################
##############################################################################
##############################################################################
##############################################################################
while
[
$#
-gt
0
]
;
do
while
[
$#
-gt
0
]
;
do
if
[
$#
-ge
1
-a
"
$1
"
=
"--here"
]
;
then
if
[
$#
-ge
1
-a
"
$1
"
=
"--here"
]
;
then
...
@@ -63,6 +74,12 @@ while [ $# -gt 0 ]; do
...
@@ -63,6 +74,12 @@ while [ $# -gt 0 ]; do
shift
1
shift
1
install_basesw
=
0
install_basesw
=
0
install_fodproper
=
1
install_fodproper
=
1
elif
[
$#
-ge
1
-a
"
$1
"
=
"--systemd"
]
;
then
shift
1
install_systemd_services
=
1
elif
[
$#
-ge
1
-a
"
$1
"
=
"--no_systemd"
]
;
then
shift
1
install_systemd_services
=
0
else
else
break
break
fi
fi
...
@@ -420,7 +437,39 @@ EOF
...
@@ -420,7 +437,39 @@ EOF
##
##
echo
"
$0
: step 2.5.4: preparing runfod script"
1>&2
echo
"
$0
: step 2.5.5: preparing systemd files"
1>&2
fod_systemd_dir
=
"
$fod_dir
/systemd"
cp
-f
"
$fod_systemd_dir
/fod-gunicorn.service.dist"
"
$fod_systemd_dir
/fod-gunicorn.service"
sed
-i
"s#/srv/flowspy#
$fod_dir
#g"
"
$fod_systemd_dir
/fod-gunicorn.service"
cp
-f
"
$fod_systemd_dir
/fod-celeryd.service.dist"
"
$fod_systemd_dir
/fod-celeryd.service"
sed
-i
"s#/srv/flowspy#
$fod_dir
#g"
"
$fod_systemd_dir
/fod-celeryd.service"
cp
-f
"
$fod_systemd_dir
/fod-status-email-user@.service.dist"
"
$fod_systemd_dir
/fod-status-email-user@.service"
sed
-i
"s#/srv/flowspy#
$fod_dir
#g"
"
$fod_systemd_dir
/fod-status-email-user@.service"
if
[
"
$install_systemd_services
"
=
1
]
;
then
echo
1>&2
echo
"Installing systemd services"
1>&2
echo
1>&2
#cp -f "$fod_systemd_dir/fod-gunicorn.service" "$fod_systemd_dir/fod-celeryd.service" "/etc/systemd/system/"
cp
-v
-f
"
$fod_systemd_dir
/fod-gunicorn.service"
"
$fod_systemd_dir
/fod-celeryd.service"
"
$fod_systemd_dir
/fod-status-email-user@.service"
"/etc/systemd/system/"
1>&2
systemctl daemon-reload
systemctl
enable
fod-gunicorn
systemctl
enable
fod-celeryd
systemctl restart fod-gunicorn
systemctl restart fod-celeryd
sleep
5
SYSTEMD_COLORS
=
1 systemctl status fod-gunicorn |
cat
echo
SYSTEMD_COLORS
=
1 systemctl status fod-celeryd |
cat
echo
fi
if
[
"
$assume__sqlite_version__to_old
"
=
1
]
;
then
if
[
"
$assume__sqlite_version__to_old
"
=
1
]
;
then
echo
"
$0
: assume__sqlite_version__to_old=
$assume__sqlite_version__to_old
=> using runfod.centos.sh for old celery start syntax"
1>&2
echo
"
$0
: assume__sqlite_version__to_old=
$assume__sqlite_version__to_old
=> using runfod.centos.sh for old celery start syntax"
1>&2
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment