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
- 217 LFX Mentorship
- 217 LFX Mentorship: Linux Kernel
- 788 Linux Foundation IT Professional Programs
- 352 Cloud Engineer IT Professional Program
- 177 Advanced Cloud Engineer IT Professional Program
- 82 DevOps Engineer IT Professional Program
- 146 Cloud Native Developer IT Professional Program
- 137 Express Training Courses
- 137 Express Courses - Discussion Forum
- 6.1K Training Courses
- 46 LFC110 Class Forum - Discontinued
- 70 LFC131 Class Forum
- 42 LFD102 Class Forum
- 226 LFD103 Class Forum
- 18 LFD110 Class Forum
- 36 LFD121 Class Forum
- 18 LFD133 Class Forum
- 7 LFD134 Class Forum
- 18 LFD137 Class Forum
- 71 LFD201 Class Forum
- 4 LFD210 Class Forum
- 5 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 2 LFD233 Class Forum
- 4 LFD237 Class Forum
- 24 LFD254 Class Forum
- 693 LFD259 Class Forum
- 111 LFD272 Class Forum
- 4 LFD272-JP クラス フォーラム
- 12 LFD273 Class Forum
- 144 LFS101 Class Forum
- 1 LFS111 Class Forum
- 3 LFS112 Class Forum
- 2 LFS116 Class Forum
- 4 LFS118 Class Forum
- 4 LFS142 Class Forum
- 5 LFS144 Class Forum
- 4 LFS145 Class Forum
- 2 LFS146 Class Forum
- 3 LFS147 Class Forum
- 1 LFS148 Class Forum
- 15 LFS151 Class Forum
- 2 LFS157 Class Forum
- 25 LFS158 Class Forum
- 7 LFS162 Class Forum
- 2 LFS166 Class Forum
- 4 LFS167 Class Forum
- 3 LFS170 Class Forum
- 2 LFS171 Class Forum
- 3 LFS178 Class Forum
- 3 LFS180 Class Forum
- 2 LFS182 Class Forum
- 5 LFS183 Class Forum
- 31 LFS200 Class Forum
- 737 LFS201 Class Forum - Discontinued
- 3 LFS201-JP クラス フォーラム
- 18 LFS203 Class Forum
- 130 LFS207 Class Forum
- 2 LFS207-DE-Klassenforum
- 1 LFS207-JP クラス フォーラム
- 302 LFS211 Class Forum
- 56 LFS216 Class Forum
- 52 LFS241 Class Forum
- 48 LFS242 Class Forum
- 38 LFS243 Class Forum
- 15 LFS244 Class Forum
- 2 LFS245 Class Forum
- LFS246 Class Forum
- 48 LFS250 Class Forum
- 2 LFS250-JP クラス フォーラム
- 1 LFS251 Class Forum
- 150 LFS253 Class Forum
- 1 LFS254 Class Forum
- 1 LFS255 Class Forum
- 7 LFS256 Class Forum
- 1 LFS257 Class Forum
- 1.2K LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 118 LFS260 Class Forum
- 159 LFS261 Class Forum
- 42 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 24 LFS267 Class Forum
- 22 LFS268 Class Forum
- 30 LFS269 Class Forum
- LFS270 Class Forum
- 202 LFS272 Class Forum
- 2 LFS272-JP クラス フォーラム
- 1 LFS274 Class Forum
- 4 LFS281 Class Forum
- 9 LFW111 Class Forum
- 259 LFW211 Class Forum
- 181 LFW212 Class Forum
- 13 SKF100 Class Forum
- 1 SKF200 Class Forum
- 1 SKF201 Class Forum
- 795 Hardware
- 199 Drivers
- 68 I/O Devices
- 37 Monitors
- 102 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 85 Storage
- 758 Linux Distributions
- 82 Debian
- 67 Fedora
- 17 Linux Mint
- 13 Mageia
- 23 openSUSE
- 148 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 353 Ubuntu
- 468 Linux System Administration
- 39 Cloud Computing
- 71 Command Line/Scripting
- Github systems admin projects
- 93 Linux Security
- 78 Network Management
- 102 System Management
- 47 Web Management
- 63 Mobile Computing
- 18 Android
- 33 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 370 Off Topic
- 114 Introductions
- 173 Small Talk
- 22 Study Material
- 805 Programming and Development
- 303 Kernel Development
- 484 Software Development
- 1.8K Software
- 261 Applications
- 183 Command Line
- 3 Compiling/Installing
- 987 Games
- 317 Installation
- 96 All In Program
- 96 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)