Cov txheej txheem:
- Kauj Ruam 1: Siv Cov Txheej Txheem Muab los ntawm Systemd
- Kauj Ruam 2: Kho thiab Siv Cov Kev Pabcuam Tshawb Xyuas Cov Ntawv
- Kauj Ruam 3: Kev Xav Thaum Kawg
Video: Kev Pabcuam Saib Xyuas Tsab Ntawv rau Linux Servers: 4 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:30
Muaj kev ruaj khov, ib txwm ua haujlwm, txawm tias koj siv Linux tuaj yeem yog txoj haujlwm nyuaj.
Vim yog qhov nyuaj ntawm cov software software niaj hnub no thiab cov lej tsis zoo, zam tsis dhau qee cov txheej txheem tuaj yeem sib tsoo ib ntus. Qhov no tuaj yeem yog qhov tsis zoo yog tias koj tab tom khiav server thiab qee tus neeg vam khom cov kev pabcuam no.
Kauj Ruam 1: Siv Cov Txheej Txheem Muab los ntawm Systemd
Raws li koj yuav paub, feem ntau niaj hnub Linux ua haujlwm tshuab siv systemd.
Yog tias koj tsis paub nrog systemd, qhov no yog, raws li wikipedia:
"… kev pib ua haujlwm siv hauv Linux kev faib khoom rau bootstrap cov neeg siv chaw thiab tswj hwm txhua cov txheej txheem tom qab, tsis yog UNIX System V lossis Berkeley Software Distribution (BSD) init systems. …"
Coob leej neeg tseem tab tom sib cav tias vim li cas nws thiaj tsim nyog los hloov qhov txheej txheem qub pib zoo nrog cov txheej txheem kev tswj hwm uas nyuaj dua, tab sis ntawm qhov txuas hauv qab no ib tus tuaj yeem pom cov lus piav qhia zoo:
www.tecmint.com/systemd-replaces-init-in-l…
Qhov kev txhim kho tseem ceeb tshaj plaws yuav yog tias nws tuaj yeem coj lub kaw lus nrawm dua li pib, vim yog kev sib koom ua ke thiab ua tiav ntawm kev khau raj hloov chaw ua ntu zus ntawm kev pib
Tsis tas yuav mus rau hauv qhov tob ntawm systemd, txhawm rau ntxiv cov txheej txheem rau hauv systemd, koj yuav tsum tsim cov ntaub ntawv pabcuam. Cov syntax ntawm cov ntaub ntawv no tuaj yeem hloov pauv los ntawm qhov yooj yim heev rau qhov nyuaj, thiab peb yuav tsis mus rau hauv cov ntsiab lus. Txhawm rau kom muaj cov ntaub ntawv yooj yim.service, nws txaus los siv cov npe hauv qab no:
[Chav] Nqe lus piav qhia = piav qhia ntawm daim ntawv thov document = https://wikipedia.org/ Tom qab = local-fs.target network.target [Service] Hom = simpleExecStart =/usr/sbin/applicationExecReload =/usr/sbin/thov reloadExecStop =/ usr/sbin/application stopRestart = ib txwm [Nruab Nrab] WantedBy = ntau-user.target
Muab cov no tso rau hauv application.service cov ntaub ntawv hauv/lib/systemd/system nplaub tshev.
Dab tsi ntawm txhua txoj kev xaiv no tau piav qhia hauv qhov txuas hauv qab no:
access.redhat.com/documentation/en-US/Red_…
Hauv qhov tsis zoo los pib koj daim ntawv thov, muab cov lus txib hauv qab no:
sudo systemctl pib application.service
Nco tseg: qhov kev pabcuam txuas ntxiv tuaj yeem raug rho tawm.
Txhawm rau tso tseg daim ntawv thov:
sudo systemctl nres application.service
Yog tias cov ntaub ntawv teeb tsa tau hloov pauv thiab koj xav rov qhib qhov chaw:
sudo systemctl rov pib dua application.service
Txhawm rau rov pib dua daim ntawv thov:
sudo systemctl rov pib dua application.service
Txhawm rau pab kom tsis siv neeg pib ntawm khau raj:
sudo systemctl pab kom application.service
Yog tias qhov no tau qhib, tom qab ntawd tus thawj tswj hwm txheej txheem systemd yuav sim pib ua daim ntawv thov raws li kev teeb tsa uas tau muab los ntawm cov kab ke system.
Txhawm rau txiav nws, siv tib lo lus txib saum toj no, tab sis nrog 'ua haujlwm' qhov ntsuas.
Yog tias koj tso Restart = ib txwm nyob hauv cov ntaub ntawv muab kev pabcuam, tom qab ntawd systemd yuav tshuaj xyuas cov txheej txheem thiab yog tias nws tsis tuaj yeem pom hauv cov npe txheej txheem, nws yuav sim rov pib dua nws tus kheej.
Yog koj tso
RestartSec = 30
tom qab rov qhia dua, nws yuav tos 30 vib nas this ua ntej sim rov pib ua cov txheej txheem. Qhov no yuav muaj txiaj ntsig, raws li kev rov pib ua txuas ntxiv ntawm qhov kev pabcuam tsis ua haujlwm/daim ntawv thov tuaj yeem ua rau muaj kev thov siab ntawm lub kaw lus (sau cov ntawv yuam kev, thiab lwm yam)
Raws li koj tuaj yeem pom, systemd twb tau muab qee txoj hauv kev los tshuaj xyuas cov txheej txheem. Txawm li cas los xij, hauv qee kis qhov no yuav tsis txaus. Yuav ua li cas yog tias txheej txheem tsis tawm (nws tseem yuav nyob hauv cov npe txheej txheem), tab sis nws tsis teb. Hauv qhov no, txhawm rau kom ntseeg tau tias cov txheej txheem tau ua tiav thiab ua tiav, koj yuav xav tau kev tshuaj xyuas ntxiv kom ua tiav.
Nov yog qhov uas cov ntawv sau los ntawm cov lus qhia no tuaj yeem ua ke.
Kauj Ruam 2: Kho thiab Siv Cov Kev Pabcuam Tshawb Xyuas Cov Ntawv
Yog tias koj xav tau kev tswj hwm ntau ntxiv ntawm koj cov txheej txheem/kev pabcuam, cov ntawv sau no yuav pab tau, kom paub meej.
Raws li txoj cai loj me ntsis, Nws tau tso rau hauv github thiab tuaj yeem pom nyob hauv qab cov chaw cia khoom hauv qab no:
github.com/trex2000/Service-Monitor-Scripts/blob/master/checkService.sh
'Lub plawv' ntawm tag nrho pob khoom yog
checkService.sh
Ua ntej siv nws, koj yuav tsum hloov txoj hauv kev mus rau daim nplaub tshev kev pabcuam. Qhov no tuaj yeem pom ntawm qhov pib ntawm tsab ntawv.
Tsab ntawv tuaj yeem saib xyuas ob peb txheej txheem thiab ua haujlwm ntxiv, raws li tau piav qhia hauv qab no:
Nws mus dhau txhua cov ntaub ntawv los ntawm /cov kev pabcuam subfolder muaj.serv lossis.check txuas ntxiv thiab yuav tshuaj xyuas yog tias muaj txheej txheem nquag hu ua 'daim ntawv thov'.
Yog tias tsis muaj '.check' cov ntaub ntawv rau daim ntawv thov, tsuas yog application.serv cov ntaub ntawv:
Yog tias txheej txheem ua haujlwm, nws yuav txiav txim siab cov txheej txheem ua haujlwm
Yog tias cov txheej txheem tsis ua haujlwm, tom qab ntawd nws yuav rov pib qhov kev pabcuam los ntawm qhov teeb meem-siv cov lus txib hauv qab no:
systemctl rov pib dua daim ntawv thov
yog tias.serv cov ntaub ntawv tsis muaj dab tsi!
Yog tias.serv cov ntaub ntawv tsis khoob thiab muaj txoj cai ua haujlwm tau, nws yuav sim ua nws li cov ntawv BASH dawb.
Qhov no muaj txiaj ntsig yog tias qee yam ntxiv yuav tsum tau ua dua li tsuas yog rov pib ua haujlwm.
Piv txwv li, hauv spamd.serv cov ntaub ntawv, los ntawm repo saum toj no, yog tias qhov kev pabcuam spamd tuag, qhov kev pabcuam spamassassin yuav tsum tau rov pib dua xwb, uas tseem yuav rov pib dua spamd. Rov pib dua tsuas yog spamd yuav tsis txaus.
Ib tus tuaj yeem hloov kho cov ntsiab lus ntawm cov ntaub ntawv pabcuam raws li qhov xav tau.
Lwm qhov piv txwv yog pcscd.serv cov ntaub ntawv. Hauv qhov no ob peb lwm cov txheej txheem kuj tau rov pib dua/tua.
Yog tias muaj daim ntawv txheeb xyuas, tom qab tshuaj xyuas yog tias txheej txheem ua haujlwm, nws tseem yuav ua cov ntawv sau no los ua cov tshev ntxiv.
Piv txwv li, rau qhov kev pabcuam oscam, peb tau tsim cov ntawv txheeb xyuas uas sim txuas rau nws lub vev xaib kom pom tias nws ua tiav. Yog tias tsis yog, tom qab ntawd, txawm tias muaj cov txheej txheem nquag, cov kev pabcuam tsis teb thiab xav tau rov pib dua. Kev rov pib dua ntawm cov kev pabcuam yuav tsum tau ua/hu los ntawm. Xyuas cov ntaub ntawv nws tus kheej.
Lwm qhov piv txwv yuav yog qhov kev pabcuam nruab nrab DLNA.
Nov yog lub server me me uas muab cov vis dis aus/suab rau DLNA cov neeg siv khoom thiab tshaj tawm nws tus kheej ntawm lub network. Qee zaum cov kev pabcuam raug kaw thiab nws tsis tuaj yeem pom-muaj peev xwm ntxiv, tab sis cov txheej txheem tseem yuav ua haujlwm. Txhawm rau txheeb xyuas yog tias qhov kev pabcuam tau tshawb pom-muaj peev xwm, CLI cov khoom siv hu ua gssdp-discover tau siv. Tag nrho cov cai uas txheeb xyuas DLNA server tau muab tso rau sab hauv mediatomb.check tsab ntawv.
Nov tsuas yog qee qhov piv txwv ntawm yuav ua li cas koj tuaj yeem siv.serv thiab. Xyuas cov ntaub ntawv.
Txhawm rau tshuaj xyuas qhov kev pabcuam tshiab, koj yuav tsum tsim.serv thiab, yog tias xav tau kuj tseem muaj cov ntawv txheeb thiab sau cov ntawv sib xws hauv lawv.
Yog tias tsuas yog txheeb xyuas qhov muaj ntawm cov txheej txheem yog txaus, tom qab ntawv tsis muaj.serv cov ntaub ntawv yuav txaus. Yog tias yuav tsum tau kuaj xyuas ntxiv, tom qab ntawv yuav tsum tsim cov ntawv thiab cov ntawv me me yuav tsum tau sau los ua txoj haujlwm.
Ntawm qhov chaw, tsab ntawv.sh yuav tsum tau ua ntu zus, yog li ntawd txoj haujlwm cron yuav tsum tau tsim rau nws:
#txheeb xyuas cov haujlwm pabcuam txhua 5 feeb */5 * * * * /var/bin/ServiceCheck/checkService.sh>/dev/null
Kauj Ruam 3: Kev Xav Thaum Kawg
Kuv vam tias koj yuav pom cov pob no muaj txiaj ntsig zoo vim nws tuaj yeem yooj yim heev rau kev saib xyuas ntawm Linux cov txheej txheem thiab vam tias yuav txo qis qhov kev poob haujlwm ntawm koj cov kev pabcuam.
Xav tias dawb los rub cov ntawv sau ntxiv rau github, yog tias koj tsim tshiab. Tsuas yog qhia rau kuv paub thiab kuv yuav ntxiv koj ua tus txhawb nqa.
Pom zoo:
Txoj hauv kev zoo dua los Saib/Ntaub Ntawv Cov Ntaub Ntawv ntawm Cov Lus Qhia: 4 Cov Kauj Ruam
Txoj hauv kev zoo dua los Saib/Cov Ntaub Ntawv ntawm Kev Qhia: Tib neeg feem ntau suav nrog cov ntaub ntawv rau qhov haujlwm ntawm Instructables upload.Ua ntej qhov no yog software cov ntaub ntawv cov ntaub ntawv uas tej zaum tseem yuav yog lub plawv dhia ntawm kev qhia. Tab sis Instructables tsis muab txoj hauv kev rau tus nyeem yooj yim nyeem thiab tshuaj xyuas cov cai. (
Kev Tau Txais Cov Ntaub Ntawv thiab Cov Ntaub Ntawv Pom Kev Pom Zoo rau MotoStudent Fais Fab Sib Tw Tsheb kauj vab: 23 Kauj Ruam
Kev Tshawb Nrhiav Cov Ntaub Ntawv thiab Cov Ntaub Ntawv Pom Zoo rau MotoStudent Hluav Taws Xob Sib Tw Tsheb: Cov ntaub ntawv khaws cov ntaub ntawv yog cov khoom siv khoos phis tawj thiab software ua haujlwm ua ke txhawm rau sau cov ntaub ntawv los ntawm cov ntsuas sab nraud, khaws thiab ua nws tom qab kom nws tuaj yeem pom cov duab thiab txheeb xyuas, tso cai rau cov kws tsim txuj ci los ua
RAWS LI COV NTAUB NTAWV NTSEEG NTAWV NTAWV MUAJ NTAWV TSHUAJ NTAWV TSO CAI RAU RASPBERRY PI: 6 Kauj Ruam (nrog Duab)
RAWS LI COV NTAUB NTAWV NTAWV MUAJ NTAWV TSHUAJ NTXIV RAU RASPBERRY PI: Hauv qhov haujlwm no, peb yuav txuas peb ntawm Atlas Scientific's EZO sensors (pH, yaj cov pa thiab kub) mus rau Raspberry Pi 3B+. Hloov chaw ntawm txuas cov kab hluav taws xob mus rau Raspberry Pi, peb yuav siv Whitebox Labs Tentacle T3 daim ntaub thaiv. T
Kev Saib Xyuas Kev Noj Qab Haus Huv Ntawm Cov Txheej Txheem Hauv Tib Neeg Siv Wireless Kev Ruaj Ntseg Sensors: 8 Cov Kauj Ruam
Kev Saib Xyuas Kev Noj Qab Haus Huv Ntawm Cov Txheej Txheem Hauv Tsev Siv Wireless Kev Ruaj Ntseg: Qhov tsis zoo ntawm lub tsev qub thiab kev tsim kho pej xeem tuaj yeem ua rau tuag taus thiab xwm txheej txaus ntshai. Kev saib xyuas tas li ntawm cov qauv no yog qhov yuav tsum tau ua. Kev saib xyuas kev noj qab haus huv hauv tsev yog ib txoj hauv kev tseem ceeb heev hauv kev ntsuas
Kev Nyuaj Siab: Kev Saib Xyuas thiab Saib Xyuas Ntxiv rau Kev Teeb Meem: 9 Cov Kauj Ruam
Hard Drive: Kev Saib Xyuas thiab Kev Saib Xyuas Ntxiv Teeb Meem: Daim duab saum toj no yog Hard Drive ib txwm muaj. Cov no yog cov tsav tsheb feem ntau siv niaj hnub no, tab sis tsis tas yuav nrawm tshaj. Tib neeg siv tus tsav no rau nws tus nqi qis dua gigabyte thiab lub neej ntev dua. Phau ntawv qhia no yuav qhia koj txog qhov sib txawv