Exercise 2.6 Create and customize a systemd service
Hello, I am trying to develop this exercise, but I do not understand it, it is mentioned in a stress package that you have to install it.
Where is the stress package?
Thanks!
Comments
-
The "stress" packages is available for most distro's the following should help.
Centos:
yum install stressUbuntu:
apt-get install stressOpenSUSE:
zypper install stress0 -
After:
mv /etc/systemd/system/foo.service /root/it shows error when restart "foo": "Unit not found"
Can you explain why?
0 -
After: (at the end of LAB)
mv /etc/systemd/system/foo.service /root/It shows error: Unit not found.
when trying to start foo service.Can you explain why?
0 -
Hi
I didn't get much out of this exercise because I didn't learn in the course
about the following subjects:
1) systemd
2) systemd-delta
3) [Slice]
CPUQuota=Why aren't these subjects covered in this course?
thx,
Josh
0 -
While these topics are useful, to explain them would require more depth and time than is feasible in LFS201, which is already very long. One should not believe that everything is in this course and one always has to do further study to really be an accomplished admin. This is true through the course that many topics are only surveyed as this is an introductory course, not an in-depth treatment. We do have further discussion in higher level courses as well as in developer-oriented coruses.
0 -
oops, i thought this was LFS201 and responded incorrectly. Please note that system-delta is used in the labs in the Networking Concepts chapter
0 -
Hi
Where exactly is system-delta explained in course LFS211?
I couldn't find it.
Does LFS211 cover all that is required to pass exam?
thx
0 -
Hi
I am still waiting for an answer please.
thx
0 -
Hi, Thank you for bringing this to our attention.
We will expand on the statement: "install the stress package with the appropiate installer " to include "yum installl stress" and "apt-get install stress"
The intention of the exercise is to create a default systemd startup file then onverride the options with plugin files.
We use the command "systemd-delta" to show the override files that are available for a given service. There is additional information in "man systemd-delta" if you wish to explore the caapabilities of the command.The last line of the lab exercise mentions two man pages that hold additional information ,
"man systemd.resource-control " and "man systemd.service" which will explain the CPUQuota option. The slice is a grouping consctuct in systemd to group "like" services together or to isolate services depending on the desired effect.
The "file not found" issue, There should be a subdirectory /etc/systemd/system/foo.service with a file 00-foo.conf in it. If that file exists it will overwrite the file /etc/sytemd/system/foo.service, hence making it redundant, assuming the same values are in each file.Lee
0 -
Hi,
Thx for you answer but I also requested to know if this LFS211 course covers all that is
necessary to pass the exam? Also, do you have a course that teaches step by step the
subject about systemd, quota, slice...?
thx
0 -
Hi,
I'm still waiting for answers to my questions - thx.
0 -
If you read my earlier (misdirected) post where I thought it was about LFS201, the argument still is the same.
1) There are things covered in LFs211 that will not be in the exam, either because the exam might ask about it but didn't due to there are only so many things that can be asked; or it is not material that is to expected on the exam at all but that we thought was important to know for a real sys admin; or
2) there is not enough time to take this up in detail in LFS211; you are expected to do your own self-study on topics to go deeper and broader. This is not an "exam prep" course; it is a course that helps prepare you for the exam. If you don't look at things in more detail than you see in the screens, you are not doing your part of the job.
systemd-delta is mentioned, but not really discussed. Look it up and understasnd it. It's not that difficult and is the way engineers work every day. Is it on the exam? We don't know, we don't write the exams.
0 -
Thanks for your answers.
I am not trying to be a crybaby but rather trying to save time being that
my time is very budgeted so if a subject is covered by the course or another
course then I could learn it within 1/10th the time and thus save precious time.
Two questions:
1) Does LF have an exam prep?
2) Accourding to your knowledge, how is LF211 vs RHCE test? Are they the same (more or less)? I want to take both.
thx
0 -
1) yes. many resources and details at training.linuxfoundation.org click on certification
2) LFS211 should perpare you for RHCE (assuming you have LFS201 and LFS101x experience as pre-reqs) LFS211 and LFCE are often sold together, I don' t know what you did
0 -
Thanks for your answers.
I am not trying to be a crybaby but rather trying to save time being that
my time is very budgeted so if a subject is covered by the course or another
course then I could learn it within 1/10th the time and thus save precious time.
Two questions:
1) Does LF have an exam prep?
2) Accourding to your knowledge, how is LF211 vs RHCE test? Are they the same (more or less)? I want to take both.
thx
0 -
"yum install stress" failed for me because the default configured yum reposotories on Centos 7.3.1611 do not contain Stress. Adding the EPEL Repository to my yum repos fixed the problem. To assist anyone who is running CentOS and ran into the same problem as I did when running "yum install stress", I've included the steps below to include EPEL Repositories in your yum repos and install the stress package:
# sudo yum install -y epel-release
# sudo yum install -y stress
1 -
After write this command:
$ cat /usr/lib/systemd/system/foo.service
I get this result:
cat: /usr/lib/systemd/system/foo.service: No such file or directory
Can someone help me wiht that?
0 -
did you create the file first as inidcated in the lab?
0 -
Hi coop!!
Thanks, i didn't realize that. Thank you very much!!
0 -
Hello all!
I Just started the course today and already have a question pertaining to this thread. I, like others here, find the wording in exercise 2.6 confusing, and this part in particular:
"Since the /usr/lib/systemd/system/foo.service may be altered by the vendor at update time, create a unit file in /etc/
systemd/system/foo.service for the stress service and change the parameters slightly so it is easy to identify which unit
file is being used. It is normal to copy the vendor unit file into the /etc/systemd/system/ directory and make appropriate
customizations.
$ cat /etc/systemd/system/foo.service"Is this a typo: "create a unit file in /etc/systemd/system/foo.service"? Should that be the creation of a new directory /etc/systemd/system/foo.service.d? Otherwise the instructions are telling us to place a file called foo.service in a directory called foo.service. That don't work. Then we are shown the contents of a file named foo.service that is not in a directory called foo.service.d but where it was located for the preceding part of the exercise.
The function of this part of the exercise seems to be to set up a config file for the stress service that escapes overwriting through updates by virtue of its being in a foo.service.d directory. But the text communicates this process poorly, particularly as the app in question – stress – does not come with systemd config files anyway.
Anyway, I added a directory called stress.service.d, copied stress.service into that directory, changed the parameters of that copied file as per the instructions, restarted the service using systemctl (centos) but the parameters were taken from my file /etc/systemd/system/stress.service, as evidenced by the output of systemctl status stress.
So I'm confused by this exercise and would like clarification. The answers offered to other students in this thread thus far don't clear this matter up for me.
Cheers,
Toby0 -
Apologies to all concerned. I just saw my error and feel like a fool. The second file is located under /etc, not under /usr. Blimey, what an oversight!
0 -
Hello,
I'm getting this error, someone knows why?● foo.service - Example service unit to run stress
Loaded: loaded (/usr/lib/systemd/system/foo.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/foo.service.d
└─00-foo.conf
Active: active (running) since Tue 2018-09-18 01:55:09 UTC; 18s ago
Main PID: 2734 (stress)
CGroup: /system.slice/foo.service
├─2734 /usr/bin/stress --cpu 1 --io 1 --vm 1 --vm-bytes 1G
├─2735 /usr/bin/stress --cpu 1 --io 1 --vm 1 --vm-bytes 1G
├─2736 /usr/bin/stress --cpu 1 --io 1 --vm 1 --vm-bytes 1G
└─2737 /usr/bin/stress --cpu 1 --io 1 --vm 1 --vm-bytes 1G
Sep 18 01:55:09 centos-training-1 systemd[1]: [/etc/systemd/system/foo.service.d/00-foo.conf:6] Unknown lvalue 'Slice' in section 'Install'
Sep 18 01:55:09 centos-training-1 systemd[1]: Started Example service unit to run stress.
Sep 18 01:55:09 centos-training-1 systemd[1]: Starting Example service unit to run stress...
Sep 18 01:55:09 centos-training-1 stress[2734]: stress: info: [2734] dispatching hogs: 1 cpu, 1 io, 1 vm, 0 hdd0 -
Hi, can you please post your 00-foo.conf file.
0 -
I have reviwed it 1000 times....
[Service]
ExecStart=
ExecStart=/usr/bin/stress --cpu 1 --io 1 --vm 1 --vm-bytes 100M
Slice=foo.sliceIf you chek systemctl status foo, you can see that the "Slice" word is correct, i couldn solve it.
I'm alredy tried in other system and it worked perfectly0 -
The "Slice" directive we put into /etc/systemd/system/foo.slice file. Can we see a copy of the foo.slice file?
0 -
I'm getting this error:
cat: unrecognized option '--cpu' Try 'cat --help' for more information.
Anyone know why?
0 -
I believe you are building and modifying the /etc/systemd/system/foo.slice file. It would be a great help if we can see your file.
Please confirm this is exercise 2.6 we are chatting about.
Thanks Lee
0
Categories
- All Categories
- 207 LFX Mentorship
- 207 LFX Mentorship: Linux Kernel
- 734 Linux Foundation IT Professional Programs
- 339 Cloud Engineer IT Professional Program
- 166 Advanced Cloud Engineer IT Professional Program
- 66 DevOps Engineer IT Professional Program
- 132 Cloud Native Developer IT Professional Program
- 122 Express Training Courses
- 122 Express Courses - Discussion Forum
- 6K Training Courses
- 40 LFC110 Class Forum - Discontinued
- 66 LFC131 Class Forum
- 39 LFD102 Class Forum
- 222 LFD103 Class Forum
- 17 LFD110 Class Forum
- 34 LFD121 Class Forum
- 17 LFD133 Class Forum
- 6 LFD134 Class Forum
- 17 LFD137 Class Forum
- 70 LFD201 Class Forum
- 3 LFD210 Class Forum
- 2 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 1 LFD233 Class Forum
- 3 LFD237 Class Forum
- 23 LFD254 Class Forum
- 689 LFD259 Class Forum
- 110 LFD272 Class Forum
- 3 LFD272-JP クラス フォーラム
- 10 LFD273 Class Forum
- 113 LFS101 Class Forum
- LFS111 Class Forum
- 2 LFS112 Class Forum
- 1 LFS116 Class Forum
- 3 LFS118 Class Forum
- 3 LFS142 Class Forum
- 3 LFS144 Class Forum
- 3 LFS145 Class Forum
- 1 LFS146 Class Forum
- 2 LFS147 Class Forum
- 8 LFS151 Class Forum
- 1 LFS157 Class Forum
- 18 LFS158 Class Forum
- 5 LFS162 Class Forum
- 1 LFS166 Class Forum
- 3 LFS167 Class Forum
- 1 LFS170 Class Forum
- 1 LFS171 Class Forum
- 2 LFS178 Class Forum
- 2 LFS180 Class Forum
- 1 LFS182 Class Forum
- 4 LFS183 Class Forum
- 30 LFS200 Class Forum
- 737 LFS201 Class Forum - Discontinued
- 2 LFS201-JP クラス フォーラム
- 17 LFS203 Class Forum
- 118 LFS207 Class Forum
- 1 LFS207-DE-Klassenforum
- LFS207-JP クラス フォーラム
- 301 LFS211 Class Forum
- 55 LFS216 Class Forum
- 50 LFS241 Class Forum
- 44 LFS242 Class Forum
- 37 LFS243 Class Forum
- 13 LFS244 Class Forum
- 1 LFS245 Class Forum
- 45 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- LFS251 Class Forum
- 146 LFS253 Class Forum
- LFS254 Class Forum
- LFS255 Class Forum
- 6 LFS256 Class Forum
- LFS257 Class Forum
- 1.2K LFS258 Class Forum
- 9 LFS258-JP クラス フォーラム
- 116 LFS260 Class Forum
- 156 LFS261 Class Forum
- 41 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 23 LFS267 Class Forum
- 18 LFS268 Class Forum
- 29 LFS269 Class Forum
- 200 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- LFS274 Class Forum
- 3 LFS281 Class Forum
- 8 LFW111 Class Forum
- 257 LFW211 Class Forum
- 180 LFW212 Class Forum
- 12 SKF100 Class Forum
- SKF200 Class Forum
- SKF201 Class Forum
- 791 Hardware
- 199 Drivers
- 68 I/O Devices
- 37 Monitors
- 98 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 85 Storage
- 754 Linux Distributions
- 82 Debian
- 67 Fedora
- 16 Linux Mint
- 13 Mageia
- 23 openSUSE
- 147 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 351 Ubuntu
- 465 Linux System Administration
- 39 Cloud Computing
- 71 Command Line/Scripting
- Github systems admin projects
- 91 Linux Security
- 78 Network Management
- 101 System Management
- 47 Web Management
- 56 Mobile Computing
- 17 Android
- 28 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 366 Off Topic
- 114 Introductions
- 171 Small Talk
- 20 Study Material
- 534 Programming and Development
- 293 Kernel Development
- 223 Software Development
- 1.2K Software
- 212 Applications
- 182 Command Line
- 3 Compiling/Installing
- 405 Games
- 312 Installation
- 79 All In Program
- 79 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)