Advertisement
sandervanvugt

systemd nov20

Nov 9th, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.50 KB | None | 0 0
  1. [root@localhost system]# cat myunit.service
  2. [Unit]
  3.  
  4. [Service]
  5. Type=simple
  6. ExecStart=sleep 3600
  7. Restart=always
  8. RestartSec=20s
  9.  
  10. [Install]
  11. WantedBy=multi-user.target
  12.  
  13. ######## 1 sudo -i
  14. 2 ls .config/
  15. 3 mkdir -p .config/systemd/user
  16. 4 sudo yum module install container-tools
  17. 5 podman run -d --name mynginx -p 8080:80 nginx
  18. 6 podman ps
  19. 7 cd .config/systemd/user/
  20. 8 podman generate systemd --name mynginx --files
  21. 9 ls
  22. 10 vim container-mynginx.service
  23. 11 systemctl --user daemon-reload
  24. 12 systemctl --user enable container-mynginx.service
  25. 13 history
  26. 14 sudo reboot
  27. 15 systemctl --user status container-mynginx.service
  28. 16 podman ps
  29. 17 history
  30.  
  31. #########
  32. [root@localhost ~]# history
  33. 1 systemctl -t help
  34. 2 systemd-analyze -h
  35. 3 systemd-analyze blame
  36. 4 systemd-analyze security sshd
  37. 5 cd /usr/lib/systemd/system
  38. 6 ls
  39. 7 ls | wc
  40. 8 pwd
  41. 9 cd /etc/systemd/system/
  42. 10 pwd
  43. 11 ls
  44. 12 cd /run/systemd/system/
  45. 13 ls
  46. 14 systemctl cat cron.service
  47. 15 systemctl cat crond.service
  48. 16 systemctl edit crond.service
  49. 17 systemctl cat crond.service
  50. 18 systemctl edit crond.service
  51. 19 systemctl cat crond.service
  52. 20 man 7 systemd.directives
  53. 21 man systemd.service
  54. 22 man -k systemd
  55. 23 mandb
  56. 24 man -k systemd
  57. 25 man -k systemd | less
  58. 26 export SYSTEMD_EDITOR=vim
  59. 27 systemctl edit sshd.service
  60. 28 vim /etc/profile.d/virocks.conf
  61. 29 systemctl show --all crond
  62. 30 systemctl cat crond
  63. 31 systemctl show crond
  64. 32 systemctl show --all crond
  65. 33 rpm -qa | grep systemd
  66. 34 systemctl -v
  67. 35 systemctl --version
  68. 36 cd /etc/
  69. 37 cd systemd/
  70. 38 ls
  71. 39 vim system.conf
  72. 40 cd system/
  73. 41 ls
  74. 42 cd ..
  75. 43 pwd
  76. 44 systemctl list-units -t target
  77. 45 systemctl list-units
  78. 46 systemctl list-units -t target
  79. 47 cd /usr/lib/systemd/system
  80. 48 grep -i isolate *.target
  81. 49 systemctl list-dependencies
  82. 50 systemctl get-default
  83. 51 systemctl isolate multi-user.target
  84. 52 systemctl list-dependencies
  85. 53 systemctl isolate reboot.target
  86. 54 yum install -y git
  87. 55 git clone https://github.com/sandervanvugt/systemd
  88. 56 git clone https://github.com/sandervanvugt/luth
  89. 57 ls systemd/
  90. 58 history
  91. 59 history | less
  92. 60 cd systemd/
  93. 61 ./countdown 12
  94. 62 vim /root/systemd/countdown
  95. 63 ./countdown 12
  96. 64 vim /root/systemd/countdown
  97. 65 ./countdown 12
  98. 66 pwd
  99. 67 cd /usr/lib/systemd/
  100. 68 ls *target
  101. 69 ls
  102. 70 cd system
  103. 71 ls *target
  104. 72 vim printer.target
  105. 73 cd /etc/systemd/system/
  106. 74 ls
  107. 75 cd printer.target.wants/
  108. 76 ls
  109. 77 ls -l
  110. 78 vim cups.service
  111. 79 cd
  112. 80 yum install -y httpd
  113. 81 systemctl cat httpd.service
  114. 82 systemctl status httpd.service
  115. 83 systemctl enable --now httpd
  116. 84 yum install -y nginx
  117. 85 systemctl status nginx
  118. 86 systemctl cat nginx
  119. 87 systemctl mask nginx.service
  120. 88 systemctl start nginx.service
  121. 89 history
  122. 90 systemctl edit httpd.service
  123. 91 SYSTEMD_EDITOR=vim
  124. 92 systemctl cat httpd.service
  125. 93 vim /etc/ssh/sshd_config
  126. 94 systemctl stop sshd; systemctl start sshd
  127. 95 systemctl status sshd.service
  128. 96 systemctl disable --now sshd.service
  129. 97 systemctl status sshd.service
  130. 98 systemctl start sshd.service
  131. 99 systemctl status sshd.service
  132. 100 vim /etc/ssh/sshd_config
  133. 101 systemctl enable --now sshd
  134. 102 yum install vsftpd
  135. 103 systemctl cat httpd
  136. 104 systemctl edit httpd
  137. 105 systemctl cat httpd
  138. 106 systemctl status httpd
  139. 107 systemctl daemon-reload
  140. 108 systemctl stop httpd
  141. 109 ps aux | grep http
  142. 110 ps aux | grep vsf
  143. 111 systemctl start httpd
  144. 112 ps aux | grep http
  145. 113 ps aux | grep vsf
  146. 114 kill -9 6853
  147. 115 ps aux | grep http
  148. 116 systemctl status httpd
  149. 117 systemctl status vsftpd
  150. 118 systemctl stop httpd
  151. 119 systemctl start httpd
  152. 120 systemctl list-dependencies
  153. 121 systemctl cat httpd
  154. 122 cd /etc/systemd/system/
  155. 123 vim myunit.service
  156. 124 systemctl cat httpd
  157. 125 vim myunit.service
  158. 126 systemctl status myunit.service
  159. 127 systemctl start myunit.service
  160. 128 systemctl status myunit.service
  161. 129 systemctl enable myunit.service
  162. 130 vim myunit.service
  163. 131 systemctl cat httpd.service
  164. 132 vim myunit.service
  165. 133 systemctl cat sshd.service
  166. 134 vim myunit.service
  167. 135 systemctl enable myunit.service
  168. 136 ps aux
  169. 137 kill -9 7369
  170. 138 systemctl status myunit.service
  171. 139 cat myunit.service
  172. 140 cd
  173. 141 history
  174. 142 systemd/countdown 12
  175. 143 vim systemd/countdown
  176. 144 cat /etc/fstab
  177. 145 cd /run/systemd/generator/
  178. 146 ls
  179. 147 vim -.mount
  180. 148 vim -- -.mount
  181. 149 poweroff
  182. 150 cd /run/systemd/generator/
  183. 151 ls
  184. 152 cp boot.mount /etc/systemd/system/data.mount
  185. 153 fdisk /dev/sda
  186. 154 mkfs.xfs /dev/sda3
  187. 155 mkdir /data
  188. 156 cd /etc/systemd/
  189. 157 vim data.mount
  190. 158 ls
  191. 159 pwd
  192. 160 cd system/
  193. 161 ls
  194. 162 vim data.mount
  195. 163 systemctl enable --now data.mount
  196. 164 vim data.mount
  197. 165 systemctl daemon-reload
  198. 166 systemctl enable --now data.mount
  199. 167 mount
  200. 168 cd /usr/lib/systemd/system
  201. 169 ls *mount
  202. 170 vim tmp.mount
  203. 171 systemctl enable --now tmp.mount
  204. 172 cd /tmp
  205. 173 ls
  206. 174 cd /
  207. 175 cd
  208. 176 cd systemd/
  209. 177 ls
  210. 178 vim nfsdata.mount
  211. 179 vim nfsdata.automount
  212. 180 vim /etc/exports
  213. 181 systemctl enable --now nfs-server
  214. 182 showmount -e localhost
  215. 183 pwd
  216. 184 vim nfsdata.mount
  217. 185 mkdir /nfsdata
  218. 186 systemctl enable nfsdata.automount --now
  219. 187 cp nfsdata* /etc/systemd/system
  220. 188 systemctl enable nfsdata.automount --now
  221. 189 mount
  222. 190 systemctl status nfsdata.mount
  223. 191 cd /nfsdata/
  224. 192 mount
  225. 193 systemctl status nfsdata.mount
  226. 194 cd
  227. 195 cd systemd/
  228. 196 ls
  229. 197 lscpu
  230. 198 cd /sys/bus/cpu/
  231. 199 ls
  232. 200 cd devices/
  233. 201 ls
  234. 202 echo 0 > cpu1/online
  235. 203 pwd
  236. 204 lscpu
  237. 205 cd /root/systemd/
  238. 206 vim stress1.service
  239. 207 vim stress2.service
  240. 208 cp stress* /etc/systemd/system/
  241. 209 systemctl start stress1
  242. 210 systemctl start stress2
  243. 211 top
  244. 212 loginctl list-users
  245. 213 loginctl enable-linger student
  246. 214 exit
  247. 215 history
  248. [root@localhost ~]#
  249.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement