当前位置:网站首页>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 这几个数字
边栏推荐
- Thread pool executes scheduled tasks
- Kindeditor editor upload image ultra wide automatic compression -php code
- NLP四范式:范式一:非神经网络时代的完全监督学习(特征工程);范式二:基于神经网络的完全监督学习(架构工程);范式三:预训练,精调范式(目标工程);范式四:预训练,提示,预测范式(Prompt工程)
- Visual studio "usually, each socket address (Protocol / network address / port) can only be used once“
- 手把手带你入门 API 开发
- Learn from me about the enterprise flutter project: simplified framework demo reference
- 比亚迪、长城混动市场再“聚首”
- ANOVA example
- What is the difference between 14Cr1MoR container plate and 14Cr1MoR (H)? Chemical composition and performance analysis of 14Cr1MoR
- PHP converts a one-dimensional array into a two-dimensional array
猜你喜欢

爱可可AI前沿推介(7.3)
![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](/img/1c/c655c8232de1c56203873dcf171f45.png)
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

Kotlin学习快速入门(7)——扩展的妙用
![[combinatorics] non descending path problem (number of non descending paths with constraints)](/img/89/bd1a2ddd9632ab5d4b4bee9336be51.jpg)
[combinatorics] non descending path problem (number of non descending paths with constraints)

Fast Ethernet and Gigabit Ethernet: what's the difference?

Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..

What is your income level in the country?

Unreal_ Datatable implements ID self increment and sets rowname

Learn from me about the enterprise flutter project: simplified framework demo reference

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
随机推荐
Pytorch 1.12 was released, officially supporting Apple M1 chip GPU acceleration and repairing many bugs
Depth first search of graph
LeetCode 1656. Design ordered flow
执行脚本不认\r
Take you to API development by hand
Build your own website (23)
Netease UI automation test exploration: airtest+poco
[Jianzhi offer] 58 - ii Rotate string left
大消费企业怎样做数字化转型?
Thread pool executes scheduled tasks
UCORE overview
word 退格键删除不了选中文本,只能按delete
Summary of three methods of PHP looping through arrays list (), each (), and while
The word backspace key cannot delete the selected text, so you can only press Delete
RF analyze demo build step by step
Web crawler knowledge day03
13mnnimo5-4 German standard steel plate 13MnNiMo54 boiler steel 13MnNiMo54 chemical properties
[combinatorics] recursive equation (the relationship theorem between the solution of the recursive equation and the characteristic root | the linear property theorem of the solution of the recursive e
(Supplement) double pointer topic
什么是质押池,如何进行质押呢?