Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
log-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
log-platform
Commits
4748d0ed
Commit
4748d0ed
authored
Feb 01, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加服务检测拉起脚本
parent
23322439
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
log-manager/pom.xml
log-manager/pom.xml
+1
-1
log-manager/src/main/bin/check_server.sh
log-manager/src/main/bin/check_server.sh
+28
-0
No files found.
log-manager/pom.xml
View file @
4748d0ed
...
@@ -181,7 +181,7 @@
...
@@ -181,7 +181,7 @@
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.namespace>
smart-gov
</profiles.nacos.namespace>
<profiles.nacos.namespace>
smart-gov
</profiles.nacos.namespace>
<profiles.log.path>
/home/mortals/app/logs
</profiles.log.path>
<profiles.log.path>
/home/mortals/app/logs
</profiles.log.path>
<profiles.filepath>
/
home/
mortals/app/data
</profiles.filepath>
<profiles.filepath>
/mortals/app/data
</profiles.filepath>
<package.environment>
yibin
</package.environment>
<package.environment>
yibin
</package.environment>
<skipDeploy>
false
</skipDeploy>
<skipDeploy>
false
</skipDeploy>
</properties>
</properties>
...
...
log-manager/src/main/bin/check_server.sh
0 → 100644
View file @
4748d0ed
#!/bin/bash
PORT
=
"@profiles.server.port@"
PROJECT_NAME
=
"@project.artifactId@"
;
MAIN_CLASS
=
"
$PROJECT_NAME
-@project.version@.jar"
;
SHELL_NAME
=
$0
SHELL_LOG
=
"
${
SHELL_NAME
}
.log"
LOG_DATE
=
'date "+%Y-%m-%d"'
LOG_TIME
=
'date "+%H-%M-%S"'
CDATE
=
$(
date
"+%Y-%m-%d"
)
CTIME
=
$(
date
"+%H-%M-%S"
)
#写日志
writelog
()
{
LOGINFO
=
$1
echo
"
${
CDATE
}
${
CTIME
}
:
${
SHELL_NAME
}
:
${
LOGINFO
}
"
>>
${
SHELL_LOG
}
}
jcpid
=
`
ps
-ef
|
grep
-v
"grep"
|
grep
"
$MAIN_CLASS
"
|
grep
"app.port=
$PORT
"
|
sed
-n
'1P'
|
awk
'{print $2}'
`
if
[
$jcpid
]
;
then
writelog
"The
$PROJECT_NAME
start finished, PID is
$jcpid
"
exit
$SUCCESS
else
writelog
"start service..."
systemctl stop
${
PROJECT_NAME
}
&&
systemctl start
${
PROJECT_NAME
}
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment