当前位置:网站首页>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 |
边栏推荐
- Using Lex (Flex) to generate lexical analyzer of PL language
- Labelme (I)
- Maximum exchange [greedy thought & monotonic stack implementation]
- [C language] Hanoi Tower problem [recursion]
- The privatized instant messaging platform protects the security of enterprise mobile business
- 83.(cesium之家)cesium示例如何运行
- Why is there no log output in the telnet login interface?
- JS preventdefault() keyboard input limit onmousewheel stoppropagation stop event propagation
- Find the memory occupied by the structure
- 基于 MinIO 对象存储保障 Rancher 数据
猜你喜欢

JS batch add event listening onclick this event delegate target currenttarget onmouseenter OnMouseOver

WUST-CTF2021-re校赛wp

七种轮询介绍(后附实践链接)

Hebei: stabilizing grain and expanding beans to help grain and oil production improve quality and efficiency

Handan, Hebei: expand grassroots employment space and help college graduates obtain employment

“中国网事·感动2022”二季度网络感动人物评选结果揭晓

Quick sort template

Advanced notes (Part 2)

3、 Are formal and actual parameters in a programming language variables?
![[C language] simulation implementation of pow function (recursion)](/img/7b/ef8b3d97adc7810de249a37642c71f.png)
[C language] simulation implementation of pow function (recursion)
随机推荐
[C language] Hanoi Tower problem [recursion]
河北:稳粮扩豆助力粮油生产提质增效
Basic usage of docker
83. (cesium home) how the cesium example works
In the second half of 2022, the system integration project management engineer certification starts on August 20
C language - data type
[C language] Fibonacci sequence [recursion and iteration]
[C language] header file of complex number four operations and complex number operations
4. Const and difine and the problem of initializing arrays with const and define
Longest Palindromic Substring
Solve flask integration_ Error reporting in restplus
How to automatically store email attachments in SharePoint
7. Functions of C language, function definitions and the order of function calls, how to declare functions, prime examples, formal parameters and arguments, and how to write a function well
Solve the cookie splitting problem (DP)
Andorid system layout, values, drawable adaptation
English Translation Spanish - batch English Translation Spanish tools free of charge
ssm中项目异常处理
Why is customer support important to SaaS?
JVM (24) -- performance monitoring and tuning (5) -- Analyzing GC logs
Saltstack advanced