当前位置:网站首页>Raspberry pie creation self start service
Raspberry pie creation self start service
2022-07-28 20:18:00 【K.L.Zous】
1、 Create a service script
sudo nano /etc/init.d/tomcat
The script is as follows :
#!/bin/bash
### BEGIN INIT INFO
# Provides: Auto_Start_Test
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Auto Start Test
# Descrption: This service is used to test auto start service
### END INIT INFO
export JAVA_HOME=/cloud/jdk
export JRE_HOME=$JAVA_HOME/jre
export CATALINA_HOME=/cloud/tomcat9.0
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib/rt.jar
export PATH=$JAVA_HOME/bin:$CATALINA_HOME/bin:$JRE_HOME/bin:$PATH
case "$1" in
start)
${CATALINA_HOME}/bin/catalina.sh start
exit 0
;;
stop)
${CATALINA_HOME}/bin/catalina.sh stop
exit 0
;;
*)
echo "Usage: /etc/init.d/tomcat {start|stop}"
exit 1
;;
esac
exit 0
2、 Set the permissions
sudo chmod 777 /etc/init.d/tomcat
3、 Add the service to the self start item
sudo update-rc.d tomcat defaults
sudo systemctl enable tomcat.service
4、 appendix
| function | Instructions |
|---|---|
| send httpd The service starts automatically | systemctl enable httpd.service |
| send httpd Service does not start automatically | systemctl disable httpd.service |
| Check service status ( Service details ) | systemctl status httpd.service |
| Check service status ( Only show if Active) | systemctl is-active httpd.service |
| Started service | systemctl list-units --type=service |
| Start a service | systemctl start httpd.service |
| Stop a service | systemctl stop httpd.service |
| Restart a service | systemctl restart httpd.service |
边栏推荐
- Power Bi 2021 calendar DAX code
- 6. Functions of C language, why functions are needed, how functions are defined, and the classification of functions
- Implementation of memmove in C language
- C language - question brushing column
- mmo及时战斗游戏中的场景线程分配
- Solve flask integration_ Error reporting in restplus
- 进制及数的表示 2
- CDGA|工业互联网行业怎么做好数据治理?
- 熊市下PLATO如何通过Elephant Swap,获得溢价收益?
- HSETNX KEY_ Name field value usage
猜你喜欢

Why is customer support important to SaaS?

Array out of bounds

Deploy LNMP automatically with saltstack

NEIL: Extracting Visual Knowledge from Web Data
![[C language] 5000 word super detailed explanation of various operations of the sequence table](/img/3b/932526e96ef14df8a321048e9c14b4.png)
[C language] 5000 word super detailed explanation of various operations of the sequence table

9. Pointer of C language (1) what is pointer and how to define pointer variables

WUST-CTF2021-re校赛wp

How can Plato obtain premium income through elephant swap in a bear market?

2022年下半年系统集成项目管理工程师认证8月20日开班

2. Floating point number, the difference between float and double in C language and how to choose them
随机推荐
“中国网事·感动2022”二季度网络感动人物评选结果揭晓
[C language] step jumping problem [recursion]
Handan, Hebei: expand grassroots employment space and help college graduates obtain employment
熊市下PLATO如何通过Elephant Swap,获得溢价收益?
C language operators and input and output
Stories of Party members | Li qingai uses cartoons to drive farmers to increase income and become rich
C language implementation of strncpy
C语言数据 3(1)
plt. What does it mean when linestyle, marker, color equals none in plot()
Basic usage of docker
The results of the second quarter online moving people selection of "China Internet · moving 2022" were announced
Usage of const and assert
English translation Arabic - batch English translation Arabic tools free of charge
一文读懂如何部署具有外部数据库的高可用 K3s
Circular linked list OJ question
Solve the cookie splitting problem (DP)
C language function
2022年下半年系统集成项目管理工程师认证8月20日开班
C language - data storage
Longest Palindromic Substring