当前位置:网站首页>Squid 服务启动脚本
Squid 服务启动脚本
2022-07-03 16:57:00 【星哥玩云】
Squid 服务随系统启动,因搭建作为生产环境,所以还是作为系统服务启动,所以在网上找到一个代码简洁些,可以用的启动脚本。
squid 安装路径是/usr/local/squid
#!/bin/bash # chkconfig: 345 61 61 # description: squid is a web cache server # processname: squid . /etc/rc.d/init.d/functions case $1 in "start") /usr/local/squid/sbin/squid -s if [ $? == "0" ];then echo "squid start ok" else echo "please check the log" fi ;; "stop") /usr/local/squid/sbin/squid -k shutdown if [ $? == "0" ];then echo "squid stop ok" else echo "please check the log" fi ;; "restart") /usr/local/squid/sbin/squid -k shutdown if [ $? == "0" ];then /usr/local/squid/sbin/squid -s if [ $? == "0" ];then echo "squid restart ok" else /usr/local/squid/sbin/squid -s if [ $? == "0" ];then echo "squid restart ok" else echo "please check the log" fi fi fi ;; *) echo "Usage only start|stop|restart" ;; esac
把这个文件放到/etc/init.d/目录下并命名为squid
chmod +x /etc/init.d/squid
chkconfig --add squid
如果出现squid 服务不支持 chkconfig
则去更改上面的 chkconfig: 345 61 61 这几个数字
边栏推荐
- What is the difference between 14Cr1MoR container plate and 14Cr1MoR (H)? Chemical composition and performance analysis of 14Cr1MoR
- What is the material of sa302grc? American standard container plate sa302grc chemical composition
- [combinatorics] recursive equation (example 1 of recursive equation | list recursive equation)
- Alibaba P8 painstakingly sorted it out. Summary of APP UI automated testing ideas. Check it out
- Fast Ethernet and Gigabit Ethernet: what's the difference?
- Redis:关于列表List类型数据的操作命令
- QT serial port UI design and solution to display Chinese garbled code
- 匯編實例解析--實模式下屏幕顯示
- Difference between JSON and bson
- arduino-esp32:LVGL项目(一)整体框架
猜你喜欢

斑馬識別成狗,AI犯錯的原因被斯坦福找到了

Unreal_ Datatable implements ID self increment and sets rowname

Mysql database -dql

(Supplement) double pointer topic

CC2530 common registers for watchdog

Kotlin learning quick start (7) -- wonderful use of expansion

静态程序分析(一)—— 大纲思维导图与内容介绍

C language modifies files by line

Shentong express expects an annual loss of nearly 1billion
![[JDBC] API parsing](/img/75/0f69a4e246a571688355bb13e2cd73.jpg)
[JDBC] API parsing
随机推荐
LeetCode 1657. Determine whether the two strings are close
C语言字符串反转
图之深度优先搜索
What is the material of 13mnnimor? 13mnnimor steel plate for medium and low temperature pressure vessels
Take you to API development by hand
Processing strategy of message queue message loss and repeated message sending
IDEA-配置插件
匯編實例解析--實模式下屏幕顯示
ANOVA example
29: Chapter 3: develop Passport Service: 12: develop [obtain user account information, interface]; (use VO class to package the found data to meet the requirements of the interface for the returned da
斑馬識別成狗,AI犯錯的原因被斯坦福找到了
The most complete postman interface test tutorial in the whole network, API interface test
Overview of satellite navigation system
美团一面:为什么线程崩溃崩溃不会导致 JVM 崩溃
NLP four paradigms: paradigm 1: fully supervised learning in the era of non neural networks (Feature Engineering); Paradigm 2: fully supervised learning based on neural network (Architecture Engineeri
静态程序分析(一)—— 大纲思维导图与内容介绍
[combinatorial mathematics] counting model, common combinatorial numbers and combinatorial identities**
Capacités nécessaires à l'analyse des données
QT serial port UI design and solution to display Chinese garbled code
13mnnimo5-4 German standard steel plate 13MnNiMo54 boiler steel 13MnNiMo54 chemical properties