技术精品翻译

1. 金步国作品集 

systemd的介绍

example for systemd.slice

sudo tee -a /usr/sbin/my-simple-daemon > /dev/null <<EOT
#!/bin/bash
while true
do
  echo "Welcome this is my test for slice, sleep 5s"
  sleep 5
done
EOT


sudo chmod a+x /usr/sbin/my-simple-daemon

sudo tee -a /etc/systemd/system/mytest@test-sleep.service > /dev/null <<EOT
[Unit]
Description= Just a test for slice

[Service]
# Type=
ExecStart=/usr/sbin/my-simple-daemon -d

[Install]
WantedBy=multi-user.target
EOT

sudo systemctl start mytest@test-sleep.service

sudo systemctl  list-units |grep mytest

destroy

sudo systemctl stop mytest@test-sleep.service
sudo rm /etc/systemd/system/mytest@test-sleep.service
sudo rm /usr/sbin/my-simple-daemon

阮一峰 介绍 Systemd 入门教程:实战篇  

2. linux中文手册

3. Freedesktop英文文档

systemd introduction 

4.  parted 

Using parted’s resizepart non-interactively on a busy partition   

> parted /dev/sda resizepart 2 yes 100%

The yes is in there in order to automatically choose to continue despite the warnings. This doesn't work on Ansible, because it still requires user interaction for the warnings. Note that parted also has a scripted mode (with the -s switch) which doesn't expect any interaction from the user, but that turned out to be buggy in our specific combination of command and options.

The eventual solution was to use an undocumented switch ---pretend-input-tty. Since Ansible uses a TTYless SSH session, and Parted's non-interactive mode doesn't work, this was the only way out.

> parted ---pretend-input-tty /dev/sda resizepart 2 yes 100%

The eventual solution was to use an undocumented switch ---pretend-input-tty. Since Ansible uses a TTYless SSH session, and Parted’s non-interactive mode doesn’t work, this was the only way out.

Resize partition to maximum using parted in non-interactive mode

Auto expand last partition to use all unallocated space, using parted in batch mode

5. Linux命令大全 

sysctl命令

trap命令 / trap 

6. YAML 语言教程

7.  Ansible中文权威指南  

TIPS

 

 

posted @ 2019-10-30 13:45  lvmxh  阅读(225)  评论(0编辑  收藏  举报