当前位置:网站首页>Squid service startup script
Squid service startup script
2022-07-03 16:59:00 【Brother Xing plays with the clouds】
Squid The service starts with the system , Because it is built as a production environment , Therefore, it is still started as a system service , So find a simple code on the Internet , Available startup scripts .
squid The installation path is /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
Put this file in /etc/init.d/ Directory and named squid
chmod +x /etc/init.d/squid
chkconfig --add squid
If appear squid Service not supported chkconfig
Then change the above chkconfig: 345 61 61 These numbers
边栏推荐
- Capacités nécessaires à l'analyse des données
- [sword finger offer] 58 - I. flip the word order
- 比亚迪、长城混动市场再“聚首”
- [Jianzhi offer] 57 - ii Continuous positive sequence with sum s
- 定义一个结构体Fraction,表示分数,用于表示 2/3, 5/6这样的分数
- What material is sa537cl1? Sa537cl1 corresponds to the national standard material
- Hands on in-depth learning notes (XIV) 3.7 Simple implementation of softmax regression
- Zebras are recognized as dogs, and Stanford found the reason why AI made mistakes
- Web crawler knowledge day03
- Interpretation of several important concepts of satellite antenna
猜你喜欢
Prepare for the golden three silver four, 100+ software test interview questions (function / interface / Automation) interview questions. win victory the moment one raises one 's standard
【Try to Hack】主动侦查隐藏技术
Thread pool: the most common and error prone component of business code
Daily code 300 lines learning notes day 10
arduino-esp32:LVGL项目(一)整体框架
Analysis of variance summary
MySQL single table field duplicate data takes the latest SQL statement
ucore概述
Redis:关于列表List类型数据的操作命令
New features of C 10
随机推荐
Shentong express expects an annual loss of nearly 1billion
大消费企业怎样做数字化转型?
人生还在迷茫?也许这些订阅号里有你需要的答案!
Talk about several methods of interface optimization
How to allow remote connection to MySQL server on Linux system?
The word backspace key cannot delete the selected text, so you can only press Delete
Kotlin学习快速入门(7)——扩展的妙用
Mysql database DDL and DML
C language string inversion
什么是质押池,如何进行质押呢?
CC2530 common registers for port interrupts
Analysis of variance summary
SSH连接远程主机等待时间过长的解决方法
比亚迪、长城混动市场再“聚首”
One brush 142 monotone stack next larger element II (m)
【剑指 Offer 】64. 求1+2+…+n
function overloading
LeetCode 1657. Determine whether the two strings are close
Pools de Threads: les composants les plus courants et les plus sujets aux erreurs du Code d'affaires
Atom QT 16_ audiorecorder