Thursday 13 July 2017

Systemd ui ไบนารี ตัวเลือก


เริ่มต้นการ Syncthing โดยอัตโนมัติขณะนี้ยังไม่มีการติดตั้งอย่างเป็นทางการสำหรับ Windows อย่างไรก็ตามมีหลายวิธีที่ง่ายขึ้นกำหนดการจัดงานสร้างเมนูงานใหม่ - สร้าง Task. General Tab. Name งานเช่น Syncthing. Check Run ว่าผู้ใช้หรือไม่ ถูกบันทึกไว้หรือไม่แท็บ Tab ตั้งเริ่มงานเมื่อเริ่มต้น เลือกการหน่วงเวลาตรวจสอบว่าได้เปิดใช้งานแล้ว การดำเนินการควรตั้งค่าเป็นเริ่มต้นโปรแกรมป้อนเส้นทางไปยังในสคริปต์ของโปรแกรม ตัวเลือก Enter - no-console - no-browser สำหรับเพิ่มอาร์กิวเมนต์ตัวเลือกแท็บการตั้งค่า แนะนำให้เลือกช่องทำเครื่องหมาย Allow allow to be ทำงานตามความต้องการ Clear check box จาก Stop task ถ้าทำงานนานกว่า แนะนำให้อย่าเริ่มต้นอินสแตนซ์ใหม่สำหรับถ้างานกำลังทำงานอยู่แล้วให้ใช้กฎต่อไปนี้ป้อนรหัสผ่านสำหรับผู้ใช้เครื่องมือของบุคคลที่สามมีอรรถประโยชน์ของ บริษัท อื่นจำนวนหนึ่งซึ่งมุ่งหมายเพื่อแก้ไขปัญหานี้โดยทั่วไป ให้การติดตั้งให้ Syncthing เริ่มทำงานโดยอัตโนมัติและประสบการณ์การใช้งานที่สวยงามยิ่งขึ้นเช่นโดยทำงานเป็นแอ็พพลิเคชัน Windows ที่ถูกต้องแทนที่จะบังคับให้คุณเริ่มต้นเบราว์เซอร์เพื่อโต้ตอบกับ Syncthing เริ่มต้นในการล็อกอินเข้าสู่ระบบ Syncthing เมื่อเข้าสู่ระบบโดยไม่มีหน้าต่างคอนโซล หรือเปิดเบราว์เซอร์ในการเริ่มต้นเป็นเรื่องง่ายค่อนข้างค้นหาลิงก์ที่ถูกต้องของไบนารีของ Windows จากเว็บไซต์ Syncthing เลือก amd64 ถ้าคุณมี Windows รุ่น 64 บิตวางไฟล์ในโฟลเดอร์ syncthing-windows - ใน zip ไปที่ โฟลเดอร์ c syncthing ไปที่โฟลเดอร์ c syncthing ตั้งชื่อไฟล์คลิกขวาที่ไฟล์และเลือก Edit ไฟล์ควรเปิดใน Notepad หรือโปรแกรมแก้ไขข้อความเริ่มต้นของคุณวางคำสั่งต่อไปนี้ลงในไฟล์และบันทึก chang เริ่มต้น Syncthing - no-console - no-browser. Right คลิกที่และกด Create Shortcut. คลิกขวาที่ไฟล์ทางลัด - ทางลัดและคลิก Copy. Click คลิกเริ่มคลิกโปรแกรมทั้งหมดจากนั้นคลิก Startup คลิกขวาที่ Startup แล้วคลิก Open วางทางลัดให้คลิกขวาที่โฟลเดอร์และเลือกวางหรือกด CTRL V การซิงโครไนซ์จะเริ่มต้นโดยอัตโนมัติในครั้งต่อไปที่คุณเปิดเซสชัน Windows ใหม่ไม่มีหน้าต่างคอนโซลหรือเบราเซอร์จะปรากฏขึ้นเข้าถึงอินเทอร์เฟซโดยการเรียกดูไปยังถ้าคุณต้องการ ให้ทำตามคำสั่งต่อไปนี้แทนคำสั่งในขั้นตอนที่ 5. รันเป็นเซอร์วิสที่ไม่ขึ้นกับการเข้าสู่ระบบของผู้ใช้มีข้อควรพิจารณาเกี่ยวกับความปลอดภัยที่สำคัญด้วยวิธีนี้หากคุณไม่ปลอดภัย Syncthing s GUI และ REST API จากนั้นกระบวนการที่ทำงานด้วยสิทธิ์ใด ๆ สามารถอ่านเขียนไฟล์ในระบบไฟล์ของคุณโดยการเปิดการเชื่อมต่อกับ Syncthing ดังนั้นคุณต้องมั่นใจว่าคุณได้ตั้งรหัสผ่าน GUI หรือเรียก Syncthing ว่าเป็นผู้ใช้ที่ไม่ได้รับสิทธิ Syncthing จะเริ่มทำงานเฉพาะเมื่อผู้ใช้ล็อกออนเข้าเครื่องเท่านั้นนี่ไม่เหมาะสำหรับเซิร์ฟเวอร์ที่เครื่องสามารถรันได้นานหลังจากรีบูตโดยไม่มีใครเข้าสู่ระบบในกรณีนี้เป็นการดีที่สุดในการสร้างบริการที่รันทันทีที่ Windows เริ่มทำงาน นี้สามารถทำได้โดยใช้ NSSM, ผู้จัดการบริการไม่ Sucking หมายเหตุว่าการเริ่มต้น Syncthing ในการเข้าสู่ระบบเป็นวิธีที่ต้องการสำหรับเกือบทุกสถานการณ์ผู้ใช้ปลายทางสถานการณ์เฉพาะที่ทำงาน Syncthing เป็นบริการที่เหมาะสมสำหรับเซิร์ฟเวอร์ส่วนใหญ่เป็นหัวโดยบริหารงานโดย ผู้ดูแลระบบที่รู้มากพอที่จะเข้าใจผลกระทบด้านความปลอดภัยดาวน์โหลดและแยก nssm ไปยังโฟลเดอร์ที่สามารถอยู่ได้ NSSM ปฏิบัติการดำเนินการบริหารเช่นเดียวกับการดำเนินการเป็นบริการของ Windows จึงจะต้องถูกเก็บไว้ในสถานที่ที่เหมาะสมจากผู้ดูแลระบบ Command Prompt, CD ไปยังโฟลเดอร์ NSSM และเรียกใช้ install syncthing service name. Application Tab. Set เส้นทางไปที่และใส่ - no-restart-no-browser - home เส้นทางไปยังโฟลเดอร์ Syncthing a. s อาร์กิวเมนต์หมายเหตุการบันทึกถูกตั้งค่าในภายหลังในแฟ้มบันทึกที่นี่จะไม่ถูกนำไปใช้งานรายละเอียดแท็บชุดการตั้งค่าเริ่มต้นเป็นระยะเวลาล่าช้าอัตโนมัติเริ่มต้นเพื่อหน่วงเวลาเริ่มต้นของ Syncthing เมื่อระบบบูทแรกเพื่อปรับปรุงความเร็วในการบูตให้ป้อนบัญชีผู้ใช้ที่จะเรียกใช้ การซิงโครไนซ์เป็นผู้ใช้รายนี้จำเป็นต้องมีสิทธิ์เข้าถึง Syncthing executable และโฟลเดอร์หลักโฟลเดอร์การกำหนดค่าไฟล์และโฟลเดอร์ที่มีการซิงค์คุณสามารถปล่อยให้เป็น Local System แต่ทำเช่นนั้นได้ทำให้เกิดความเสี่ยงด้านความปลอดภัยการตั้งค่านี้ลงในบัญชีผู้ใช้ Windows ของคุณจะลดความนึกคิด บัญชีผู้ใช้โดยเฉพาะที่มีสิทธิ์น้อยที่สุดการประมวลผล TabOptional Change priority เป็น Low หากคุณต้องการระบบที่ตอบสนองต่อค่าใช้จ่ายของเวลาในการซิงค์นานขึ้นเมื่อระบบไม่ว่าง Options เพื่อเปิดใช้งานการเข้าสู่ระบบ Console window. Shutdown Tab. To เพื่อให้แน่ใจว่า Syncthing ถูกปิดลงอย่างสง่างามเลือกช่องทำเครื่องหมายทั้งหมดและตั้งค่า Timeouts ทั้งหมดเป็น 10000ms. Exit แท็บการดำเนินการตั้งค่าเริ่มต้นการดำเนินการเพื่อหยุดโหมดการตั้งค่าโหมดการให้บริการโหมดการตั้งค่าเฉพาะเจาะจงคือ ใช้ในภายหลังสำหรับการจัดการ Syncthing ออกรีสตาร์ทและอัพเกรด Optional เพื่อเปิดใช้งานการบันทึกการตั้งค่าเอาท์พุท stdout ไปยังแฟ้มที่ต้องการสำหรับการเข้าสู่ระบบเขตข้อมูลข้อผิดพลาดจะถูกตั้งค่าโดยอัตโนมัติไปยังแฟ้มเดียวกัน FileFile Rotation Tab. Optional ตั้งค่าการหมุนไปตามค่าของคุณคลิก ติดตั้ง Service Button เพื่อให้แน่ใจว่า Syncthing ออกจากระบบการรีสตาร์ทและการอัพเกรดถูกจัดการอย่างถูกต้องโดยผู้จัดการฝ่ายบริการ Windows จำเป็นต้องมีการตั้งค่าขั้นสุดท้ายดำเนินการเหล่านี้ใน Commant Prompt. nssm เดียวกัน Synchronming ตั้งค่า AppExit Default Exit. nssm set syncthing AppExit 0 Exit nssm set syncthing AppExit 3 Restart. nssm ตั้งค่า syncthing AppExit 4 Restart เริ่มสตาร์ทบริการผ่าน sc start syncthing ใน Command Prompt. Connect เพื่อ Syncthing UI เปิดใช้งานและตั้งชื่อผู้ใช้และรหัสผ่านที่ปลอดภัยโดยใช้ homebrew. brew ติดตั้ง syncthing ทำตามขั้นตอนต่อไปนี้ ข้อมูลที่นำเสนอโดยชงเพื่อ autostart Syncthing โดยใช้ launchctl. Without homebrew. Copy ไบนารี syncthing ไฟล์ที่คุณจะเปิดเพื่อเปิด Syncthing ลงในไดเรกทอรี calle d bin ในโฮมไดเร็กตอรี่ของฉัน i ไปที่ bin ชื่อผู้ใช้ที่บ้านถ้า bin ไม่มีอยู่ให้สร้างมัน Opened in etc macosx-launchd แทนที่สี่สิ่งที่เกิดขึ้นของ Users USERNAME กับตำแหน่งไดเร็กทอรีโฮมที่แท้จริงของคุณคัดลอกไฟล์ไว้ Library LaunchAgents หากคุณมีปัญหาในการค้นหาตำแหน่งนี้ให้เลือกเมนู Go ใน Finder และเลือก Go to folder จากนั้นพิมพ์ ไลบรารี LaunchAgents การคัดลอกไปที่ ไลบรารี LaunchAgents จะต้องใช้รหัสผ่านผู้ดูแลระบบในกรณีส่วนใหญ่เรียกออกและกลับเข้ามาใหม่อีกครั้งหรือถ้าคุณไม่ต้องการออกจากระบบคุณสามารถเรียกใช้คำสั่งนี้ได้ในโหลด launchctl terminal หมายเหตุคุณอาจต้องการปิดการเริ่มเบราว์เซอร์ในเว็บ GUI การตั้งค่าเพื่อหลีกเลี่ยงการเปิดหน้าต่างเบราว์เซอร์ในการเข้าสู่ระบบแต่ละครั้งแล้วเพื่อเข้าสู่ GUI ประเภท 127 0 0 1 8384 โดยค่าเริ่มต้นใน Safari ในระบบ Ubuntu - like. Launch โปรแกรม Startup Applications. Fill ออก Form. Name Syncthingmand เส้นทางการ syncthing binary-no-browser - home การใช้ Supervisord เพิ่มไฟล์ต่อไปนี้ลงในไฟล์ config ของ Supervisor ไฟล์นี้อยู่ที่ Debian Ubuntu หรือการใช้ systemd. systemd คือชุดของ daemons, libraries และ utility management ที่ออกแบบมาเพื่อเป็นศูนย์กลางการจัดการ และแพลตฟอร์มการกำหนดค่าสำหรับระบบปฏิบัติการคอมพิวเตอร์ Linux นอกจากนี้ยังมีผู้ใช้สามารถจัดการบริการภายใต้การควบคุมของผู้ใช้ด้วยอินสแตนซ์ systemd ต่อผู้ใช้ทำให้ผู้ใช้สามารถเริ่มต้นหยุดเปิดใช้งานและปิดใช้งานไฟล์ของตนเองได้ไฟล์บริการสำหรับ systemd มีให้โดย Syncthing และสามารถพบได้ใน etc linux-systemd คุณมีตัวเลือกหลักสองตัวเลือกคุณสามารถตั้งค่า Syncthing เป็นบริการระบบหรือบริการของผู้ใช้การ Syncthing การทำงานร่วมกันเป็นบริการระบบเพื่อให้แน่ใจว่า Syncthing จะรันเมื่อเริ่มต้นแม้ว่า ผู้ใช้ Syncthing ไม่มีเซสชันที่มีการใช้งานเนื่องจากบริการระบบช่วยให้ Syncthing ทำงานได้โดยไม่ต้องใช้เซสชันของผู้ใช้ที่ใช้งานอยู่เซิร์ฟเวอร์นี้จึงมีวัตถุประสงค์เพื่อใช้งานบนเซิร์ฟเวอร์การ Synchronhing การทำงานร่วมกันเป็นบริการผู้ใช้จะทำให้ Syncthing เริ่มทำงานหลังจากที่ผู้ใช้เข้าสู่ระบบเท่านั้น เช่นผ่านทางหน้าจอการเข้าสู่ระบบแบบกราฟิกหรือ ssh ดังนั้นบริการของผู้ใช้มีวัตถุประสงค์เพื่อใช้กับคอมพิวเตอร์เดสก์ท็อปหลายคนหลีกเลี่ยงการใช้อินสแตนซ์ Syncthing โดยไม่ได้ตั้งใจ Distances รวมถึง linux arch จัดส่งไฟล์บริการที่จำเป็นด้วยแพคเกจ Syncthing ถ้า distro ของคุณมี ไฟล์บริการระบบสำหรับ Syncthing คุณสามารถข้ามขั้นตอนที่ 2 เมื่อตั้งค่าบริการระบบหรือบริการผู้ใช้ตามที่อธิบายไว้ด้านล่างวิธีตั้งค่าบริการระบบ กินผู้ใช้ที่ควรใช้บริการหรือเลือกหนึ่งที่มีอยู่สำเนา Syncthing etc Syncthing ระบบไฟล์ลงในเส้นทางโหลดของระบบเช่นเปิดใช้งานและเริ่มบริการแทนที่ myuser กับผู้ใช้ Syncthing จริงหลังจาก the. How การตั้งค่า บริการผู้ใช้สร้างผู้ใช้ที่ควรใช้บริการหรือเลือกที่มีอยู่หนึ่งอาจเป็นบัญชีผู้ใช้ของคุณเองคัดลอกไฟล์ลงในเส้นทางการโหลดของอินสแตนซ์ของผู้ใช้เมื่อต้องการทำเช่นนี้โดยไม่มีสิทธิ์ของ root คุณสามารถใช้โฟลเดอร์นี้ได้ ภายใต้ไดเรกทอรีบ้านของคุณเปิดใช้งานและเริ่มต้นบริการตรวจสอบสถานะของบริการหากต้องการตรวจสอบว่าการ Syncthing ทำงานอย่างถูกต้องหรือไม่คุณสามารถใช้ subcommand สถานะเพื่อตรวจสอบสถานะของ system system. systemd คือชุดของ Building Block ขั้นพื้นฐานสำหรับระบบ Linux ให้การจัดการระบบและบริการที่ทำงานเป็น PID 1 และเริ่มต้นส่วนที่เหลือของระบบ systemd ให้ความสามารถแบบขนานก้าวร้าวใช้ซ็อกเก็ตและการเปิดใช้งาน D-Bus สำหรับการเริ่มต้นบริการเสนอการเริ่มต้นของ daemons ตามต้องการ , การติดตามกระบวนการโดยใช้กลุ่มควบคุมลินุกซ์รักษาจุดเมานท์และจุดอัตโนมัติและใช้ระบบควบคุมการบริการที่อิงกับการทำธุรกรรมบนระบบทรานแซคชันรองรับโปรโตคอล SysV และ LSB init และทำงานแทน sysvinit ส่วนอื่น ๆ รวมถึง daemon การเข้าระบบสาธารณูปโภคเพื่อควบคุม การกำหนดค่าระบบพื้นฐานเช่นชื่อโฮสต์วันที่ตำแหน่งที่ตั้งรักษารายชื่อผู้ใช้ที่เข้าสู่ระบบและใช้คอนเทนเนอร์และเครื่องเสมือนบัญชีระบบไดเรกทอรีรันไทม์และการตั้งค่าและ daemons เพื่อจัดการการกำหนดค่าเครือข่ายที่เรียบง่ายการซิงค์เวลาเครือข่ายการส่งต่อการเข้าสู่ระบบและ ชื่อ resolution. Note สำหรับคำอธิบายรายละเอียดว่าทำไม Arch ได้ย้ายไปที่ systemd ดูการโพสต์ฟอรัมนี้การใช้งาน systematic ของ systemic คำสั่งหลักที่ใช้ในการวิปัสสนาและการควบคุม systemd คือ systemctl การใช้งานบางส่วนจะตรวจสอบสถานะของระบบและการจัดการระบบและ services mancat systeml สำหรับรายละเอียดเพิ่มเติมคุณสามารถใช้คำสั่ง systemctl ต่อไปนี้ทั้งหมดได้โดยใช้โฮสต์ - h host ของผู้ใช้ tch เพื่อควบคุมอินสแตนซ์ systemd บนเครื่องระยะไกลซึ่งจะใช้ SSH เพื่อเชื่อมต่อกับ remote systemd instance. systemadm เป็นส่วนหน้าของระบบอย่างเป็นทางการสำหรับ systemctl และมีให้โดยแพ็กเกจ systemd-ui ผู้ใช้ plasma สามารถติดตั้ง systemd-kcm เป็นแบบกราฟิก fronted for systemctl หลังจากติดตั้งโมดูลจะถูกเพิ่มภายใต้การบริหารระบบการวิเคราะห์สถานะของระบบแสดงสถานะของระบบโดยใช้รายการการทำงาน units. List units ที่ล้มเหลวไฟล์ units ที่มีอยู่สามารถเห็นได้ใน usr lib systemd system และ systemd systemd อื่น ๆ หลัง จะมีลำดับความสำคัญรายการไฟล์หน่วยที่ติดตั้งพร้อมกับการใช้หน่วยงานสามารถวางตัวอย่างเช่นบริการจุดเชื่อมต่ออุปกรณ์หรือซ็อกเก็ตเมื่อใช้ systemctl โดยทั่วไปคุณต้องระบุชื่อไฟล์ทั้งหมดของไฟล์หน่วยรวมทั้งส่วนต่อท้ายเช่นมี มีเพียงไม่กี่รูปแบบสั้น ๆ เมื่อระบุหน่วยในคำสั่ง systemctl ต่อไปนี้หากคุณไม่ได้ระบุส่วนต่อท้าย systemctl จะถือว่าตัวอย่างเช่น netctl และเทียบเท่ากับเมธอด Poin ts จะถูกแปลเป็นหน่วยที่เหมาะสมตัวอย่างเช่นการระบุที่อยู่อาศัยเทียบเท่ากับจุดที่ติดตั้งอุปกรณ์จะถูกแปลเป็นหน่วยที่เหมาะสมโดยอัตโนมัติดังนั้นการระบุ dev sda2 จะเทียบเท่ากับโปรดดูรายละเอียดเพิ่มเติมหมายเหตุบางชื่อหน่วยมี เครื่องหมายเช่นสตริงชื่อซึ่งหมายความว่าพวกเขาเป็นอินสแตนซ์ของเทมเพลตที่มีชื่อไฟล์จริงไม่ได้มีส่วนสตริงเช่นเชือกเรียกว่าตัวระบุอินสแตนซ์และคล้ายกับอาร์กิวเมนต์ที่ถูกส่งผ่านไปยังเทมเพลตเทมเพลตเมื่อเรียกด้วย คำสั่ง systemctl ในไฟล์หน่วยมันจะแทน specifier. To ฉันจะถูกต้องมากขึ้นก่อนที่จะพยายามที่จะสร้างหน่วยแม่แบบ systemd จริงจะมองหาหน่วยที่มีชื่อไฟล์ที่แน่นอนแม้ว่าโดยการประชุมการปะทะกันดังกล่าวเกิดขึ้นไม่ค่อยคือส่วนใหญ่ ไฟล์หน่วยที่มีเครื่องหมายจะหมายถึงเทมเพลตนอกจากนี้ถ้าหน่วยเทมเพลตถูกเรียกใช้โดยไม่มีตัวระบุอินสแตนซ์จะล้มเหลวเนื่องจากตัวระบุ i ไม่สามารถ su bstituted. Most ของคำสั่งต่อไปนี้ยังทำงานถ้าหลายหน่วยมีการระบุให้ดู man systemctl สำหรับข้อมูลเพิ่มเติม - สวิตช์นี้สามารถใช้ร่วมกับเปิดใช้งานการปิดการใช้งานและมาสก์เพื่อเริ่มต้นหยุดหรือหน้ากากทันทีหน่วยมากกว่า หลังจากแพ็คเกจการบูตครั้งต่อไปแพคเกจอาจมีหน่วยสำหรับวัตถุประสงค์ที่แตกต่างกันหากคุณเพิ่งติดตั้งแพคเกจ pacman - Qql package grep - Fe - e สามารถใช้เพื่อตรวจสอบและค้นหาได้เริ่มต้นหน่วยทันทีหยุดหน่วยทันทีขอให้สังเกต เพื่อแสดงสถานะของหน่วยรวมทั้งไม่ว่าจะทำงานหรือไม่ตรวจสอบว่ามีการเปิดใช้งานหน่วยหรือไม่เปิดใช้งานหน่วยที่จะเริ่มต้นในการเริ่มต้นระบบปิดใช้งานหน่วยที่จะไม่เริ่มทำงานในระหว่างการบูตเครื่อง หน่วยที่จะทำให้มันเป็นไปไม่ได้ที่จะเริ่มต้นมันแสดงว่าหน้าคู่มือที่เกี่ยวข้องกับหน่วยนี้จะต้องได้รับการสนับสนุนโดยไฟล์หน่วยโหลดระบบการสแกนสำหรับหน่วยใหม่หรือการเปลี่ยนแปลงการจัดการ power. polkit เป็นสิ่งที่จำเป็นสำหรับการจัดการพลังงานในฐานะผู้ใช้ที่ไม่มีสิทธิ์ ถ้าคุณอยู่ในท้องถิ่น เซสชั่นผู้ใช้ systemd-logind และไม่มีเซสชันอื่นทำงานคำสั่งต่อไปนี้จะทำงานโดยไม่มีสิทธิ์ของ root ถ้าไม่ใช่เช่นผู้ใช้อื่นเข้าสู่ TTY systemd จะขอรหัสผ่าน root โดยอัตโนมัติให้คุณปิดระบบและรีบูตระบบใหม่ ปิดและปิดระบบปิดระบบวางระบบลงในโหมดไฮเบอร์เนตวางระบบลงในสถานะไฮบริดสลีปหรือระงับการทำงานชั่วคราวเพื่อสร้างไฟล์หน่วยความจำไวยากรณ์ของไฟล์หน่วยของ systemd ได้รับแรงบันดาลใจจาก XDG ไฟล์รายการเดสก์ท็อปรายการซึ่งจะได้รับแรงบันดาลใจจากไฟล์ Microsoft Windows ไฟล์หน่วยจะโหลดจากสองตำแหน่งจากลำดับความสำคัญต่ำสุดไปจนถึงสูงสุด usr lib systemd หน่วยระบบที่จัดเตรียมโดยแพ็คเกจที่ติดตั้งไว้ etc systemd units ระบบที่ติดตั้งโดยผู้ดูแลระบบเส้นทางการโหลดจะแตกต่างกันอย่างสิ้นเชิงเมื่อใช้ systemd ใน user. systemd ชื่อผู้ใช้โหมดสามารถมีอักขระที่เป็นตัวเลขและตัวอักษร ASCII เครื่องหมายขีดล่างและช่วงเวลาอักขระอื่น ๆ ทั้งหมดต้องถูกแทนที่ด้วย C-style x2d escapes ดู man และ man systemd-escape สำหรับข้อมูลเพิ่มเติมดูที่หน่วยที่ติดตั้งโดยแพคเกจของคุณสำหรับตัวอย่างเช่นเดียวกับส่วนตัวอย่างที่มีคำอธิบายประกอบของ man ข้อคิดเห็นเกี่ยวกับตัวเติมอาจใช้ในไฟล์หน่วยได้เช่นกัน แต่เฉพาะในบรรทัดใหม่เท่านั้น ไม่ใช้ความคิดเห็นบรรทัดสุดท้ายหลังจากพารามิเตอร์ systemd หรือหน่วยจะไม่สามารถเปิดใช้งานการจัดการกับการพึ่งพาด้วย dependencies systemd สามารถแก้ไขได้โดยการออกแบบไฟล์หน่วยอย่างถูกต้องกรณีทั่วไปมากที่สุดคือหน่วย A ต้องใช้หน่วย B ที่จะทำงานก่อนที่จะ จะเริ่มขึ้นในกรณีดังกล่าวให้เพิ่ม Requires B และ After B ไปที่ Unit ของ A ถ้า dependency เป็นทางเลือกให้เพิ่ม Wants B และ After B แทนหมายเหตุว่าต้องการและ Requires ไม่ได้หมายความว่า meanin g ถ้าหากไม่ได้ระบุไว้หน่วยทั้งสองจะเริ่มทำงานแบบคู่ขนานการพึ่งพาอาศัยกันโดยทั่วไปจะอยู่ในบริการและไม่อยู่ในเป้าหมายตัวอย่างเช่นถูกดึงเข้าโดยบริการใดก็ตามที่กำหนดค่าอินเทอร์เฟซเครือข่ายของคุณดังนั้นจึงสั่งหน่วยที่กำหนดเองของคุณหลังจากที่เพียงพอแล้ว เนื่องจากมีการเริ่มทำงานอยู่แล้วประเภทการบริการมีหลายประเภทเริ่มต้นที่แตกต่างกันเพื่อพิจารณาเมื่อเขียนไฟล์เซอร์วิสที่กำหนดเองซึ่งตั้งค่าไว้กับพารามิเตอร์ Type ในส่วน Service type ของระบบเริ่มต้นที่เรียบง่าย systemd จะพิจารณาบริการที่จะเริ่มทำงานทันที ต้องไม่ส้อมห้ามใช้ประเภทนี้หากจำเป็นต้องสั่งซื้อบริการอื่น ๆ ในบริการนี้เว้นเสียแต่ว่าจะมีการเปิดใช้งานซ็อกเก็ตระบบ forking แบบแท่นพิจารณาถึงบริการที่เริ่มต้นขึ้นเมื่องอกระบวนการและผู้ปกครองได้ออกไปแล้วสำหรับ daemons แบบคลาสสิกใช้ประเภทนี้ยกเว้นกรณีที่คุณ รู้ว่ามันไม่จำเป็นคุณควรระบุ PIDFile เช่นกันดังนั้น systemd สามารถติดตามกระบวนการหลัก oneshot นี้จะเป็นประโยชน์สำหรับสคริปต์ที่ทำงานเดียว a. nd then exit คุณอาจต้องการตั้งค่า RemainAfterExit yes ด้วยเช่นกันเพื่อให้ systemd ยังคงพิจารณาว่าบริการดังกล่าวทำงานหลังจากที่กระบวนการได้ดำเนินการออกไปแล้วพิมพ์แจ้งให้ทราบเหมือนกันกับ Type แบบธรรมดา แต่มีข้อกำหนดว่า daemon จะส่งสัญญาณไปยัง systemd เมื่อพร้อมแล้ว การดำเนินการอ้างอิงสำหรับการแจ้งเตือนนี้มีให้โดย. ประเภท dbus บริการจะถือว่ามีความพร้อมเมื่อ BusName ที่ระบุปรากฏบนบัสระบบของ DBus ระบบไม่ได้ใช้งาน system id จะทำให้การดำเนินงานของบริการไบนารีล่าช้าไปเรื่อย ๆ จนกว่าจะมีการส่งงานทั้งหมด พิมพ์ง่ายดูหน้า man สำหรับคำอธิบายรายละเอียดเพิ่มเติมเกี่ยวกับค่า Type การกำหนดหน่วยที่จัดไว้ให้เพื่อหลีกเลี่ยงความขัดแย้งกับ pacman ไฟล์หน่วยที่จัดเตรียมโดยแพ็คเกจไม่ควรแก้ไขโดยตรงมีสองวิธีที่ปลอดภัยในการแก้ไขหน่วยโดยไม่ต้องสัมผัส ไฟล์ต้นฉบับสร้างไฟล์หน่วยใหม่ซึ่งจะแทนที่หน่วยต้นฉบับหรือสร้างตัวอย่างข้อมูลแบบหล่นลงซึ่งจะใช้กับส่วนต้นของหน่วยต้นฉบับสำหรับทั้งสองวิธีคุณต้องทำใหม่ โหลดหน่วยหลังจากใช้การเปลี่ยนแปลงของคุณซึ่งสามารถทำได้โดยการแก้ไขหน่วยที่มีการแก้ไข systemctl ซึ่งจะโหลดหน่วยใหม่โดยอัตโนมัติหรือโดยโหลดหน่วยทั้งหมดด้วยคุณสามารถใช้ systemd-delta เพื่อดูว่าไฟล์หน่วยใดถูกแทนที่หรือขยายและอะไร ได้รับการเปลี่ยนแปลงแล้วใช้หน่วย catcatl เพื่อดูเนื้อหาของไฟล์หน่วยและตัวอย่างข้อมูล drop-in ที่เกี่ยวข้องทั้งหมดการเน้นยูนิกซ์สำหรับไฟล์ unit systemd ภายใน Vim สามารถใช้งานได้โดยการติดตั้ง vim-systemd. Replacement unit files. เพื่อแทนที่หน่วย ไฟล์ usr lib systemd หน่วยสร้างไฟล์ etc systemd หน่วยระบบและ reenable หน่วยเพื่อปรับปรุง symlinks. This เปิด etc systemd หน่วยระบบในการแก้ไขของคุณคัดลอกรุ่นที่ติดตั้งถ้ามันไม่ได้อยู่และโหลดโดยอัตโนมัติเมื่อคุณเสร็จสิ้นการแก้ไข หมายเหตุ: Pacman ไม่ปรับปรุงแฟ้มหน่วยทดแทนเมื่อมีการปรับปรุงต้นฉบับดังนั้นวิธีนี้สามารถทำให้การบำรุงรักษาระบบยากขึ้นด้วยเหตุนี้แนะนำวิธีต่อไปนี้ op-in files เพื่อสร้างไฟล์แบบ drop-in สำหรับไฟล์ unit usr lib systemd สร้างหน่วยงาน systemd และวางไฟล์ที่มีอยู่เพื่อแทนที่หรือเพิ่ม option ใหม่ systemd จะแยกไฟล์เหล่านี้ออกและนำไปใช้งานด้านบนของไฟล์ หน่วยที่เป็นต้นฉบับวิธีที่ง่ายที่สุดในการทำเช่นนี้คือการเรียกใช้ไฟล์นี้จะเปิดไฟล์ระบบอื่น ๆ ในหน่วยประมวลผลข้อความของคุณในเครื่องแก้ไขข้อความของคุณโดยจะสร้างขึ้นใหม่หากจำเป็นและโหลดชุดอุปกรณ์ใหม่โดยอัตโนมัติเมื่อคุณทำเสร็จแล้วแก้ไขให้ย้อนกลับไปเป็นเวอร์ชันของผู้ขาย หน่วยทำโดยใช้ systemctl แก้ไขตัวอย่างเช่นถ้าคุณเพียงต้องการเพิ่มการพึ่งพาเพิ่มเติมไปยังหน่วยคุณอาจสร้างแฟ้มต่อไปนี้เป็นอีกตัวอย่างหนึ่งเพื่อที่จะแทนที่ ExecStart directive สำหรับหน่วยที่ไม่ใช่ประเภท oneshot สร้างแฟ้มต่อไปนี้หมายเหตุวิธี ExecStart ต้องถูกล้างก่อนที่จะถูกกำหนดใหม่ 1 ถือเหมือนกันสำหรับทุกรายการที่สามารถระบุได้หลายครั้งเช่น OnCalendar สำหรับ timers. One เพิ่มเติมตัวอย่างเพื่อรีสตาร์ทโดยอัตโนมัติบริการบทความนี้หรือ n ส่วน eeds ภาษาไวยากรณ์วิกิพีเดียหรือการปรับปรุงรูปแบบอธิบายเหตุผลที่ไม่ชัดเจนเนื้อหาคัดลอกวางอย่างชัดเจนกล่าวถึง Fedora พูดคุยใน Talk Systemd Make ส่วนเป้าหมายมากขึ้นอย่างชัดเจน target. systemd ใช้เป้าหมายที่ทำหน้าที่คล้ายกับ runlevels แต่ทำหน้าที่แตกต่างกันเล็กน้อยแต่ละเป้าหมายมีชื่อแทน ของจำนวนและมีจุดมุ่งหมายเพื่อตอบสนองวัตถุประสงค์เฉพาะกับความเป็นไปได้ของการมีหลายคนที่ใช้งานในเวลาเดียวกันบางเป้าหมาย s จะดำเนินการโดยสืบทอดบริการทั้งหมดของเป้าหมายอื่นและเพิ่มบริการเพิ่มเติมเพื่อให้มีเป้าหมาย systemd ที่เลียนแบบ runlevels SystemVinit ทั่วไปเพื่อให้คุณสามารถเปลี่ยนเป้าหมายโดยใช้คำสั่ง RUNLEVEL telinit ที่คุ้นเคยเรียกใช้เป้าหมายปัจจุบันควรใช้ภายใต้ systemd แทนที่จะใช้ runlevel สร้างเป้าหมายแบบกำหนดเอง runlevel ที่มีความหมายที่กำหนดไว้ภายใต้ sysvinit คือ 0, 1 , 3, 5, และ 6 มีการแมป 1 1 กับเป้าหมาย systemd ที่เฉพาะเจาะจง แต่น่าเสียดายที่ไม่มีวิธีที่ดีในการทำเช่นเดียวกันสำหรับผู้ใช้ - runlevels ที่กำหนดไว้เช่น 2 และ 4 ถ้าคุณใช้ประโยชน์จากข้อเสนอแนะให้คุณตั้งค่าเป้าหมาย systemd ใหม่เป็นระบบ systemd อื่น ๆ เป้าหมายของคุณที่ใช้ runlevel เป็นหนึ่งในพื้นฐานที่คุณสามารถดูเป็นตัวอย่างให้สร้างไดเร็กทอรี etc systemd ระบบเป้าหมายของคุณแล้ว symlink บริการเพิ่มเติมจาก usr lib systemd ระบบที่คุณต้องการ enable. Targets table. Change ปัจจุบัน target. In เป้าหมาย systemd จะเปิดเผยผ่านหน่วยเป้าหมายคุณสามารถเปลี่ยนได้เช่นนี้ซึ่งจะเปลี่ยนปัจจุบัน target และไม่มีผลต่อการบูตครั้งถัดไปคำสั่งนี้จะเหมือนกับคำสั่งเช่น telinit 3 หรือ telinit 5 ใน Sysvinit. Change target เริ่มต้นที่จะบูตเข้าสู่ target มาตรฐานซึ่งเป็น aliased โดยค่าเริ่มต้นซึ่งสอดคล้องกับ runlevel เดิม 5 เมื่อต้องการเปลี่ยนค่าเริ่มต้นเป้าหมายเมื่อบูตเวลาให้เพิ่มพารามิเตอร์เคอร์เนลต่อไปนี้ลงในบัฟเฟอร์ของคุณ ซึ่งสอดคล้องกับ runlevel เดิม 3. ซึ่งสอดคล้องกับ runlevel เก่า 1.Alternatively คุณอาจปล่อยให้ bootloader เพียงอย่างเดียวและเปลี่ยนแปลงสิ่งนี้สามารถทำได้โดยใช้ systemctl เพื่อให้สามารถแทนที่การตั้งค่าก่อนหน้านี้ได้ใช้ตัวเลือก force effect effect ของคำสั่งนี้จะแสดงผลโดย systemctl การเชื่อมต่อแบบ symlink กับเป้าหมายเริ่มต้นใหม่จะทำที่ อ่านไฟล์การกำหนดค่าใน etc tmpfiles d และ usr lib tmpfiles d เพื่อค้นหาว่าการกระทำใดที่จะทำไฟล์การกำหนดค่าในไดเร็กทอรีเดิมจะมีความสำคัญมากกว่าสิ่งที่อยู่ในไดเรคทอรี่หลังการกำหนดค่า ไฟล์มักมีพร้อมกับไฟล์เซอร์วิสและมีชื่ออยู่ในรูปแบบของโปรแกรม usr lib tmpfiles d ตัวอย่างเช่น samba daemon คาดว่าไดเร็กทอรี samba จะทำงานและมีสิทธิ์ที่ถูกต้องดังนั้นแพคเกจ samba จึงมาพร้อมกับคอนฟิกูเรชันนี้ ไฟล์คอนฟิกูเรชันอาจถูกใช้เพื่อเขียนค่าลงในไฟล์บางไฟล์ในการบู๊ตตัวอย่างเช่นถ้าคุณใช้เพื่อปิดใช้งาน wakeup จากอุปกรณ์ USB ที่มี echo USBE proc acpi wakeup คุณอาจใช้ tmpfile ต่อไปนี้แทนให้ดูที่ systemd-tmpfiles 8 และ tmpfiles d. 5 man pages สำหรับรายละเอียดหมายเหตุวิธีนี้อาจใช้ไม่ได้ในการตั้งค่าตัวเลือกใน sys เนื่องจากเซอร์วิส systemd-tmpfiles-setup อาจทำงานได้ก่อน dev ที่เหมาะสม โมดูลน้ำแข็งจะถูกโหลดในกรณีนี้คุณสามารถตรวจสอบว่าโมดูลมีพารามิเตอร์สำหรับตัวเลือกที่คุณต้องการตั้งค่าด้วยโมดูล modinfo และตั้งค่าตัวเลือกนี้ด้วยไฟล์ config ใน etc modprobe d มิฉะนั้นคุณจะต้องเขียนกฎ udev เพื่อตั้งค่า แอตทริบิวต์ที่เหมาะสมทันทีที่อุปกรณ์ปรากฏตัวจับเวลาเป็นไฟล์การกำหนดค่าหน่วยที่ชื่อลงท้ายด้วยและเข้ารหัสข้อมูลเกี่ยวกับตัวจับเวลาที่ควบคุมและดูแลโดย systemd สำหรับการเปิดใช้งานตามเวลาเปิดดูระบบ timers เนื่องจาก systemd ใช้แทน V init ของ System V, มันอยู่ในความดูแลของ mounts ที่ระบุไว้ใน etc fstab ในความเป็นจริงมันเกินกว่าความสามารถ fstab ปกติการใช้ตัวเลือก mount พิเศษ prefixed with x-systemd ดู Fstab Automount กับ systemd สำหรับตัวอย่างของ automounting ติดตั้งตามความต้องการโดยใช้นามสกุลเหล่านี้ดู 2 สำหรับเอกสารฉบับสมบูรณ์ของ extensions. systemd เหล่านี้มีระบบบันทึกข้อมูลของตนเองที่เรียกว่า Journal ดังนั้นการเรียกใช้ syslog daemon จึงไม่จำเป็นต้องใช้อีกต่อไปในการอ่านบันทึกให้ใช้ใน Arch Linux สมุดบันทึกล็อกไดเร็กทอรี var เป็นส่วนหนึ่งของแพ็กเกจ systemd และ journal เมื่อ Storage ถูกตั้งค่าเป็น auto จะเขียนลงในบันทึกข้อมูลของ var log หากคุณหรือบางโปรแกรมลบไดเร็กทอรีนั้น systemd จะไม่สร้างใหม่โดยอัตโนมัติและจะเขียนแทน ล็อกไฟล์เพื่อรันบันทึก systemd ในแบบ nonpersistent อย่างไรก็ตามโฟลเดอร์จะถูกสร้างขึ้นใหม่เมื่อคุณตั้งค่า Storage permanency และเรียกใช้ systemctl restart systemd-journald หรือรีบูตระบบไฟล์ journald จะจัดประเภทข้อความตามระดับ Priority และการจัดประเภท Facility Logging สอดคล้องกับโปรโตคอล Syslog แบบคลาสสิก RFC 5424 ระดับความมีประสิทธิผลรหัสความรุนแรงของระบบ syslog ในลำดับความสำคัญที่เรียกว่า systemd ใช้เพื่อระบุความสำคัญของข้อความ RFC 5424 Section 6 2 1.So สิ่งอำนวยความสะดวกที่มีประโยชน์เพื่อดู 0,1,3,4,9,10,15.Filtering output. journalctl ช่วยให้คุณสามารถกรองเอาท์พุทตามเขตข้อมูลเฉพาะได้โปรดทราบว่าถ้ามีข้อความจำนวนมากเพื่อแสดงหรือกรองช่วงเวลาใหญ่ ๆ ให้ทำผลลัพธ์ของคำสั่งนี้อาจล่าช้าไปสักระยะหนึ่งเคล็ดลับ แม้ว่าวารสารจะถูกเก็บไว้ในรูปแบบไบนารีเนื้อหาของข้อความที่เก็บไว้จะไม่ได้รับการแก้ไขซึ่งหมายความว่าสามารถดูได้ด้วยสตริงเช่นสำหรับการกู้คืนในสภาพแวดล้อมที่ไม่มี systemd ติดตั้งคำสั่งตัวอย่างแสดงข้อความทั้งหมดจากการบูตนี้อย่างไรก็ตามบ่อยครั้ง หนึ่งคือสนใจในข้อความที่ไม่ได้มาจากปัจจุบัน แต่จากบูตก่อนหน้านี้เช่นถ้าเกิดความผิดพลาดของระบบที่ไม่สามารถกู้คืนได้เกิดขึ้นซึ่งเป็นไปได้ทางพารามิเตอร์ออฟเซ็ทที่เลือกได้ของ b-journalstl-b -0 แสดงข้อความจากการบูตปัจจุบัน journalctl - b - 1 จากบูตก่อนหน้า, journalctl - b -2 จากที่สองก่อนหน้านี้และอื่น ๆ ดู man 1 journalctl สำหรับคำอธิบายแบบเต็มความหมายมีประสิทธิภาพมากขึ้นแสดงข้อความทั้งหมดจากวันที่และเวลาไม่จำเป็นแสดงข้อความทั้งหมดตั้งแต่ 20 นาทีที่ผ่านมา ปฏิบัติตามข้อความใหม่แสดงข้อความทั้งหมดโดยเฉพาะ executable. Show ข้อความทั้งหมดโดยเฉพาะ process. Show ข้อความทั้งหมดโดยหน่วยเฉพาะหน่วยความจำ buffer ring. Show เฉพาะข้อผิดพลาดที่สำคัญและข้อความลำดับความสำคัญการแจ้งเตือน หมายเลขสามารถใช้ journalctl - p 3 1 ถ้าคำหลักหมายเลขเดียวใช้ journalctl - p 3 - ระดับความสำคัญสูงกว่านี้ยังรวมถึงแสดงให้เห็นว่าเทียบเท่าโดยการกรองใน syslog facility ดูมนุษย์ 1 journalctl man 7 หรือ Lennart s โพสต์บล็อกเพื่อดูรายละเอียด เคล็ดลับโดยค่าเริ่มต้น journalctl ตัดทอนเส้นที่ยาวกว่าความกว้างของหน้าจอ แต่ในบางกรณีอาจเป็นการดีกว่าที่จะเปิดใช้การตัดแทนการตัดทอนนี้ซึ่งสามารถควบคุมได้โดยตัวแปรสภาพแวดล้อม SYSTEMDLESS ซึ่งมีตัวเลือกที่ส่งไปยังเพจเจอร์เริ่มต้นและค่าดีฟอลต์เป็น FRSXMK ดู man 1 less and man 1 journalctl สำหรับรายละเอียดโดยละเว้นตัวเลือก S เอาท์พุทจะห่อแทนตัดทอนตัวอย่างเช่นเริ่มต้น journalctl ตามนี้ถ้าคุณต้องการตั้งค่าลักษณะการทำงานนี้เป็นค่าดีฟอลต์ให้เอ็กซ์พอร์ตตัวแปรจาก. Journal ขนาด จำกัด ถ้าวารสารไม่ย่อหย่อนไม่ จำกัด ขนาดของไฟล์จะถูกกำหนดเป็นค่าดีฟอลต์เท่ากับ 10 ขนาดของระบบแฟ้มต้นแบบ แต่ จำกัด ไว้ที่ 4 GiB เช่นมีบันทึกข้อมูลของ var log ที่ตั้งอยู่ที่ 20 GiB p ข้อมูลวารสารอาจใช้เวลาถึง 2 GiB ในพาร์ติชั่น 50 GiB จะมีขนาดสูงสุดที่ 4 GiB ขนาดสูงสุดของวารสารแบบถาวรจะสามารถควบคุมได้โดยการจดบันทึก uncomment และเปลี่ยนข้อมูลต่อไปนี้นอกจากนี้ยังสามารถใช้งานแบบหล่นลง การตั้งค่าคอนฟิกูเรชันแทนแทนที่จะแก้ไขไฟล์คอนฟิกูเรชันส่วนกลางในกรณีนี้อย่าลืมวางการแทนที่ภายใต้หัวเรื่อง Journal ดูรายละเอียดเพิ่มเติมลบไฟล์เจอร์นัลด้วยตนเองไฟล์ Journal สามารถลบออกจากบันทึกข้อมูลของ var log โดยใช้ตัวอย่างเช่น rm หรือสามารถตัดตามเกณฑ์ต่างๆโดยใช้ journalctl Examples ทำการลบไฟล์เจอร์นัลที่เก็บไว้จนกว่าพื้นที่ดิสก์ที่ใช้อยู่ต่ำกว่า 100 M ไฟล์ทั้งหมดที่มีในวารสารจะไม่มีข้อมูลที่เก่ากว่า 2 สัปดาห์ดู journalctl สำหรับข้อมูลเพิ่มเติมในวารสารร่วมกับ syslogpatibility ด้วยการใช้งาน syslog แบบคลาสสิกที่ไม่ใช่ journald สามารถให้ได้โดยให้ systemd ส่งต่อข้อความทั้งหมดผ่านซ็อกเก็ต systemd journal syslog เพื่อให้ syslog daemon ทำงานร่วมกับ วารสารจะมีการผูกกับซ็อกเก็ตนี้แทน dev ประกาศอย่างเป็นทางการประกาศค่าเริ่มต้นสำหรับการส่งต่อไปยังซ็อกเก็ตเป็น ForwardToSyslog no เพื่อหลีกเลี่ยงค่าใช้จ่ายของระบบเพราะ rsyslog หรือ syslog-ng ดึงข้อความจากวารสารโดยตัวเองส่งต่อไปยัง dev tty12 สร้างไดเรกทอรีแบบเลื่อนลงและสร้างไฟล์ในนั้นกำหนดรายชื่อวารสารที่แตกต่างกันเพื่อดูข้อมูลอาจต้องตรวจสอบบันทึกของระบบอื่นที่ตายในน้ำเช่นการบูตจากระบบที่ใช้งานจริงเพื่อกู้คืน ระบบการผลิตในกรณีเช่นนี้คุณสามารถติดตั้งดิสก์ในเช่น mnt และระบุเส้นทางสมุดบันทึกผ่าน - D - ไดเรกทอรีเช่น so. Tips และ tricks. Enable หน่วยที่ติดตั้งโดยค่าเริ่มต้นบทความหรือส่วนนี้ต้องการการขยายตัวเหตุผลเหตุผลว่าทำไม ทำงานร่วมกับหน่วย instantiated พูดคุยใน Talk Systemd. Arch Linux เรือกับที่มีการปิดใช้งานซึ่งจะทำให้ systemctl ตั้งไว้เพื่อปิดการใช้งานหน่วยทั้งหมดตามค่าเริ่มต้นเช่นว่าเมื่อมีการติดตั้งแพคเกจใหม่ผู้ใช้ต้องเปิดใช้งานหน่วยด้วยตนเองหากพฤติกรรมนี้ไม่ต้องการ, Simpl y สร้าง symlink จาก dev null เพื่อแทนที่ไฟล์การกำหนดค่าซึ่งจะทำให้ systemctl ตั้งค่าล่วงหน้าเพื่อเปิดใช้งานทุกยูนิตที่ได้รับการติดตั้งโดยไม่คำนึงถึงประเภทของหน่วยเว้นแต่ระบุไว้ในไฟล์อื่นในไดเร็กทอรีการตั้งค่าที่กำหนดไว้ล่วงหน้าของ systemctl หนึ่งหน่วย manpage สำหรับข้อมูลเพิ่มเติมหมายเหตุการเปิดใช้งานหน่วยทั้งหมดตามค่าเริ่มต้นอาจทำให้เกิดปัญหากับแพ็คเกจที่มีหน่วยความจำร่วมกันสองชุดขึ้นไปที่ถูกตั้งไว้ล่วงหน้า systemctl ได้รับการออกแบบมาเพื่อใช้โดยการแจกจ่ายและสปินหรือผู้ดูแลระบบในกรณีที่มีการเปิดใช้งานสองหน่วยที่ขัดแย้งกัน คุณควรระบุอย่างชัดเจนว่าจะให้ปิดใช้งานแฟ้มใดในไฟล์กำหนดค่าที่กำหนดไว้ล่วงหน้าตามที่ระบุไว้ใน manpage for. Sandboxing application environment ไฟล์ไฟล์หน่วยสามารถสร้างเป็น sandbox เพื่อแยกแอ็พพลิเคชันและกระบวนการของพวกเขาภายในระบบเสมือนที่ได้รับการรับรองความปลอดภัยขึ้นมาใช้ namespaces white - blacklisting ของความสามารถและกลุ่มควบคุมเพื่อกระบวนการบรรจุผ่าน exten การเพิ่มประสิทธิภาพของไฟล์ systemd unit ที่มีอยู่โดยใช้ sandboxing แอพพลิเคชั่นมักจะต้องมีการทดลองและข้อผิดพลาดพร้อมกับการใช้ strace stderr และ journalctl error logging และ output facilities คุณอาจต้องการค้นหาเอกสารต้นน้ำก่อนสำหรับทำเสร็จแล้ว การทดสอบเพื่อทดสอบฐานในตัวอย่างบางส่วนเกี่ยวกับวิธีการ sandboxing กับ systemd สามารถใช้งานได้ความสามารถในการตั้งค่ากำหนดชุดกำหนดความสามารถที่ได้รับอนุญาตพิเศษ แต่อาจใช้เพื่อกำหนดความสามารถเฉพาะสำหรับหน่วยความสามารถเฉพาะ CAPSYSADM เช่นซึ่งควรจะเป็น หนึ่งในเป้าหมายของ sandbox ที่ปลอดภัย CapabilityBoundingSet. Unbound Sandboxing แสดงตัวอย่างเต็มรูปแบบของคุณสมบัติ systemd สำหรับ sandboxing การตรวจสอบข้อผิดพลาดของระบบตัวอย่างเช่นเราจะตรวจสอบข้อผิดพลาดกับบริการ systemd-modules-load 1. ให้หา systemd บริการที่ไม่สามารถเริ่มต้นได้ 2 ตกลงเราพบปัญหาเกี่ยวกับเซอร์วิส systemd-modules-load เราต้องการทราบข้อมูลเพิ่มเติมหาก Proce ss ID ไม่อยู่ในรายการเพียงเริ่มบริการล้มเหลวด้วย systemctl restart systemd-modules-load.3 ตอนนี้เรามี id กระบวนการ id PID เพื่อตรวจสอบข้อผิดพลาดนี้ในเชิงลึกป้อนคำสั่งต่อไปนี้ด้วยรหัสกระบวนการปัจจุบันที่นี่ 15630.4 เราจะเห็นว่าบางส่วนของ kernel configs โมดูลมีการตั้งค่าที่ไม่ถูกต้องดังนั้นเราจึงดูที่การตั้งค่าเหล่านี้ใน etc modules-load d.5 การค้นหาโมดูล blacklist usblp error ไม่ถูกต้องอาจเกี่ยวข้องกับการตั้งค่าที่ไม่ถูกต้องภายในของ Lets deactivate โดยใส่ทีละขั้นตอนก่อน ตัวเลือกที่เราพบผ่านทางขั้นตอนที่ 3.6 ตอนนี้ลองเริ่มต้น systemd-modules-load ถ้าไม่ได้ผลก็ไม่ควรให้อะไรถ้าคุณเห็นข้อผิดพลาดใด ๆ ให้กลับไปที่ขั้นตอนที่ 3 และใช้ PID ใหม่เพื่อแก้ไขข้อผิดพลาดที่เหลือถ้า everything is ok, you can verify that the service was started successfully with. Often you can solve these kind of problems like shown above For further investigation look at Diagnosing boot problems. Diagnosing boot problems. systemd has several options for diagn osing problems with the boot process See boot debugging and the systemd debugging documentation. Diagnosing problems with a specific service. The factual accuracy of this article or section is disputed. Reason This may not catch all errors such as missing libraries Discuss in User talk Alucryd Plex. If some systemd service misbehaves and you want to get more information about what is going on, set the SYSTEMDLOGLEVEL environment variable to debug For example, to run the systemd-networkd daemon in debug mode. Or, equivalently, modify the service file temporarily for gathering enough output For example. If debug information is required long-term, add the variable the regular way. Shutdown reboot takes terribly long. If the shutdown process takes a very long time or seems to freeze most likely a service not exiting is to blame systemd waits some time for each service to exit before trying to kill it To find out if you are affected, see this article. Short lived processes do not seem to log any out put. If journalctl - u foounit does not show any output for a short lived service, look at the PID instead For example, if fails, and systemctl status systemd-modules-load shows that it ran as PID 123, then you might be able to see output in the journal for that PID, i e journalctl - b PID 123 Metadata fields for the journal such as SYSTEMDUNIT and COMM are collected asynchronously and rely on the proc directory for the process existing Fixing this requires fixing the kernel to provide this data via a socket connection, similar to SCMCREDENTIALS. Boot time increasing over time. After using systemd-analyze a number of users have noticed that their boot time has increased significantly in comparison with what it used to be After using systemd-analyze blame NetworkManager is being reported as taking an unusually large amount of time to start. The problem for some users has been due to var log journal becoming too large This may have other impacts on performance, such as for systemctl status or journalctl As such the solution is to remove every file within the folder ideally making a backup of it somewhere, at least temporarily and then setting a journal file size limit as described in Journal size limit. fails to start at boot. Starting with systemd 219, specifies ACL attributes for directories under var log journal and, therefore, requires ACL support to be enabled for the filesystem the journal resides on. See Access Control Lists Enabling ACL for instructions on how to enable ACL on the filesystem that houses var log journal. systemctl enable fails for symlinks in etc systemd system. If etc systemd system foo is a symlink and systemctl enable foo is run, it will fail with this error. This is a design choice of systemd As a workaround, enabling by absolute path works. dependent services are not started when starting a service manually. This section is being considered for removal. One in famous example is which needs the to function properly. The dependencies in are defined as. This only defines the necessary dependent sockets to be enabled services i e as autostart , too - but does not start them whenever the DISABLED non-autostarting service ist started manually e g by running systemctl star t libvirtd. Thus the correct way to manually start a service with dependent subservices once instead of at each start of the system probably is. systemd version printed on boot is not the same as installed package version. You need to regenerate your initramfs and the versions should match. Tip A pacman hook can be used to automatically regenerate the initramfs every time systemd is upgraded See this forum thread and Pacman Hooks. Soon enough, hardly any Linux user will be able to escape the ever growing grasp that systemd imposes on Linux, unless they manually opt out systemd has created more technical, emotional, and social issues than any other piece of software as of late This predominantly came to show in the heated discussions also dubbed as the Init Wars , that occupied parts of the Debian developer body for months While the Debian Technical Comittee finally decided to include systemd in Debian 8 Jessie , there were efforts to supersede the decision by a General Resolution, and even threats to the health of developers in favor of systemd. This goes to show how deep systemd interferes with the way of handling Linux systems that has, in large parts, been passed down to us from the Unix days Theorems like one tool for the job are overthrown by the new kid in town Besides substituting sysvinit as init system, it digs deep into system administration For right now a lot of the commands you are used to will keep on working due to the compatibility layer provided by the package systemd-sysv That might change as soon as systemd 214 is uploaded to Debian, destined to be released in the stable branch with Debian 8 Jessie From thereon, users need to utilize the new commands that come with systemd for managing services, processes, switching run levels, and querying the logging system A workaround is to set up aliases in. So let s have a look at how systemd will change your habits of administrating your computers and the pros and cons involved Before making the switch to systemd it is a good security measure to save the old sysvinit to be able to still boot, should systemd fail This will only work as long as systemd-sysv is not yet installed, and can be easily obtained by running. cp - av sbin init. Thusly prepared, in case of emergency, just append. to the kernel boot-time parameters. Basic Usage of systemctl. systemctl is the command that substitutes the old etc init d foo start stop , but also does a lot more, as you can learn from its man page. Some basic use-cases are. systemctl - list all loaded units and their state where unit is the term for a job service. systemctl list-units - list all units. systemctl start NAME - start activate one or more units. systemctl stop NAME - stop deactivate one or more units. systemctl disable NAME - disable one or more unit files. systemctl list-unit-files - show all installed unit files and their state. systemctl --failed - show which units failed during boot. systemctl --type mount - filter for types types could be service, mount, device, socket, target. systemctl enable - start a root shell on TTY 9 for debugging. For more convinience in handling units, there is the package systemd-ui which is started as user with the command systemadm. Switching runlevels, reboot and shutdown are also handled by systemctl. systemctl isolate - take you to what you know as init 5, where your X-server runs. systemctl isolate - take you to what you know as init 3, TTY, no X. systemctl reboot - shut down and reboot the system. systemctl poweroff - shut down the system. All these commands, other than the ones for switching runlevels, can be executed as normal user. Basic Usage of journalctl. systemd does not only boot machines faster than the old init system, it also starts logging much earlier, including messages from the kernel initialization phase, the initial RAM disk, the early boot logic, and the main system runtime So the days where you needed to use a camera to provide the output of a kernel panic or otherwise stalled system for debugging are mostly over. With systemd logs are aggregated in the journal which resides in var log To be able to make full use of the journal, we first need to set it up, as Debian does not do that for you yet. addgroup --system systemd-journal mkdir - p var log journal chown root systemd-journal var log journal gpasswd - a user systemd-journal. That will set up the journal in a way where you can query it as normal user Querying the journal with journalctl offers some advantages over the way syslog works. journalctl --all - show the full journal of the system and all its users. journalctl - f - show a live view of the journal equivalent to tail - f var log messages. journalctl - b - show the log since the last boot. journalctl - k - b -1 - show all kernel logs from the boot before last - b -1.journalctl - b - p err - shows the log of the last boot, limited to the priority ERROR. journalctl --since yesterday - since Linux people normally do not often reboot, this limits the size more than - b would. journalctl - u --since 2014-07-06 07 00 --until 2014-07-06 08 23 - show the log for cron for a defined timeframe. journalctl - p 2 --since today - show the log for priority 2, which covers emerg, alert and crit resembl es syslog priorities emerg 0 , alert 1 , crit 2 , err 3 , warning 4 , notice 5 , info 6 , debug 7.journalctl - copy the binary journal as text into your current directory. Journal and syslog can work side-by-side On the other hand, you can remove any syslog packages like rsyslog or syslog-ng once you are satisfied with the way the journal works. For very detailed output, append to the kernel boot-time parameter list, and then run. Log levels can also be edited in. Analyzing the Boot Process with systemd. systemd allows you to effectively analyze and optimize your boot process. systemd-analyze - show how long the last boot took for kernel and userspace. systemd-analyze blame - show details of how long each service took to start. systemd-analyze critical-chain - print a tree of the time-critical chain of units. systemd-analyze dot dot - Tsvg - put a vector graphic of your boot process requires graphviz package. systemd-analyze plot - generate a graphical timechart of the boot process. systemd has pr etty good documentation for such a young project under heavy developement First of all, there is the 0pointer series by Lennart Poettering The series is highly technical and quite verbose, and holds a wealth of information Another good source is the distro agnostic Freedesktop info page with the largest collection of links to systemd resources, distro specific pages, bugtrackers and documentation A quick glance at. will give you an overview of all systemd man pages The command structure for systemd for various distributions is pretty much the same, differences are found mainly in the packaging. Subscribe to Xmodulo. Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo Enter your email address below, and we will deliver our Linux posts straight to your email box, for free Delivery powered by Google Feedburner. Support Xmodulo. Did you find this tutorial helpful Then please be generous and support Xmodulo. Ferdinand Thommes. I live as linux developer, technical au thor and city guide in Berlin, Germany and Charleston S C Other than being nerdy I dig riding bicycles and love cooking and good literature. The D-Bus API of systemd PID 1.systemd and its auxiliary daemons expose a number of APIs on D-Bus The following describes the various APIs exposed by the system and service manager itself, and does not cover the auxiliary daemons. The service manager exposes a number of objects on the bus one manager object as central entry point for clients and individual objects for each unit and for each queued job The unit objects each implement a generic Unit interface plus a type-specific interface For example, service units implement as well as The manager object can be used to list unit and job objects, or to directly convert a unit name or job id into a bus path of the corresponding D-Bus objects. Note that properties exposing time values are usually encoded in microseconds usec on the bus, even if their corresponding settings in the unit files are in second s. In contrast to most of the other services of the systemd suite PID 1 does not use PolicyKit for controlling access to privileged operations, but relies exclusively on the low-level D-Bus policy language This is done in order to avoid a cyclic dependency between PolicyKit and systemd PID 1 This means that sensitive operations exposed by PID 1 on the bus are generally not available to unprivileged processes directly However some such as shutdown reboot suspend are made available via logind s interfaces. The Manager Object. The main entry point object is available on the fixed org freedesktop systemd1 object path. Read access is generally granted to all clients, but changes may only be made by privileged clients PolicyKit is not used by this service, and access controlled exclusively via the D-Bus policy enforcement. Note that many of the calls exist twice once on the Manager object, and once on the respective unit objects This is to optimize access times so that methods that belong to unit objects do not have to be called with a resolved unit path, but can be called with only the unit id, too. GetUnit may be used to get the unit object path for a unit name It takes the unit name and returns the object path If a unit has not been loaded yet by this name this call will fail. GetUnitByPID may be used to get the unit object path of the unit a process ID belongs to Takes a Unix PID and returns the object path The PID must refer to an existing process of the system. LoadUnit is similar to GetUnit but will load the unit from disk if possible. StartUnit enqeues a start job, and possibly depending jobs Takes the unit to activate, plus a mode string The mode needs to be one of replace, fail, isolate, ignore-dependencies, ignore-requirements If replace the call will start the unit and its dependencies, possibly replacing already queued jobs that conflict with this If fail the call will start the unit and its dependencies, but will fail if this would change an already queued job If iso late the call will start the unit in question and terminate all units that aren t dependencies of it If ignore-dependencies it will start a unit but ignore all its dependencies If ignore-requirements it will start a unit but only ignore the requirement dependencies It is not recommended to make use of the latter two options Returns the newly created job object. StartUnitReplace is similar to StartUnit but replaces a job that is queued for one unit by a job for another. StopUnit is similar to StartUnit but stops the specified unit rather than starting it Note that isolate mode is invalid for this call. ReloadUnit RestartUnit TryRestartUnit ReloadOrRestartUnit ReloadOrTryRestartUnit may be used to restart and or reload a unit, and takes similar arguments as StartUnit Reloading is done only if the unit is already running and fails otherwise If a service is restarted that isn t running it will be started, unless the Try flavor is used in which case a service that isn t running is not affected by the restart The ReloadOrRestart flavors attempt a reload if the unit supports it and use a restart otherwise. KillUnit may be used to kill i e send a signal to all processes of a unit Takes the unit name, an enum who and a UNIX signal number to send The who enum is one of main , control or all If main , only the main process of a unit is killed If control only the control process of the unit is killed, if all all processes are killed A control process is for example a process that is configured via ExecStop and is spawned in parallel to the main daemon process, in order to shut it down. GetJob returns the job object path for a specific job, identified by its id. CancelJob cancels a specific job identified by its numer ID This operation is also available in the Cancel method of Job objects see below , and exists primarily to reduce the necessary round trips to execute this operation Note that this will not have any effect on jobs whose execution has already begun. ClearJobs flushes the job queue, removing all jobs that are still queued Note that this does not have any effect on jobs whose execution has already begun, it only flushes jobs that are queued and have not yet begun execution. ResetFailedUnit resets the failed state of a specific unit. ResetFailed resets the failed state of all units. ListUnits returns an array with all currently loaded units Note that units may be known by multiple names at the same name, and hence there might be more unit names loaded than actual units behind them The array consists of structures with the following elements. The primary unit name as string. The human readable description string. The load state i e whether the unit file has been loaded successfully. The active state i e whether the unit is currently started or not. The sub state a more fine-grained version of the active state that is specific to the unit type, which the active state is not. A unit that is being followed in its state by this unit, if there is any, otherwise the empt y string. The unit object path. If there is a job queued for the job unit the numeric job id, 0 otherwise. The job type as string. The job object path. ListJobs returns an array with all currently queued jobs Returns an array consisting of structures with the following elements. The numeric job id. The primary unit name for this job. The job type as string. The job state as string. The job object path. The unit object path. Subscribe enables most bus signals to be sent out Clients which are interested in signals need to call this function Signals are only sent out if at least one client invoked this function Unsubscribe undoes the signal subscription that Subscribe implements It is not necessary to invoke Unsubscribe as clients are tracked Signals are no longer sent out as soon as all clients which previously asked for Subscribe either closed the bus connection or invoked Unsubscribe. CreateSnapshot creates a snapshot unit for the current system state, and stores it under the specified name It will return the unit object path to the new snapshot If the cleanup boolean is true the snapshot will be removed automatically when it has been activated, otherwise it remains and can be activated multiple times Snapshots are not persistent. RemoveSnapshot removes a snapshot This call is also available in the Remove method of Snapshot objects see below , and exists primarily to reduce the number of required roundtrips for this call. Reload may be invoked to reload all unit files. Reexecute may be invoked to reexecute the main manager process It will serialize its state, reexecute, and deserizalize the state again This is useful for upgrades and is a more comprehensive version of Reload. Exit may be invoked to ask the manager to exit This is not available for the system manager and is useful only for user session managers. Reboot PowerOff Halt KExec may be used to ask for immediate reboot, powering down, halt or kexec based reboot of the system Note that this does not shut down any services and immediately transitions into the reboot process These functions are normally only called as last step of shutdown, and should not be called directly To shut down the machine it is a much better choice generally to invoke Reboot and PoweOff on the logind manager object See On logind for more information. SwitchRoot may be used to transition to a new root directory This is intended to be used by initial RAM disks The call takes two arguments the new root directory which needs to be specified , plus an init binary path which may be left empty, in which case it is automatically searched for The state of the system manager will be serialized before the transition After the transition the manager binary on the main system is invoked and replaces the old PID 1 All state will then be deserialized. SetEnvironment may be used to alter the environment block that is passed to all spawned processes Takes a string array with environment variable assignments Settings passed will override previously set variables. UnsetEnvironment may be used to unset environment variables Takes a string array with environment variable names All variables specified will be unset if they have been set previously and no longer be passed to all spawned processes This call has no effect for variables that were previously not set, but will not fail in that case. UnsetAndSetEnvironment is a combination of UnsetEnvironment and SetEnvironment It takes two lists The first one is a list of variables to unset, the second one of assignments to set If a variable is listed in both the variable is set after this call, i e the set list overrides the unset list. ListUnitFiles returns an array of unit names plus their enablement status Note that ListUnit returns a list of units currently loaded into memory, while ListUnitFiles returns a list of unit files that could be found on disk Note that while most units are read directly from a unit file with the same name some units are not backed by files, and some files template s cannot directly be loaded as units but need to be instantiated. GetUnitFileState returns the current enablement status of specific unit file. EnableUnitFiles may be used to enable one or more units in the system by creating symlinks to them in etc or run It takes a list of unit files to enable either just file names or full absolute paths if the unit files are residing outside the usual unit search paths , and two booleans the first controls whether the unit shall be enabled for runtime only true, run , or persistently false, etc The second one controls whether symlinks pointing to other units shall be replaced if necessary This call returns one boolean and an array with the changes made The boolean signals whether the unit files contained any enablement information i e an Install section The changes list consists of structures with three strings the type of the change one of symlink or unlink , the file name of the symlink and the destination of the symlink Note that most of the follo wing calls return a changes list in the same format. Similar, DisableUnitFiles disables one or more units in the system, i e removes all symlinks to them in etc and run. Similar, ReenableUnitFiles applies the changes to one or more units that would result from disabling and enabling the unit quickly one after the other in an atomic fashion This is useful to apply updated Install information contained in unit files. Similar, LinkUnitFiles links unit files that are located outside of the usual unit search paths into the unit search path. Similar, PresetUnitFiles enables disables one or more units file according to the preset policy See Presets for more information. Similar, MaskUnitFiles masks unit files, and UnmaskUnitFiles unmasks them again. SetDefaultTarget changes the link See bootup 7 for more information. GetDefaultTarget retrieves the name of the unit to which is aliased. SetUnitProperties may be used to modify certain unit properties at runtime Not all properties may be changed at runti me, but many resource management settings primarily those in may The changes are applied instantly, and stored on disk for future boots, unless runtime is true, in which case the settings only apply until the next reboot name is the name of the unit to modify properties are the settings to set, encoded as an array of property name and value pairs Note that this is not a dictionary Note that when setting array properties with this call this usually results in appending to the pre-configured array To reset the configured arrays set the property to an empty array first, then append to it. StartTransientUnit may be used to create and start a transient unit, which will be released as soon as it is not running or referenced anymore or the system is rebooted name is the unit name including suffix, and must be unique mode is the same as in StartUnit properties contains properties of the unit, specified like in SetUnitProperties aux is currently unused and should be passed as empty array See the New Control Group Interfaces for more information how to make use of this functionality for resource control purposes. Note that most signals are sent out only after Subscribe has been invoked by at least one client Make sure to invoke this call when subscribing to these signals. UnitNew and UnitRemoved are sent out each time a new unit is loaded or unloaded Note that this has little to do with whether a unit is available on disk or not, and simply reflects the units that are currently loaded into memory The signals take two parameters the primary unit name and the object path. JobNew and JobRemoved are sent out each time a new job is queued or dequeued Both signals take the numeric job ID, the bus path and the primary unit name for this job as argument JobRemoved also includes a result string, being one of done canceled timeout failed dependency skipped done indicates successful execution of a job canceled indicates that a job has been canceled via CancelJob above before it finished exe cution this doesn t necessarily mean though that the job operation is actually cancelled too, see above timeout indicates that the job timeout was reached failed indicates that the job failed dependency indicates that a job this job has been depending on failed and the job hence has been removed too skipped indicates that a job was skipped because it didn t apply to the units current state. StartupFinished is sent out when startup finished It carries six usec timespan values each indicating how much boot time has been spent in the firmware if known , in the boot loader if known , in the kernel initialization phase, in the initrd if known , in userspace and in total These values may also be calculated from the FirmwareTimestampMonotonic, LoaderTimestampMonotonic, InitRDTimestampMonotonic, UserspaceTimestampMonotonic, FinishTimestampMonotonic properties see below. UnitFilesChanged is sent out each time the list of enabled or masked unit files on disk have changed. Reloading is sent out imme diately before a daemon reload is done with the boolean parameter set to True and after a daemon reload is completed with the boolean parameter set to False This may be used by UIs to optimize UI updates. Most properties simply reflect the respective options in and the kernel command line The others. Version encodes the version string of the running systemd instance Note that the version string is purely informational, it should not be parsed, one may not assume the version to be formatted in any particular way We take the liberty to change the versioning scheme at any time and it is not part of the API. Features encodes the features that have been enabled resp disabled for this build Enabled options are prefixed with , disabled options with. Tainted encodes a couple of taint flags, as colon separated list When systemd detects it is run on a system with certain problems it will set an appropriate taint flag Taints may be used to lower the chance of bogus bug reports The following taints ar e currently known split-usr mtab-not-symlink cgroups-missing local-hwclock split-usr is set if usr is not pre-mounted when systemd is first invoked See Booting Without usr is Broken for details why this is bad mtab-not-symlink indicates that etc mtab is not a symlink to proc self mounts as required cgroups-missing indicates that control groups have not been enabled in the kernel local-hwclock indicates that the local RTC is configured to be in local time rather than UTC. FirmwareTimestamp FirmwareTimestampMonotonic LoaderTimestamp LoaderTimestampMonotonic KernelTimestamp KernelTimestampMonotonic InitRDTimestamp InitRDTimestampMonotonic UserspaceTimestamp UserspaceTimestampMonotonic FinishTimestamp FinishTimestampMonotonic encode CLOCKREALTIME resp CLOCKMONOTONIC usec timestamps taken when the firmware first began execution, when the boot loader first began execution, when the kernel first began execution, when the initrd first began execution, when the main systemd instance began execut ion and finally, when all queued startup jobs finished execution These values are useful for determining boot-time performance Note that as monotonic time begins with the kernel startup the KernelTimestampMonotonic timestamp will always be 0, and FirmwareTimestampMonotonic and LoaderTimestampMonotonic are to be read as negative values Also, not all fields are available, depending on the used firmware, boot loader or initrd implementation In these cases the resp pairs of timestamps are both 0, indicating that no data is available. Similar, the SecurityStartTimestamp GeneratorsStartTimestamp and LoadUnitTimestamp plus their monotonic and stop counterparts expose performance data for uploading the security policies to the kernel such as the SELinux, IMA, or SMACK policies , for running the generator tools and for loading the unit files. NNames encodes how many unit names are currently known This only includes names of units that are currently loaded and can be more than actually loaded unit s since units may have more than one name. NJobs encodes how many jobs are currently queued. NInstalledJobs encodes how many jobs have ever been queued in total. NFailedJobs encodes how many jobs have ever failed in total. Progress encodes boot progress as floating point value between 0 0 and 1 0 This value begins at 0 0 at early-boot and ends at 1 0 when boot is finished and is based on the number of executed and queued jobs After startup this field is always 1 0 indicating a finished boot. Environment encodes the environment block passed to all executed services It may be altered with bus calls such as SetEnvironment see above. UnitPath encodes the currently active unit file search path It is an array of strings, each being one file system path. Virtualization contains a short ID string describing the virtualization technology the system runs in On bare-metal hardware this is the empty string, otherwise an identifier such as kvm , vmware and so on For a full list of IDs see systemd-detect-v irt 1 Note that only the innermost virtualization technology is exported here This detects both full-machine virtualizations VMs and shared-kernel virtualization containers. Architecture contains a short ID string describing the architecture the systemd instance is running on This follows the same vocabulary as ConditionArchitectures. ControlGroup contains the root control group path of this system manager Note that the root path is encoded as empty string here not as , so that it can be appended to sys fs cgroup systemd easily This value will be set to the empty string for the host instance, and some other string for container instances. Unit Objects. All Unit objects implement the generic interface Depending on the unit type they also implement one unit-type-specific interface, as described below. Start Stop Reload Restart TryRestart ReloadOrRestart ReloadOrTryRestart Kill ResetFailed and SetProperties implement the same operation as the respective method calls on the Manager object see a bove , however operate on the unit object and hence do not take a unit name parameter Invoking the methods directly on the Manager object has the advantage of not requiring a GetUnit call to get the unit object for a specific unit name Calling the methods on the Manager object is hence a round trip optimization. Id contains the primary name of the unit. Names contains all names of the unit, including the primary name that is also exposed in Id. Following either contains the empty string or contains the name of another unit that this unit follows in state This is used for some device units which reflect the unit state machine of another unit, and which other unit this is might possibly change. Requires RequiresOverridable Requisite RequisiteOverridable Wants BindsTo RequiredBy RequiredByOverridable WantedBy BoundBy Conflicts ConflictedBy Before After OnFailure Triggers TriggeredBy PropagatesReloadTo RequiresMountsFor contain arrays which encode the dependencies and their inverse dependencie s where this applies , as configured in the unit file or determined automatically. Description contains the human readable description string for the unit. SourcePath contains the path to a configuration file this unit is automatically generated from in case it is not a native unit in which case it contains the empty string For example, all mount units generated from etc fstab have this field set to this value. Documentation contains a string array with URLs of documentation for this unit. LoadState contains a state value that reflects whether the configuration file of this unit has been loaded The following states are currently defined loaded error masked loaded indicates that the configuration was successfully loaded error indicates that the configuration failed to load, the LoadError field see below contains information about the cause of this failure masked indicates that the unit is currently masked out i e symlinked to dev null or suchlike Note that the LoadState is fully orthogonal to the ActiveState see below as units without valid loaded configuration might be active because configuration might have been reloaded at a time where a unit was already active. ActiveState contains a state value that reflects whether the unit is currently active or not The following states are currently defined active reloading inactive failed activating deactivating active indicates that unit is active obviously reloading indicates that the unit is active and currently reloading its configuration inactive indicates that it is inactive and the previous run was successful or no previous run has taken place yet failed indicates that it is inactive and the previous run was not successful more information about the reason for this is available on the unit type specific interfaces, for example for services in the Result property, see below activating indicates that the unit has previously been inactive but is currently in the process of entering an active state Conversely deactivating indi cates that the unit is currently in the process of deactivation. SubState encodes states of the same state machine that ActiveState covers, but knows more fine-grained states that are unit-type-specific Where ActiveState only covers six high-level states, SubState covers possibly many more low-level unit-type-specific states that are mapped to the six high-level states Note that multiple low-level states might map to the same high-level state, but not vice versa Not all high-level states have low-level counterparts on all unit types At this point the low-level states are not documented here, and are more likely to be extended later on than the common high-level states explained above. FragmentPath contains the unit file path this unit was read from, if there is any if not this contains the empty string. UnitFileState encodes the install state of the unit file of FragmentPath It currently knows the following states enabled enabled-runtime linked linked-runtime masked masked-runtime static disabled invalid enabled indicates that a unit file is permanently enabled enable-runtime indicates the unit file is only temporarily enabled, and will no longer be enabled after a reboot that means, it is enabled via run symlinks, rather than etc linked indicates that a unit is linked into etc permanently, linked indicates that a unit is linked into run temporarily until the next reboot masked indicates that the unit file is masked permanently, masked-runtime indicates that it is only temporarily masked in run, until the next reboot static indicates that the unit is statically enabled, i e always enabled and doesn t need to be enabled explicitly invalid indicates that it could not be determined whether the unit file is enabled. InactiveExitTimestamp InactiveExitTimestampMonotonic ActiveEnterTimestamp ActiveEnterTimestampMonotonic ActiveExitTimestamp ActiveExitTimestampMonotonic InactiveEnterTimestamp InactiveEnterTimestampMonotonic contain CLOCKREALTIME and CLOCKMONOTONIC 64bit usec ti mestamps of the last time a unit left the inactive state, entered the active state, exited the active state, or entered an inactive state These are the points in time where the unit transitioned inactive failed activating activating active active deactivating and finally deactivating inactive failed The fields are 0 in case such a transition has not been recording on this boot yet. CanStart CanStop CanReload encodes as booleans whether the unit supports the start, stop or reload operations Even if a unit supports such an operation the client might not necessary have the right privileges to execute them. CanIsolate encodes as boolean whether the unit may be started in isolation mode. Job encodes the job ID and job object path of the job currently scheduled or executed for this unit, if there is any If no job is scheduled or executed the job id field will be 0.StopWhenUnneeded RefuseManualStart RefuseManualStop AllowIsolate DefaultDependencies OnFailureIsolate IgnoreOnIsolate IgnoreOnSn apshot map directly to the corresponding configuration booleans in the unit file. DefaultControlGroup contains the main control group of this unit as a string This refers to a group in systemd s own name systemd hierarchy, which systemd uses to watch and manipulate the unit and all its processes. NeedDaemonReload is a boolean that indicates whether the configuration file this unit is loaded from i e FragmentPath or SourcePath has changed since the configuration was read and hence whether a configuration reload is recommended. JobTimeoutUSec maps directly to the corresponding configuration setting in the unit file. ConditionTimestamp and ConditionTimestampMonotonic contain the CLOCKREALTIME CLOCKMONOTONIC usec timestamps of the last time the configured conditions of the unit have been checked, or 0 if they have never been checked Conditions are checked when a unit is requested to start. ConditionResult contains the condition result of the last time the configured conditions of this unit were checked. Conditions contains all configured conditions of the unit For each condition five fields are given condition type e g ConditionPathExists , whether the condition is a trigger condition, whether the condition is reversed, the right hand side of the condtion e g the path in case of ConditionPathExists , and the status The status can be 0, in which case the condition hasn t been checked yet, a positive value, in which case the condition passed, or a negative value, in which case the condition failed Currently only 0, 1, and -1 are used, but additional values may be used in the future, retaining the meaning of zero positive negative values. LoadError contains a pair of strings If the unit failed to load as encoded in LoadState see above , then this will include a D-Bus error pair consisting of the error ID and an explanatory human readable string of what happened If it succeeded to load this will be a pair of empty strings. Transient contains a boolean that indicates whether the uni t was created as transient unit i e via CreateTransientUnit on the manager object. Service Unit Objects. All service unit objects implement the interface described here in addition to the generic interface see above. Most properties of the Service interface map directly to the corresponding settings in service unit files For the sake of brevity, here s a list of all exceptions only. WatchdogTimestamp and WatchdogTimestampMonotonic contain CLOCKREALTIME CLOCKMONOTONIC usec timestamps of the last watchdog ping received from the service, or 0 if none was ever received. ExecStartPre ExecStart ExecStartPost ExecReload ExecStop ExecStop each are arrays of structures each containing the binary path to execute an array with all arguments to pass to the executed command, starting with argument 0 a boolean whether it should be considered a failure if the process exits uncleanly two pairs of CLOCKREALTIME CLOCKMONOTONIC usec timestamps when the process began and finished running the last time, or 0 if it never ran or never finished running the PID of the process, or 0 if it has not run yet the exit code and status of the last run This field hence maps more or less to the corresponding setting in the service unit file but is augmented with runtime data. LimitCPU and related properties map more or less directly to the corresponding settings in the service unit files, however are set to 18446744073709551615 i e -1 if they aren t set. Capabilities contains the configured capabilities, as formatted with captotext. SecureBits CapabilityBoundingSet MountFlags also correspond to the configured settings of the unit files, but are encoded as the actual binary flag fields they are, rather than formatted as string. ExecMainStartTimestamp ExecMainStartTimestampMonotonic ExecMainExitTimestamp ExecMainExitTimestampMonotonic ExecMainPID ExecMainCode ExecMainStatus contain information about the main process of the service as far as it is known This is often the same runtime information that is stored i n ExecStart However, it deviates for Type forking services where the main process of the service is not forked off systemd directly These fields either contain information of the last run of the process or of the current running process. MainPID and ControlPID contain the main and control PID of the service The main PID is the current main PID of the service and is 0 when the service currently has no main PID The control PID is the PID of the current start stop reload process running and is 0 if no such process is currently running That means that ExecMainPID and MainPID differ in the way that the latter immediately reflects whether a main process is currently running while the latter possible contains information collected from the last run even if the process is no longer around. StatusText contains the status text passed to the service manager via a call to sdnotify This may be used by services to inform the service manager about its internal state with a nice explanatory string. Resul t encodes the execution result of the last run of the service It is useful to determine the reason a service failed if it is in failed state see ActiveState above The following values are currently known success is set if the unit didn t fail resources indicates that not enough resources have been available to fork off and execute the service processes timeout indicates that a time-out occurred while executing a service operation exit-code indicates that a service process exited with an unclean exit code signal indicates that a service process exited with an uncaught signal core-dump indicates that a service process exited uncleanly and dumped core watchdog indicates that a service did not send out watchdog ping messages often enough start-limit indicates that a service has been started too frequently in a time frame as configured in StartLimitInterval StartLimitBurst. ControlGroup indicates the control group path the processes of this service unit are placed in. Socket Unit Objects. All socket unit objects implement the interface described here in addition to the generic interface see above. Most of the properties map directly to the corresponding settings in socket unit files As socket units can include ExecStartPre and similar fields which contain information about processes to execute They also share most of the fields related to the execution context that Service objects expose see above In addition to these properties there are the following. NAccepted contains the accumulated number of connections ever accepted on this socket This only applies to sockets with Accept set to true i e those where systemd is responsible for accepted connections. Similarly NConnections contains the number of currently open connections on this socket, and also applies only to socket with Accept set to true. Result encodes the reason why a socket unit failed if it is in failed state see ActiveState above The values success resources timeout exit-code signal and core-dump have the same mean ing as they have for the corresponding field of service units see above In addition to that the value service-failed-permanent indicates that the service of this socket failed continuously. Target Unit Objects. All target unit objects implement the interface described here in addition to the generic interface see above. Target units have neither type-specific methods nor properties. Device Unit Objects. All device unit objects implement the interface described here in addition to the generic interface see above. Device units only expose a single type-specific property. SysFSPath contains the sysfs path of the kernel device this object corresponds to. Mount Unit Objects. All mount unit objects implement the interface described here in addition to the generic interface see above. Most of the properties map directly to the corresponding settings in mount unit files As mount units invoke the usr bin mount command their bus objects include implicit ExecMount and similar fields which contain informati on about processes to execute They also share most of the fields related to the execution context that Service objects expose see above In addition to these properties there are the following. ControlPID contains the PID of the currently running usr bin mount or usr bin umount command if there is one running, otherwise 0.Result contains a value explaining why a mount unit failed if it failed It can take the values success resources timeout exit-code signal core-dump which have the identical meaning as the corresponding values of the corresponding field of service unit objects see above. Automount Unit Objects. All automount unit objects implement the interface described here in addition to the generic interface see above. Most of the properties map directly to the corresponding settings in the automount unit files. Result knows the values success and resources at this time They have the same meanings as the corresponding values of the corresponding field of the Service object. Snapshot Unit Objects. All snapshot unit objects implement the interface described here in addition to the generic interface see above. Remove deletes the snapshot unit This operation is also available in the RemoveSnapshot operation of the Manager object see above , which is sometimes nicer to call, in order to reduce roundtrips. Cleanup is a boolean that indicates that the snapshot unit should be removed automatically after the first time it is activated. Timer Unit Objects. All timer unit objects implement the interface described here in addition to the generic interface see above. Unit contains the name of the unit to activate when the timer elapses. TimersMonotonic contains an array of structs that contain information about all monotonic timers of this timer unit The structs contain a string identifying the timer base, which is one of OnActiveUSec OnBootUSec OnStartupUSec OnUnitActiveUSec OnUnitInactiveUSec which correspond to the settings of the same names in the timer unit files the usec offset from this timer base in monotonic time the next elapsation point on the CLOCKMONOTONIC clock, relative its epoch. TimersCalendar contains an array of structs that contain information about all realtime calendar timers of this timer unit The structs contain a string identifying the timer base, which may only be OnCalendar for now the calendar specification string the next elapsation point on the CLOCKREALTIME clock, relative to its epoch. NextElapseUSecRealtime contains the next elapsation point on the CLOCKREALTIME clock in usec since the epoch, or 0 if this timer event does not include at least one calendar event. Similar, NextElapseUSecMonotonic contains the next elapsation point on the CLOCKMONOTONIC clock in usec since the epoch, or 0 if this timer event does not include at least one monotonic event. Result knows the values success and resources with the same meanings as the matching values of the corresponding property of the service interface. Swap Unit Objects. All swap unit objects imple ment the interface described here in addition to the generic interface see above. Most of the properties map directly to the corresponding settings in swap unit files As mount units invoke the usr bin swapon command their bus objects include implicit ExecActivate and similar fields which contain information about processes to execute They also share most of the fields related to the execution context that Service objects expose see above In addition to these properties there are the following. ControlPID contains the PID of the currently running usr bin swapon or usr bin swapoff command if there is one running, otherwise 0.Result contains a value explaining why a mount unit failed if it failed It can take the values success resources timeout exit-code signal core-dump which have the identical meanings as the corresponding values of the corresponding field of service unit objects see above. Path Unit Objects. All path unit objects implement the interface described here in addition to the ge neric interface see above. Most properties correspond directly with the matching settings in path unit files The others. Paths contains an array of structs Each struct contains the condition to watch, which can be one of PathExists PathExistsGlob PathChanged PathModified DirectoryNotEmpty which correspond directly to the matching settings in the path unit files and the path to watch, possibly including glob expressions. Result contains a result value which can be success or resources which have the same meaning as the corresponding field of the service interface. Slice Unit Objects. All slice unit objects implement the interface described here in addition to the generic interface see above. Most properties correspond directly with the matching settings in slice unit files. Scope Unit Objects. All slice unit objects implement the interface described here in addition to the generic interface see above. All properties correspond directly with the matching properties of service units. Controller con tains the bus name unique or well-known that is notified when the scope unit is to be shut down via a RequestStop signal see below This is set when the scope is created If not set the scope s processes will terminated with SIGTERM directly. Abandon may be used to place a scope unit in the abandoned state This may be used to inform the system manager that the manager that created the scope lost interest in the scope for example, because it is terminating , without wanting to shut down the scope entirely. RequestStop is sent to the peer that is configured in the Controller property when systemd is requested to terminate the scope unit A program registering a scope can use this to cleanly shut down the processes it added to the scope, instead of letting systemd do it with the usual SIGTERM logic. Job Objects. Job objects encapsulate scheduled or running jobs Each unit can have none or one jobs in the execution queue Each job is attached to exactly one unit. Cancel cancels the job Note that thi s will remove a job from the queue if it is not yet executed but generally will not cause a job that is already in the process of being executed to be aborted This operation may also be requested via the CancelJob method of the Manager object see above , which is sometimes useful to reduce roundtrips. Id is the numeric Id of the job During the runtime of a systemd instance each numeric ID is only assigned once. Unit refers to the unit this job belongs two It is a structure consisting of the name of the unit and a bus path to the unit s object. JobType refers to the job s type and is one of start verify-active stop reload restart try-restart reload-or-start Note that later versions might define additional values. State refers to the job s state and is one of waiting and running The former indicates that a job is currently queued but has not begun to execute yet, the latter indicates that a job is currently being executed. Last edited Tue Feb 25 00 31 10 2014. 6710 Fix misspelled systemd conf igure options, added hint in Makefile 1498.Created by bear on 2014-07-12 09 31 28 00 00.Assignee spstarr Status Resolved closed on 2014-08-06 19 03 04 00 00 Target Version 1 11 6 Last Update 2014-08-06 19 03 18 00 00 in Redmine. I ve encountered some issues regarding the configuration of the systemd files that can be used on ArchLinux I ve shared my experience on the mailing list 1 Meanwhile, I ve figured out why configure complains Please see the patch file. Related, but not necessarily depending on it, the output of make without parameters didn t show the possibility for installing the systemd files Additionally, maybe this was intended so the list doesn t get too long For this, I ve done a second patch file addressing the Makefile only. Now I m stuck The systemd configuration files were copied to the right places after issuing make install-systems But there s still the in and in etc sysconfig icinga I don t know when this should be substituted Maybe someone could give me a hint I ve at tached the resulting files please see description field for absolute file path position. Kind regards, Bernd. The patch files were created according to 2.

No comments:

Post a Comment