当前位置:网站首页>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 这几个数字
边栏推荐
- JSON 与 BSON 区别
- Le zèbre a été identifié comme un chien, et la cause de l'erreur d'AI a été trouvée par Stanford
- 跨境电商:外贸企业做海外社媒营销的优势
- CC2530 common registers for serial communication
- Visual studio "usually, each socket address (Protocol / network address / port) can only be used once“
- Summary of three methods of PHP looping through arrays list (), each (), and while
- What is the maximum number of concurrent TCP connections for a server? 65535?
- How programming apes grow rapidly
- utfwry. Dat PHP, about ThinkPHP's method of IP location using utfwry address Library
- Recommendation of good books on learning QT programming
猜你喜欢
PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
Static program analysis (I) -- Outline mind map and content introduction
A survey of state of the art on visual slam
29:第三章:开发通行证服务:12:开发【获得用户账户信息,接口】;(使用VO类包装查到的数据,以符合接口对返回数据的要求)(在多处都会用到的逻辑,在Controller中可以把其抽成一个共用方法)
斑马识别成狗,AI犯错的原因被斯坦福找到了
線程池:業務代碼最常用也最容易犯錯的組件
ucore概述
爱可可AI前沿推介(7.3)
Pytorch 1.12 was released, officially supporting Apple M1 chip GPU acceleration and repairing many bugs
网络安全web渗透技术
随机推荐
Idea configuration plug-in
On Lagrange interpolation and its application
To resist 7-Zip, list "three sins"? Netizen: "is the third key?"
Define a structure fraction to represent a fraction, which is used to represent fractions such as 2/3 and 5/6
[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
CC2530 common registers for timer 1
CC2530 common registers for port interrupts
【Try to Hack】主动侦查隐藏技术
Mysql database -dql
CC2530 common registers for port initialization
What is the difference between 14Cr1MoR container plate and 14Cr1MoR (H)? Chemical composition and performance analysis of 14Cr1MoR
Add color to the interface automation test framework and realize the enterprise wechat test report
图之深度优先搜索
[combinatorics] recursive equation (outline of recursive equation content | definition of recursive equation | example description of recursive equation | Fibonacci Series)
"The NTP socket is in use, exiting" appears when ntpdate synchronizes the time
NLP四范式:范式一:非神经网络时代的完全监督学习(特征工程);范式二:基于神经网络的完全监督学习(架构工程);范式三:预训练,精调范式(目标工程);范式四:预训练,提示,预测范式(Prompt工程)
The most complete postman interface test tutorial in the whole network, API interface test
MySQL Basics
LeetCode 1656. Design ordered flow
[combinatorial mathematics] counting model, common combinatorial numbers and combinatorial identities**