[{"data":1,"prerenderedAt":1920},["ShallowReactive",2],{"page-\u002Flinux\u002F11-systemd-and-services":3},{"id":4,"title":5,"body":6,"description":1913,"extension":1914,"meta":1915,"navigation":231,"path":1916,"seo":1917,"stem":1918,"__hash__":1919},"content\u002Flinux\u002F11-systemd-and-services.md","11 — systemd & Services",{"type":7,"value":8,"toc":1884},"minimark",[9,13,21,30,162,170,255,259,425,432,505,515,541,545,556,576,579,609,613,662,666,890,896,1033,1037,1102,1106,1276,1284,1306,1310,1424,1428,1519,1523,1646,1650,1656,1692,1710,1880],[10,11,5],"h1",{"id":12},"_11-systemd-services",[14,15,16,20],"p",{},[17,18,19],"strong",{},"systemd"," is the init system and service manager on virtually every modern Linux distribution. It starts at boot (PID 1), launches all other services, monitors them, manages logging, networking, timers, and more. This chapter covers unit management, drop-in overrides, timers, resource limits, and the gotchas that cause service failures.",[22,23,25,29],"h2",{"id":24},"systemctl-the-main-interface",[26,27,28],"code",{},"systemctl"," — The Main Interface",[31,32,34],"code-wrapper",{"language":33},"bash",[35,36,40],"pre",{"className":37,"code":38,"language":33,"meta":39,"style":39},"language-bash shiki shiki-themes github-light github-dark","# Complex Implementation: full service lifecycle\nsudo systemctl enable --now nginx   # enable (boot) + start (now) in one command\nsudo systemctl status nginx          # status + recent logs\nsudo systemctl reload nginx          # reload config (no downtime, if supported)\nsudo systemctl mask nginx            # prevent start entirely (even manual)\nsudo systemctl is-active nginx      # is it running? (exit 0\u002F3)\nsystemctl list-units --state=failed # find broken services (essential after boot)\nsystemctl cat nginx                 # show the unit file + drop-in overrides\n","",[26,41,42,51,75,90,105,120,135,149],{"__ignoreMap":39},[43,44,47],"span",{"class":45,"line":46},"line",1,[43,48,50],{"class":49},"sdCPZ","# Complex Implementation: full service lifecycle\n",[43,52,54,58,62,65,69,72],{"class":45,"line":53},2,[43,55,57],{"class":56},"sIsaT","sudo",[43,59,61],{"class":60},"sJ6F3"," systemctl",[43,63,64],{"class":60}," enable",[43,66,68],{"class":67},"snvgF"," --now",[43,70,71],{"class":60}," nginx",[43,73,74],{"class":49},"   # enable (boot) + start (now) in one command\n",[43,76,78,80,82,85,87],{"class":45,"line":77},3,[43,79,57],{"class":56},[43,81,61],{"class":60},[43,83,84],{"class":60}," status",[43,86,71],{"class":60},[43,88,89],{"class":49},"          # status + recent logs\n",[43,91,93,95,97,100,102],{"class":45,"line":92},4,[43,94,57],{"class":56},[43,96,61],{"class":60},[43,98,99],{"class":60}," reload",[43,101,71],{"class":60},[43,103,104],{"class":49},"          # reload config (no downtime, if supported)\n",[43,106,108,110,112,115,117],{"class":45,"line":107},5,[43,109,57],{"class":56},[43,111,61],{"class":60},[43,113,114],{"class":60}," mask",[43,116,71],{"class":60},[43,118,119],{"class":49},"            # prevent start entirely (even manual)\n",[43,121,123,125,127,130,132],{"class":45,"line":122},6,[43,124,57],{"class":56},[43,126,61],{"class":60},[43,128,129],{"class":60}," is-active",[43,131,71],{"class":60},[43,133,134],{"class":49},"      # is it running? (exit 0\u002F3)\n",[43,136,138,140,143,146],{"class":45,"line":137},7,[43,139,28],{"class":56},[43,141,142],{"class":60}," list-units",[43,144,145],{"class":67}," --state=failed",[43,147,148],{"class":49}," # find broken services (essential after boot)\n",[43,150,152,154,157,159],{"class":45,"line":151},8,[43,153,28],{"class":56},[43,155,156],{"class":60}," cat",[43,158,71],{"class":60},[43,160,161],{"class":49},"                 # show the unit file + drop-in overrides\n",[163,164,166,169],"h3",{"id":165},"daemon-reload-the-1-systemd-gotcha",[26,167,168],{},"daemon-reload"," — The #1 systemd Gotcha",[31,171,172],{"language":33},[35,173,175],{"className":37,"code":174,"language":33,"meta":39,"style":39},"# Complex Implementation: edit a unit file safely\nsudo systemctl edit nginx    # creates a drop-in override\n# (edit the file, save, quit)\nsudo systemctl daemon-reload  # CRITICAL: re-read unit files from disk\nsudo systemctl restart nginx  # now the changes take effect\n\n# Anti-Pattern: edit + restart WITHOUT daemon-reload\n# sudo systemctl edit nginx\n# sudo systemctl restart nginx   → systemd uses the CACHED (old) definition\n# Forgetting daemon-reload is the #1 systemd bug\n",[26,176,177,182,196,201,213,227,233,238,243,249],{"__ignoreMap":39},[43,178,179],{"class":45,"line":46},[43,180,181],{"class":49},"# Complex Implementation: edit a unit file safely\n",[43,183,184,186,188,191,193],{"class":45,"line":53},[43,185,57],{"class":56},[43,187,61],{"class":60},[43,189,190],{"class":60}," edit",[43,192,71],{"class":60},[43,194,195],{"class":49},"    # creates a drop-in override\n",[43,197,198],{"class":45,"line":77},[43,199,200],{"class":49},"# (edit the file, save, quit)\n",[43,202,203,205,207,210],{"class":45,"line":92},[43,204,57],{"class":56},[43,206,61],{"class":60},[43,208,209],{"class":60}," daemon-reload",[43,211,212],{"class":49},"  # CRITICAL: re-read unit files from disk\n",[43,214,215,217,219,222,224],{"class":45,"line":107},[43,216,57],{"class":56},[43,218,61],{"class":60},[43,220,221],{"class":60}," restart",[43,223,71],{"class":60},[43,225,226],{"class":49},"  # now the changes take effect\n",[43,228,229],{"class":45,"line":122},[43,230,232],{"emptyLinePlaceholder":231},true,"\n",[43,234,235],{"class":45,"line":137},[43,236,237],{"class":49},"# Anti-Pattern: edit + restart WITHOUT daemon-reload\n",[43,239,240],{"class":45,"line":151},[43,241,242],{"class":49},"# sudo systemctl edit nginx\n",[43,244,246],{"class":45,"line":245},9,[43,247,248],{"class":49},"# sudo systemctl restart nginx   → systemd uses the CACHED (old) definition\n",[43,250,252],{"class":45,"line":251},10,[43,253,254],{"class":49},"# Forgetting daemon-reload is the #1 systemd bug\n",[22,256,258],{"id":257},"unit-file-structure","Unit File Structure",[31,260,262],{"language":261},"ini",[35,263,266],{"className":264,"code":265,"language":261,"meta":39,"style":39},"language-ini shiki shiki-themes github-light github-dark","# \u002Fetc\u002Fsystemd\u002Fsystem\u002Fmyapp.service\n[Unit]\nDescription=My Web Application\nAfter=network.target\nWants=network-online.target\n\n[Service]\nType=simple\nUser=appuser\nGroup=appuser\nWorkingDirectory=\u002Fopt\u002Fmyapp\nEnvironment=NODE_ENV=production\nEnvironmentFile=\u002Fetc\u002Fmyapp\u002Fenv\nExecStart=\u002Fusr\u002Fbin\u002Fnode \u002Fopt\u002Fmyapp\u002Fserver.js\nRestart=on-failure\nRestartSec=5\nTimeoutStopSec=30\n\n[Install]\nWantedBy=multi-user.target\n",[26,267,268,273,278,288,296,304,308,313,321,329,336,345,360,369,378,387,396,405,410,416],{"__ignoreMap":39},[43,269,270],{"class":45,"line":46},[43,271,272],{"class":49},"# \u002Fetc\u002Fsystemd\u002Fsystem\u002Fmyapp.service\n",[43,274,275],{"class":45,"line":53},[43,276,277],{"class":56},"[Unit]\n",[43,279,280,284],{"class":45,"line":77},[43,281,283],{"class":282},"svdQ7","Description",[43,285,287],{"class":286},"ssxIu","=My Web Application\n",[43,289,290,293],{"class":45,"line":92},[43,291,292],{"class":282},"After",[43,294,295],{"class":286},"=network.target\n",[43,297,298,301],{"class":45,"line":107},[43,299,300],{"class":282},"Wants",[43,302,303],{"class":286},"=network-online.target\n",[43,305,306],{"class":45,"line":122},[43,307,232],{"emptyLinePlaceholder":231},[43,309,310],{"class":45,"line":137},[43,311,312],{"class":56},"[Service]\n",[43,314,315,318],{"class":45,"line":151},[43,316,317],{"class":282},"Type",[43,319,320],{"class":286},"=simple\n",[43,322,323,326],{"class":45,"line":245},[43,324,325],{"class":282},"User",[43,327,328],{"class":286},"=appuser\n",[43,330,331,334],{"class":45,"line":251},[43,332,333],{"class":282},"Group",[43,335,328],{"class":286},[43,337,339,342],{"class":45,"line":338},11,[43,340,341],{"class":282},"WorkingDirectory",[43,343,344],{"class":286},"=\u002Fopt\u002Fmyapp\n",[43,346,348,351,354,357],{"class":45,"line":347},12,[43,349,350],{"class":282},"Environment",[43,352,353],{"class":286},"=",[43,355,356],{"class":282},"NODE_ENV",[43,358,359],{"class":286},"=production\n",[43,361,363,366],{"class":45,"line":362},13,[43,364,365],{"class":282},"EnvironmentFile",[43,367,368],{"class":286},"=\u002Fetc\u002Fmyapp\u002Fenv\n",[43,370,372,375],{"class":45,"line":371},14,[43,373,374],{"class":282},"ExecStart",[43,376,377],{"class":286},"=\u002Fusr\u002Fbin\u002Fnode \u002Fopt\u002Fmyapp\u002Fserver.js\n",[43,379,381,384],{"class":45,"line":380},15,[43,382,383],{"class":282},"Restart",[43,385,386],{"class":286},"=on-failure\n",[43,388,390,393],{"class":45,"line":389},16,[43,391,392],{"class":282},"RestartSec",[43,394,395],{"class":286},"=5\n",[43,397,399,402],{"class":45,"line":398},17,[43,400,401],{"class":282},"TimeoutStopSec",[43,403,404],{"class":286},"=30\n",[43,406,408],{"class":45,"line":407},18,[43,409,232],{"emptyLinePlaceholder":231},[43,411,413],{"class":45,"line":412},19,[43,414,415],{"class":56},"[Install]\n",[43,417,419,422],{"class":45,"line":418},20,[43,420,421],{"class":282},"WantedBy",[43,423,424],{"class":286},"=multi-user.target\n",[163,426,428,431],{"id":427},"type-is-critical",[26,429,430],{},"Type="," Is Critical",[433,434,435,447],"table",{},[436,437,438],"thead",{},[439,440,441,444],"tr",{},[442,443,317],"th",{},[442,445,446],{},"Behavior",[448,449,450,464,478,491],"tbody",{},[439,451,452,459],{},[453,454,455,458],"td",{},[26,456,457],{},"simple"," (default)",[453,460,461,463],{},[26,462,374],{}," is the main process, runs in foreground. Use for most apps.",[439,465,466,471],{},[453,467,468],{},[26,469,470],{},"forking",[453,472,473,474,477],{},"Daemon forks and parent exits. systemd tracks the child. Needs ",[26,475,476],{},"PIDFile=",".",[439,479,480,485],{},[453,481,482],{},[26,483,484],{},"oneshot",[453,486,487,488,477],{},"Runs once and exits. Often paired with ",[26,489,490],{},"RemainAfterExit=yes",[439,492,493,498],{},[453,494,495],{},[26,496,497],{},"notify",[453,499,500,501,504],{},"Service calls ",[26,502,503],{},"sd_notify()"," when ready. systemd waits for this.",[163,506,508,511,512],{"id":507},"after-vs-requires",[26,509,510],{},"After="," vs ",[26,513,514],{},"Requires=",[516,517,518,524,529],"ul",{},[519,520,521,523],"li",{},[26,522,510],{}," — ordering only (start B after A, but don't start A).",[519,525,526,528],{},[26,527,514],{}," — dependency (start A too).",[519,530,531,532,535,536,540],{},"Use both: ",[26,533,534],{},"After=network.target Requires=network.target"," if you need the network up ",[537,538,539],"em",{},"and"," ordered after it.",[22,542,544],{"id":543},"drop-in-overrides-the-right-way-to-customize","Drop-In Overrides (The Right Way to Customize)",[14,546,547,548,551,552,555],{},"Never edit ",[26,549,550],{},"\u002Fusr\u002Flib\u002Fsystemd\u002Fsystem\u002Fnginx.service"," directly — package updates overwrite it. Use ",[17,553,554],{},"drop-ins",":",[31,557,558],{"language":33},[35,559,561],{"className":37,"code":560,"language":33,"meta":39,"style":39},"sudo systemctl edit nginx    # opens \u002Fetc\u002Fsystemd\u002Fsystem\u002Fnginx.service.d\u002Foverride.conf\n",[26,562,563],{"__ignoreMap":39},[43,564,565,567,569,571,573],{"class":45,"line":46},[43,566,57],{"class":56},[43,568,61],{"class":60},[43,570,190],{"class":60},[43,572,71],{"class":60},[43,574,575],{"class":49},"    # opens \u002Fetc\u002Fsystemd\u002Fsystem\u002Fnginx.service.d\u002Foverride.conf\n",[14,577,578],{},"Add only the lines you want to change:",[31,580,581],{"language":261},[35,582,584],{"className":264,"code":583,"language":261,"meta":39,"style":39},"# \u002Fetc\u002Fsystemd\u002Fsystem\u002Fnginx.service.d\u002Foverride.conf\n[Service]\nRestart=always\nRestartSec=3\n",[26,585,586,591,595,602],{"__ignoreMap":39},[43,587,588],{"class":45,"line":46},[43,589,590],{"class":49},"# \u002Fetc\u002Fsystemd\u002Fsystem\u002Fnginx.service.d\u002Foverride.conf\n",[43,592,593],{"class":45,"line":53},[43,594,312],{"class":56},[43,596,597,599],{"class":45,"line":77},[43,598,383],{"class":282},[43,600,601],{"class":286},"=always\n",[43,603,604,606],{"class":45,"line":92},[43,605,392],{"class":282},[43,607,608],{"class":286},"=3\n",[163,610,612],{"id":611},"caveat-drop-in-merges-doesnt-replace","Caveat: Drop-In Merges, Doesn't Replace",[31,614,615],{"language":33},[35,616,618],{"className":37,"code":617,"language":33,"meta":39,"style":39},"# NAIVE: adding ExecStart in a drop-in creates TWO ExecStart lines → error\n# [Service]\n# ExecStart=\u002Fusr\u002Fsbin\u002Fnginx -g 'daemon off;' --with-debug\n# → systemd errors: \"ExecStart has multiple lines\"\n\n# PRODUCTION: clear first, then set\n# [Service]\n# ExecStart=                        ← empty clears the list\n# ExecStart=\u002Fusr\u002Fsbin\u002Fnginx -g 'daemon off;' --with-debug\n",[26,619,620,625,630,635,640,644,649,653,658],{"__ignoreMap":39},[43,621,622],{"class":45,"line":46},[43,623,624],{"class":49},"# NAIVE: adding ExecStart in a drop-in creates TWO ExecStart lines → error\n",[43,626,627],{"class":45,"line":53},[43,628,629],{"class":49},"# [Service]\n",[43,631,632],{"class":45,"line":77},[43,633,634],{"class":49},"# ExecStart=\u002Fusr\u002Fsbin\u002Fnginx -g 'daemon off;' --with-debug\n",[43,636,637],{"class":45,"line":92},[43,638,639],{"class":49},"# → systemd errors: \"ExecStart has multiple lines\"\n",[43,641,642],{"class":45,"line":107},[43,643,232],{"emptyLinePlaceholder":231},[43,645,646],{"class":45,"line":122},[43,647,648],{"class":49},"# PRODUCTION: clear first, then set\n",[43,650,651],{"class":45,"line":137},[43,652,629],{"class":49},[43,654,655],{"class":45,"line":151},[43,656,657],{"class":49},"# ExecStart=                        ← empty clears the list\n",[43,659,660],{"class":45,"line":245},[43,661,634],{"class":49},[22,663,665],{"id":664},"creating-a-custom-service","Creating a Custom Service",[31,667,668],{"language":33},[35,669,671],{"className":37,"code":670,"language":33,"meta":39,"style":39},"# Complex Implementation: production-grade Node.js service with resource limits\nsudo tee \u002Fetc\u002Fsystemd\u002Fsystem\u002Fmyapp.service \u003C\u003C'EOF'\n[Unit]\nDescription=My Node.js App\nAfter=network.target\n\n[Service]\nType=simple\nUser=appuser\nGroup=appuser\nWorkingDirectory=\u002Fopt\u002Fmyapp\nEnvironment=NODE_ENV=production\nEnvironmentFile=\u002Fetc\u002Fmyapp\u002F.env\nExecStart=\u002Fusr\u002Fbin\u002Fnode server.js\nRestart=on-failure\nRestartSec=5\nStandardOutput=journal\nStandardError=journal\n\n# Resource limits (cgroups v2):\nMemoryMax=512M            # hard memory limit (OOM-kill if exceeded)\nCPUQuota=50%              # max 50% CPU\nTasksMax=100              # max 100 processes\nLimitNOFILE=65536         # max open files\n\n# Protect from OOM killer:\nOOMScoreAdjust=-500\n\n[Install]\nWantedBy=multi-user.target\nEOF\n\nsudo systemctl daemon-reload\nsudo systemctl enable --now myapp\njournalctl -u myapp -f      # follow logs\n",[26,672,673,678,694,698,703,708,712,716,721,726,731,736,741,746,751,756,761,766,771,775,780,786,792,798,804,809,815,821,826,831,837,843,848,858,872],{"__ignoreMap":39},[43,674,675],{"class":45,"line":46},[43,676,677],{"class":49},"# Complex Implementation: production-grade Node.js service with resource limits\n",[43,679,680,682,685,688,691],{"class":45,"line":53},[43,681,57],{"class":56},[43,683,684],{"class":60}," tee",[43,686,687],{"class":60}," \u002Fetc\u002Fsystemd\u002Fsystem\u002Fmyapp.service",[43,689,690],{"class":282}," \u003C\u003C",[43,692,693],{"class":60},"'EOF'\n",[43,695,696],{"class":45,"line":77},[43,697,277],{"class":60},[43,699,700],{"class":45,"line":92},[43,701,702],{"class":60},"Description=My Node.js App\n",[43,704,705],{"class":45,"line":107},[43,706,707],{"class":60},"After=network.target\n",[43,709,710],{"class":45,"line":122},[43,711,232],{"emptyLinePlaceholder":231},[43,713,714],{"class":45,"line":137},[43,715,312],{"class":60},[43,717,718],{"class":45,"line":151},[43,719,720],{"class":60},"Type=simple\n",[43,722,723],{"class":45,"line":245},[43,724,725],{"class":60},"User=appuser\n",[43,727,728],{"class":45,"line":251},[43,729,730],{"class":60},"Group=appuser\n",[43,732,733],{"class":45,"line":338},[43,734,735],{"class":60},"WorkingDirectory=\u002Fopt\u002Fmyapp\n",[43,737,738],{"class":45,"line":347},[43,739,740],{"class":60},"Environment=NODE_ENV=production\n",[43,742,743],{"class":45,"line":362},[43,744,745],{"class":60},"EnvironmentFile=\u002Fetc\u002Fmyapp\u002F.env\n",[43,747,748],{"class":45,"line":371},[43,749,750],{"class":60},"ExecStart=\u002Fusr\u002Fbin\u002Fnode server.js\n",[43,752,753],{"class":45,"line":380},[43,754,755],{"class":60},"Restart=on-failure\n",[43,757,758],{"class":45,"line":389},[43,759,760],{"class":60},"RestartSec=5\n",[43,762,763],{"class":45,"line":398},[43,764,765],{"class":60},"StandardOutput=journal\n",[43,767,768],{"class":45,"line":407},[43,769,770],{"class":60},"StandardError=journal\n",[43,772,773],{"class":45,"line":412},[43,774,232],{"emptyLinePlaceholder":231},[43,776,777],{"class":45,"line":418},[43,778,779],{"class":60},"# Resource limits (cgroups v2):\n",[43,781,783],{"class":45,"line":782},21,[43,784,785],{"class":60},"MemoryMax=512M            # hard memory limit (OOM-kill if exceeded)\n",[43,787,789],{"class":45,"line":788},22,[43,790,791],{"class":60},"CPUQuota=50%              # max 50% CPU\n",[43,793,795],{"class":45,"line":794},23,[43,796,797],{"class":60},"TasksMax=100              # max 100 processes\n",[43,799,801],{"class":45,"line":800},24,[43,802,803],{"class":60},"LimitNOFILE=65536         # max open files\n",[43,805,807],{"class":45,"line":806},25,[43,808,232],{"emptyLinePlaceholder":231},[43,810,812],{"class":45,"line":811},26,[43,813,814],{"class":60},"# Protect from OOM killer:\n",[43,816,818],{"class":45,"line":817},27,[43,819,820],{"class":60},"OOMScoreAdjust=-500\n",[43,822,824],{"class":45,"line":823},28,[43,825,232],{"emptyLinePlaceholder":231},[43,827,829],{"class":45,"line":828},29,[43,830,415],{"class":60},[43,832,834],{"class":45,"line":833},30,[43,835,836],{"class":60},"WantedBy=multi-user.target\n",[43,838,840],{"class":45,"line":839},31,[43,841,842],{"class":60},"EOF\n",[43,844,846],{"class":45,"line":845},32,[43,847,232],{"emptyLinePlaceholder":231},[43,849,851,853,855],{"class":45,"line":850},33,[43,852,57],{"class":56},[43,854,61],{"class":60},[43,856,857],{"class":60}," daemon-reload\n",[43,859,861,863,865,867,869],{"class":45,"line":860},34,[43,862,57],{"class":56},[43,864,61],{"class":60},[43,866,64],{"class":60},[43,868,68],{"class":67},[43,870,871],{"class":60}," myapp\n",[43,873,875,878,881,884,887],{"class":45,"line":874},35,[43,876,877],{"class":56},"journalctl",[43,879,880],{"class":67}," -u",[43,882,883],{"class":60}," myapp",[43,885,886],{"class":67}," -f",[43,888,889],{"class":49},"      # follow logs\n",[22,891,893,895],{"id":892},"journalctl-the-log-viewer",[26,894,877],{}," — The Log Viewer",[31,897,898],{"language":33},[35,899,901],{"className":37,"code":900,"language":33,"meta":39,"style":39},"# Complex Implementation: targeted log queries\njournalctl -u nginx -f                         # follow nginx logs (like tail -f)\njournalctl -b -p err                            # current boot, errors only\njournalctl -b -1 -p err                         # PREVIOUS boot, errors (after reboot)\njournalctl --since \"1 hour ago\" --until now\njournalctl -u nginx -u ssh --since today\njournalctl -k                                   # kernel logs only (like dmesg)\njournalctl --list-boots                         # list all boots with timestamps\njournalctl --vacuum-size=500M                   # keep logs under 500 MB\njournalctl -o cat -u myapp                      # just the message (no metadata)\n",[26,902,903,908,921,937,953,969,987,997,1007,1017],{"__ignoreMap":39},[43,904,905],{"class":45,"line":46},[43,906,907],{"class":49},"# Complex Implementation: targeted log queries\n",[43,909,910,912,914,916,918],{"class":45,"line":53},[43,911,877],{"class":56},[43,913,880],{"class":67},[43,915,71],{"class":60},[43,917,886],{"class":67},[43,919,920],{"class":49},"                         # follow nginx logs (like tail -f)\n",[43,922,923,925,928,931,934],{"class":45,"line":77},[43,924,877],{"class":56},[43,926,927],{"class":67}," -b",[43,929,930],{"class":67}," -p",[43,932,933],{"class":60}," err",[43,935,936],{"class":49},"                            # current boot, errors only\n",[43,938,939,941,943,946,948,950],{"class":45,"line":92},[43,940,877],{"class":56},[43,942,927],{"class":67},[43,944,945],{"class":67}," -1",[43,947,930],{"class":67},[43,949,933],{"class":60},[43,951,952],{"class":49},"                         # PREVIOUS boot, errors (after reboot)\n",[43,954,955,957,960,963,966],{"class":45,"line":107},[43,956,877],{"class":56},[43,958,959],{"class":67}," --since",[43,961,962],{"class":60}," \"1 hour ago\"",[43,964,965],{"class":67}," --until",[43,967,968],{"class":60}," now\n",[43,970,971,973,975,977,979,982,984],{"class":45,"line":122},[43,972,877],{"class":56},[43,974,880],{"class":67},[43,976,71],{"class":60},[43,978,880],{"class":67},[43,980,981],{"class":60}," ssh",[43,983,959],{"class":67},[43,985,986],{"class":60}," today\n",[43,988,989,991,994],{"class":45,"line":137},[43,990,877],{"class":56},[43,992,993],{"class":67}," -k",[43,995,996],{"class":49},"                                   # kernel logs only (like dmesg)\n",[43,998,999,1001,1004],{"class":45,"line":151},[43,1000,877],{"class":56},[43,1002,1003],{"class":67}," --list-boots",[43,1005,1006],{"class":49},"                         # list all boots with timestamps\n",[43,1008,1009,1011,1014],{"class":45,"line":245},[43,1010,877],{"class":56},[43,1012,1013],{"class":67}," --vacuum-size=500M",[43,1015,1016],{"class":49},"                   # keep logs under 500 MB\n",[43,1018,1019,1021,1024,1026,1028,1030],{"class":45,"line":251},[43,1020,877],{"class":56},[43,1022,1023],{"class":67}," -o",[43,1025,156],{"class":60},[43,1027,880],{"class":67},[43,1029,883],{"class":60},[43,1031,1032],{"class":49},"                      # just the message (no metadata)\n",[163,1034,1036],{"id":1035},"edge-case-journald-logs-are-lost-on-reboot-by-default","Edge Case: journald Logs Are Lost on Reboot by Default",[31,1038,1039],{"language":33},[35,1040,1042],{"className":37,"code":1041,"language":33,"meta":39,"style":39},"# NAIVE: expect pre-crash logs to survive reboot\n# By default, logs are in \u002Frun\u002Flog\u002Fjournal\u002F (RAM, volatile)\n# PRODUCTION: make logs persistent\nsudo mkdir -p \u002Fvar\u002Flog\u002Fjournal\nsudo systemd-tmpfiles --create --prefix \u002Fvar\u002Flog\u002Fjournal\nsudo systemctl restart systemd-journald\n# Or set Storage=persistent in \u002Fetc\u002Fsystemd\u002Fjournald.conf\n",[26,1043,1044,1049,1054,1059,1071,1086,1097],{"__ignoreMap":39},[43,1045,1046],{"class":45,"line":46},[43,1047,1048],{"class":49},"# NAIVE: expect pre-crash logs to survive reboot\n",[43,1050,1051],{"class":45,"line":53},[43,1052,1053],{"class":49},"# By default, logs are in \u002Frun\u002Flog\u002Fjournal\u002F (RAM, volatile)\n",[43,1055,1056],{"class":45,"line":77},[43,1057,1058],{"class":49},"# PRODUCTION: make logs persistent\n",[43,1060,1061,1063,1066,1068],{"class":45,"line":92},[43,1062,57],{"class":56},[43,1064,1065],{"class":60}," mkdir",[43,1067,930],{"class":67},[43,1069,1070],{"class":60}," \u002Fvar\u002Flog\u002Fjournal\n",[43,1072,1073,1075,1078,1081,1084],{"class":45,"line":107},[43,1074,57],{"class":56},[43,1076,1077],{"class":60}," systemd-tmpfiles",[43,1079,1080],{"class":67}," --create",[43,1082,1083],{"class":67}," --prefix",[43,1085,1070],{"class":60},[43,1087,1088,1090,1092,1094],{"class":45,"line":122},[43,1089,57],{"class":56},[43,1091,61],{"class":60},[43,1093,221],{"class":60},[43,1095,1096],{"class":60}," systemd-journald\n",[43,1098,1099],{"class":45,"line":137},[43,1100,1101],{"class":49},"# Or set Storage=persistent in \u002Fetc\u002Fsystemd\u002Fjournald.conf\n",[22,1103,1105],{"id":1104},"timers-replacing-cron","Timers — Replacing cron",[31,1107,1108],{"language":33},[35,1109,1111],{"className":37,"code":1110,"language":33,"meta":39,"style":39},"# Complex Implementation: systemd timer with catch-up + randomized delay\n# \u002Fetc\u002Fsystemd\u002Fsystem\u002Fbackup.service\n[Unit]\nDescription=Run backup\n[Service]\nType=oneshot\nExecStart=\u002Fopt\u002Fbackup\u002Fbackup.sh\n\n# \u002Fetc\u002Fsystemd\u002Fsystem\u002Fbackup.timer\n[Unit]\nDescription=Daily backup at 2 AM\n[Timer]\nOnCalendar=*-*-* 02:00:00\nPersistent=true               # catch up if missed (e.g., laptop was off)\nRandomizedDelaySec=300        # random 0-300s delay (avoid thundering herd)\n[Install]\nWantedBy=timers.target\n\nsudo systemctl enable --now backup.timer\nsystemctl list-timers\n",[26,1112,1113,1118,1123,1127,1139,1143,1152,1161,1165,1170,1174,1195,1200,1213,1226,1239,1243,1252,1256,1269],{"__ignoreMap":39},[43,1114,1115],{"class":45,"line":46},[43,1116,1117],{"class":49},"# Complex Implementation: systemd timer with catch-up + randomized delay\n",[43,1119,1120],{"class":45,"line":53},[43,1121,1122],{"class":49},"# \u002Fetc\u002Fsystemd\u002Fsystem\u002Fbackup.service\n",[43,1124,1125],{"class":45,"line":77},[43,1126,277],{"class":286},[43,1128,1129,1131,1133,1136],{"class":45,"line":92},[43,1130,283],{"class":286},[43,1132,353],{"class":282},[43,1134,1135],{"class":60},"Run",[43,1137,1138],{"class":56}," backup\n",[43,1140,1141],{"class":45,"line":107},[43,1142,312],{"class":286},[43,1144,1145,1147,1149],{"class":45,"line":122},[43,1146,317],{"class":286},[43,1148,353],{"class":282},[43,1150,1151],{"class":60},"oneshot\n",[43,1153,1154,1156,1158],{"class":45,"line":137},[43,1155,374],{"class":286},[43,1157,353],{"class":282},[43,1159,1160],{"class":60},"\u002Fopt\u002Fbackup\u002Fbackup.sh\n",[43,1162,1163],{"class":45,"line":151},[43,1164,232],{"emptyLinePlaceholder":231},[43,1166,1167],{"class":45,"line":245},[43,1168,1169],{"class":49},"# \u002Fetc\u002Fsystemd\u002Fsystem\u002Fbackup.timer\n",[43,1171,1172],{"class":45,"line":251},[43,1173,277],{"class":286},[43,1175,1176,1178,1180,1183,1186,1189,1192],{"class":45,"line":338},[43,1177,283],{"class":286},[43,1179,353],{"class":282},[43,1181,1182],{"class":60},"Daily",[43,1184,1185],{"class":56}," backup",[43,1187,1188],{"class":60}," at",[43,1190,1191],{"class":67}," 2",[43,1193,1194],{"class":60}," AM\n",[43,1196,1197],{"class":45,"line":347},[43,1198,1199],{"class":286},"[Timer]\n",[43,1201,1202,1205,1207,1210],{"class":45,"line":362},[43,1203,1204],{"class":286},"OnCalendar",[43,1206,353],{"class":282},[43,1208,1209],{"class":60},"*-*-*",[43,1211,1212],{"class":56}," 02:00:00\n",[43,1214,1215,1218,1220,1223],{"class":45,"line":371},[43,1216,1217],{"class":286},"Persistent",[43,1219,353],{"class":282},[43,1221,1222],{"class":60},"true",[43,1224,1225],{"class":49},"               # catch up if missed (e.g., laptop was off)\n",[43,1227,1228,1231,1233,1236],{"class":45,"line":380},[43,1229,1230],{"class":286},"RandomizedDelaySec",[43,1232,353],{"class":282},[43,1234,1235],{"class":60},"300",[43,1237,1238],{"class":49},"        # random 0-300s delay (avoid thundering herd)\n",[43,1240,1241],{"class":45,"line":389},[43,1242,415],{"class":286},[43,1244,1245,1247,1249],{"class":45,"line":398},[43,1246,421],{"class":286},[43,1248,353],{"class":282},[43,1250,1251],{"class":60},"timers.target\n",[43,1253,1254],{"class":45,"line":407},[43,1255,232],{"emptyLinePlaceholder":231},[43,1257,1258,1260,1262,1264,1266],{"class":45,"line":412},[43,1259,57],{"class":56},[43,1261,61],{"class":60},[43,1263,64],{"class":60},[43,1265,68],{"class":67},[43,1267,1268],{"class":60}," backup.timer\n",[43,1270,1271,1273],{"class":45,"line":418},[43,1272,28],{"class":56},[43,1274,1275],{"class":60}," list-timers\n",[163,1277,1279,1280,1283],{"id":1278},"edge-case-oncalendardaily-is-midnight","Edge Case: ",[26,1281,1282],{},"OnCalendar=daily"," Is Midnight",[31,1285,1286],{"language":33},[35,1287,1289],{"className":37,"code":1288,"language":33,"meta":39,"style":39},"# \"daily\" means 00:00:00, not \"24 hours after the last run\"\n# If the system is off at midnight, the run is missed (unless Persistent=true)\n# Use OnUnitActiveSec=24h for \"24h after last run\" instead\n",[26,1290,1291,1296,1301],{"__ignoreMap":39},[43,1292,1293],{"class":45,"line":46},[43,1294,1295],{"class":49},"# \"daily\" means 00:00:00, not \"24 hours after the last run\"\n",[43,1297,1298],{"class":45,"line":53},[43,1299,1300],{"class":49},"# If the system is off at midnight, the run is missed (unless Persistent=true)\n",[43,1302,1303],{"class":45,"line":77},[43,1304,1305],{"class":49},"# Use OnUnitActiveSec=24h for \"24h after last run\" instead\n",[22,1307,1309],{"id":1308},"resource-limits","Resource Limits",[31,1311,1312],{"language":33},[35,1313,1315],{"className":37,"code":1314,"language":33,"meta":39,"style":39},"# In a unit file:\n[Service]\nCPUQuota=50%              # max 50% of one CPU\nMemoryMax=512M            # hard memory limit (OOM-kill if exceeded)\nMemoryHigh=400M           # soft limit (throttle, don't kill)\nTasksMax=100              # max PIDs\nIOWeight=100              # I\u002FO weight (1-10000, default 100)\n\n# Ad-hoc:\nsudo systemd-run --unit=test --CPUQuota=25% --MemoryMax=256M stress --cpu 4\n",[26,1316,1317,1322,1326,1339,1352,1365,1378,1390,1394,1399],{"__ignoreMap":39},[43,1318,1319],{"class":45,"line":46},[43,1320,1321],{"class":49},"# In a unit file:\n",[43,1323,1324],{"class":45,"line":53},[43,1325,312],{"class":286},[43,1327,1328,1331,1333,1336],{"class":45,"line":77},[43,1329,1330],{"class":286},"CPUQuota",[43,1332,353],{"class":282},[43,1334,1335],{"class":60},"50%",[43,1337,1338],{"class":49},"              # max 50% of one CPU\n",[43,1340,1341,1344,1346,1349],{"class":45,"line":92},[43,1342,1343],{"class":286},"MemoryMax",[43,1345,353],{"class":282},[43,1347,1348],{"class":60},"512M",[43,1350,1351],{"class":49},"            # hard memory limit (OOM-kill if exceeded)\n",[43,1353,1354,1357,1359,1362],{"class":45,"line":107},[43,1355,1356],{"class":286},"MemoryHigh",[43,1358,353],{"class":282},[43,1360,1361],{"class":60},"400M",[43,1363,1364],{"class":49},"           # soft limit (throttle, don't kill)\n",[43,1366,1367,1370,1372,1375],{"class":45,"line":122},[43,1368,1369],{"class":286},"TasksMax",[43,1371,353],{"class":282},[43,1373,1374],{"class":60},"100",[43,1376,1377],{"class":49},"              # max PIDs\n",[43,1379,1380,1383,1385,1387],{"class":45,"line":137},[43,1381,1382],{"class":286},"IOWeight",[43,1384,353],{"class":282},[43,1386,1374],{"class":60},[43,1388,1389],{"class":49},"              # I\u002FO weight (1-10000, default 100)\n",[43,1391,1392],{"class":45,"line":151},[43,1393,232],{"emptyLinePlaceholder":231},[43,1395,1396],{"class":45,"line":245},[43,1397,1398],{"class":49},"# Ad-hoc:\n",[43,1400,1401,1403,1406,1409,1412,1415,1418,1421],{"class":45,"line":251},[43,1402,57],{"class":56},[43,1404,1405],{"class":60}," systemd-run",[43,1407,1408],{"class":67}," --unit=test",[43,1410,1411],{"class":67}," --CPUQuota=25%",[43,1413,1414],{"class":67}," --MemoryMax=256M",[43,1416,1417],{"class":60}," stress",[43,1419,1420],{"class":67}," --cpu",[43,1422,1423],{"class":67}," 4\n",[22,1425,1427],{"id":1426},"tips-tricks","💡 Tips & Tricks",[516,1429,1430,1440,1448,1467,1478,1486,1498,1507],{},[519,1431,1432,1435,1436,1439],{},[17,1433,1434],{},"Idiom",": use ",[26,1437,1438],{},"systemctl enable --now \u003Cservice>"," — enables (boot) and starts (now) in one command.",[519,1441,1442,1435,1444,1447],{},[17,1443,1434],{},[26,1445,1446],{},"systemctl status \u003Cservice>"," as your first debug step — shows if the service is active, the main PID, recent log lines, and the cgroup.",[519,1449,1450,1435,1452,1455,1456,1459,1460,1462,1463,1466],{},[17,1451,1434],{},[26,1453,1454],{},"systemctl edit \u003Cservice>"," for overrides (never edit ",[26,1457,1458],{},"\u002Fusr\u002Flib\u002Fsystemd\u002Fsystem\u002F",") — creates a drop-in. Safe across package updates. Always ",[26,1461,168],{}," + ",[26,1464,1465],{},"restart"," after.",[519,1468,1469,1435,1471,1474,1475,477],{},[17,1470,1434],{},[26,1472,1473],{},"journalctl -u \u003Cservice> -f"," for live log tailing — replaces ",[26,1476,1477],{},"tail -f \u002Fvar\u002Flog\u002Ffoo.log",[519,1479,1480,1435,1482,1485],{},[17,1481,1434],{},[26,1483,1484],{},"journalctl -b -p err"," to find boot errors — shows only the current boot and error priority.",[519,1487,1488,1490,1491,1494,1495,1497],{},[17,1489,1434],{},": run ",[26,1492,1493],{},"systemctl daemon-reload"," after editing any unit file — systemd caches unit files; ",[26,1496,168],{}," re-reads them. Forgetting this is the #1 systemd gotcha.",[519,1499,1500,1435,1503,1506],{},[17,1501,1502],{},"Debug",[26,1504,1505],{},"systemd-analyze blame"," to find slow-booting services — lists services by startup time.",[519,1508,1509,1435,1511,1514,1515,1518],{},[17,1510,1502],{},[26,1512,1513],{},"journalctl -b -1"," to see the ",[17,1516,1517],{},"previous"," boot's logs — essential when a reboot fixed (or caused) an issue.",[22,1520,1522],{"id":1521},"️-edge-cases-gotchas","⚠️ Edge Cases & Gotchas",[516,1524,1525,1540,1563,1578,1597,1610,1630],{},[519,1526,1527,1533,1534,1536,1537,1539],{},[17,1528,1529,1530,1532],{},"Forgetting ",[26,1531,168],{}," after editing a unit",": systemd caches unit files in memory. After editing, you MUST run ",[26,1535,1493],{}," before ",[26,1538,1465],{},". Otherwise systemd runs the old version. This is the #1 systemd bug.",[519,1541,1542,1549,1550,1552,1553,1555,1556,1559,1560,477],{},[17,1543,1544,511,1546],{},[26,1545,1465],{},[26,1547,1548],{},"reload",": ",[26,1551,1465],{}," stops and starts (downtime). ",[26,1554,1548],{}," sends the reload signal (often SIGHUP) without stopping (no downtime, if supported). Not all services support reload — check ",[26,1557,1558],{},"systemctl cat"," for ",[26,1561,1562],{},"ExecReload=",[519,1564,1565,1573,1574,1577],{},[17,1566,1567,1570,1571],{},[26,1568,1569],{},"Type=forking"," needs ",[26,1572,476],{},": without it, systemd may think the service died (the parent exited) and kill the children. Use ",[26,1575,1576],{},"Type=simple"," for apps that run in the foreground (preferred).",[519,1579,1580,1549,1583,1586,1587,1590,1591,1593,1594,477],{},[17,1581,1582],{},"Drop-in overrides merge, they don't replace",[26,1584,1585],{},"ExecStart="," in a drop-in ",[17,1588,1589],{},"adds"," to the original (you get two ExecStart lines, which errors). To replace, clear first: ",[26,1592,1585],{}," (empty) then ",[26,1595,1596],{},"ExecStart=\u002Fnew\u002Fcommand",[519,1598,1599,1549,1602,1605,1606,1609],{},[17,1600,1601],{},"User services stop at logout",[26,1603,1604],{},"systemctl --user"," services stop when the user's session ends, unless ",[26,1607,1608],{},"loginctl enable-linger \u003Cuser>"," is set.",[519,1611,1612,1615,1616,1619,1620,1623,1624,1626,1627,477],{},[17,1613,1614],{},"journald logs are lost on reboot by default",": if ",[26,1617,1618],{},"\u002Fvar\u002Flog\u002Fjournal\u002F"," doesn't exist, logs are in ",[26,1621,1622],{},"\u002Frun\u002Flog\u002Fjournal\u002F"," (RAM, volatile). Create ",[26,1625,1618],{}," or set ",[26,1628,1629],{},"Storage=persistent",[519,1631,1632,1549,1635,1638,1639,1642,1643,477],{},[17,1633,1634],{},"Masking prevents all starts",[26,1636,1637],{},"systemctl mask nginx"," makes it impossible to start nginx (even manually) — it links the unit to ",[26,1640,1641],{},"\u002Fdev\u002Fnull",". Undo with ",[26,1644,1645],{},"unmask",[22,1647,1649],{"id":1648},"spot-the-bug","🧠 Spot the Bug",[14,1651,1652,1653,555],{},"An admin edits the nginx service to add an environment variable. They create ",[26,1654,1655],{},"\u002Fetc\u002Fsystemd\u002Fsystem\u002Fnginx.service.d\u002Foverride.conf",[31,1657,1658],{"language":261},[35,1659,1661],{"className":264,"code":1660,"language":261,"meta":39,"style":39},"[Service]\nEnvironment=NGINX_WORKERS=8\nExecStart=\u002Fusr\u002Fsbin\u002Fnginx -g 'daemon off;' --with-debug\n",[26,1662,1663,1667,1679],{"__ignoreMap":39},[43,1664,1665],{"class":45,"line":46},[43,1666,312],{"class":56},[43,1668,1669,1671,1673,1676],{"class":45,"line":53},[43,1670,350],{"class":282},[43,1672,353],{"class":286},[43,1674,1675],{"class":282},"NGINX_WORKERS",[43,1677,1678],{"class":286},"=8\n",[43,1680,1681,1683,1686,1689],{"class":45,"line":77},[43,1682,374],{"class":282},[43,1684,1685],{"class":286},"=\u002Fusr\u002Fsbin\u002Fnginx -g ",[43,1687,1688],{"class":60},"'daemon off;'",[43,1690,1691],{"class":286}," --with-debug\n",[14,1693,1694,1695,1698,1699,1702,1703,1705,1706,1709],{},"They run ",[26,1696,1697],{},"sudo systemctl restart nginx",", but ",[26,1700,1701],{},"systemctl status nginx"," shows the original ",[26,1704,374],{}," (without ",[26,1707,1708],{},"--with-debug",") and the service fails. What happened?",[1711,1712,1713,1717,1720,1758,1763,1786,1831,1867],"details",{},[1714,1715,1716],"summary",{},"Answer",[14,1718,1719],{},"Two issues:",[1721,1722,1723,1735],"ol",{},[519,1724,1725,1730,1731,1734],{},[17,1726,1727,1728,477],{},"Missing ",[26,1729,168],{}," After creating a drop-in, you must run ",[26,1732,1733],{},"sudo systemctl daemon-reload"," before restarting. Without it, systemd uses the cached (old) unit definition. The drop-in wasn't read.",[519,1736,1737,1742,1743,1746,1747,1750,1751,1754,1755,1757],{},[17,1738,1739,1741],{},[26,1740,374],{}," in a drop-in adds, not replaces."," The original unit has ",[26,1744,1745],{},"ExecStart=\u002Fusr\u002Fsbin\u002Fnginx -g 'daemon off;'",". The drop-in adds ",[26,1748,1749],{},"ExecStart=... --with-debug",". Now there are ",[17,1752,1753],{},"two"," ",[26,1756,374],{}," lines — systemd errors (\"ExecStart has multiple lines\") and fails.",[14,1759,1760],{},[17,1761,1762],{},"Fix:",[31,1764,1765],{"language":33},[35,1766,1768],{"className":37,"code":1767,"language":33,"meta":39,"style":39},"# First, clear ExecStart, then set the new one:\nsudo systemctl edit nginx\n",[26,1769,1770,1775],{"__ignoreMap":39},[43,1771,1772],{"class":45,"line":46},[43,1773,1774],{"class":49},"# First, clear ExecStart, then set the new one:\n",[43,1776,1777,1779,1781,1783],{"class":45,"line":53},[43,1778,57],{"class":56},[43,1780,61],{"class":60},[43,1782,190],{"class":60},[43,1784,1785],{"class":60}," nginx\n",[31,1787,1788],{"language":261},[35,1789,1791],{"className":264,"code":1790,"language":261,"meta":39,"style":39},"[Service]\nEnvironment=NGINX_WORKERS=8\nExecStart=                                              # clear the original\nExecStart=\u002Fusr\u002Fsbin\u002Fnginx -g 'daemon off;' --with-debug  # set the new one\n",[26,1792,1793,1797,1807,1817],{"__ignoreMap":39},[43,1794,1795],{"class":45,"line":46},[43,1796,312],{"class":56},[43,1798,1799,1801,1803,1805],{"class":45,"line":53},[43,1800,350],{"class":282},[43,1802,353],{"class":286},[43,1804,1675],{"class":282},[43,1806,1678],{"class":286},[43,1808,1809,1811,1814],{"class":45,"line":77},[43,1810,374],{"class":282},[43,1812,1813],{"class":286},"=                                              ",[43,1815,1816],{"class":49},"# clear the original\n",[43,1818,1819,1821,1823,1825,1828],{"class":45,"line":92},[43,1820,374],{"class":282},[43,1822,1685],{"class":286},[43,1824,1688],{"class":60},[43,1826,1827],{"class":286}," --with-debug  ",[43,1829,1830],{"class":49},"# set the new one\n",[31,1832,1833],{"language":33},[35,1834,1836],{"className":37,"code":1835,"language":33,"meta":39,"style":39},"sudo systemctl daemon-reload\nsudo systemctl restart nginx\nsystemctl cat nginx    # verify the merged result\n",[26,1837,1838,1846,1856],{"__ignoreMap":39},[43,1839,1840,1842,1844],{"class":45,"line":46},[43,1841,57],{"class":56},[43,1843,61],{"class":60},[43,1845,857],{"class":60},[43,1847,1848,1850,1852,1854],{"class":45,"line":53},[43,1849,57],{"class":56},[43,1851,61],{"class":60},[43,1853,221],{"class":60},[43,1855,1785],{"class":60},[43,1857,1858,1860,1862,1864],{"class":45,"line":77},[43,1859,28],{"class":56},[43,1861,156],{"class":60},[43,1863,71],{"class":60},[43,1865,1866],{"class":49},"    # verify the merged result\n",[14,1868,1869,1870,1872,1873,1875,1876,1879],{},"The empty ",[26,1871,1585],{}," line clears the list; the next ",[26,1874,1585],{}," sets the new command. Same applies to ",[26,1877,1878],{},"Environment="," and other list-type keys.",[1881,1882,1883],"style",{},"html pre.shiki code .sdCPZ, html code.shiki .sdCPZ{--shiki-default:#6A737D;--shiki-github-dark:#6A737D}html pre.shiki code .sIsaT, html code.shiki .sIsaT{--shiki-default:#6F42C1;--shiki-github-dark:#B392F0}html pre.shiki code .sJ6F3, html code.shiki .sJ6F3{--shiki-default:#032F62;--shiki-github-dark:#9ECBFF}html pre.shiki code .snvgF, html code.shiki .snvgF{--shiki-default:#005CC5;--shiki-github-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .github-dark .shiki span {color: var(--shiki-github-dark);background: var(--shiki-github-dark-bg);font-style: var(--shiki-github-dark-font-style);font-weight: var(--shiki-github-dark-font-weight);text-decoration: var(--shiki-github-dark-text-decoration);}html.github-dark .shiki span {color: var(--shiki-github-dark);background: var(--shiki-github-dark-bg);font-style: var(--shiki-github-dark-font-style);font-weight: var(--shiki-github-dark-font-weight);text-decoration: var(--shiki-github-dark-text-decoration);}html pre.shiki code .svdQ7, html code.shiki .svdQ7{--shiki-default:#D73A49;--shiki-github-dark:#F97583}html pre.shiki code .ssxIu, html code.shiki .ssxIu{--shiki-default:#24292E;--shiki-github-dark:#E1E4E8}",{"title":39,"searchDepth":53,"depth":53,"links":1885},[1886,1891,1897,1900,1901,1905,1909,1910,1911,1912],{"id":24,"depth":53,"text":1887,"children":1888},"systemctl — The Main Interface",[1889],{"id":165,"depth":77,"text":1890},"daemon-reload — The #1 systemd Gotcha",{"id":257,"depth":53,"text":258,"children":1892},[1893,1895],{"id":427,"depth":77,"text":1894},"Type= Is Critical",{"id":507,"depth":77,"text":1896},"After= vs Requires=",{"id":543,"depth":53,"text":544,"children":1898},[1899],{"id":611,"depth":77,"text":612},{"id":664,"depth":53,"text":665},{"id":892,"depth":53,"text":1902,"children":1903},"journalctl — The Log Viewer",[1904],{"id":1035,"depth":77,"text":1036},{"id":1104,"depth":53,"text":1105,"children":1906},[1907],{"id":1278,"depth":77,"text":1908},"Edge Case: OnCalendar=daily Is Midnight",{"id":1308,"depth":53,"text":1309},{"id":1426,"depth":53,"text":1427},{"id":1521,"depth":53,"text":1522},{"id":1648,"depth":53,"text":1649},"systemd is the init system and service manager on virtually every modern Linux distribution. It starts at boot (PID 1), launches all other services, monitors them, manages logging, networking, timers, and more. This chapter covers unit management, drop-in overrides, timers, resource limits, and the gotchas that cause service failures.","md",{},"\u002Flinux\u002F11-systemd-and-services",{"title":5,"description":1913},"linux\u002F11-systemd-and-services","4G5LpokjaGnnI52t8VaaPSl6mFxBkox3QV-_zAYTi4k",1789924650019]