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
- 51 LFX Mentorship
- 104 LFX Mentorship: Linux Kernel
- 576 Linux Foundation IT Professional Programs
- 304 Cloud Engineer IT Professional Program
- 125 Advanced Cloud Engineer IT Professional Program
- 53 DevOps Engineer IT Professional Program
- 61 Cloud Native Developer IT Professional Program
- 5 Express Training Courses
- 5 Express Courses - Discussion Forum
- 2K Training Courses
- 19 LFC110 Class Forum
- 7 LFC131 Class Forum
- 27 LFD102 Class Forum
- 158 LFD103 Class Forum
- 20 LFD121 Class Forum
- 1 LFD137 Class Forum
- 61 LFD201 Class Forum
- 1 LFD210 Class Forum
- LFD210-CN Class Forum
- 1 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum
- LFD237 Class Forum
- 23 LFD254 Class Forum
- 611 LFD259 Class Forum
- 105 LFD272 Class Forum
- 1 LFD272-JP クラス フォーラム
- 1 LFD273 Class Forum
- 2 LFS145 Class Forum
- 24 LFS200 Class Forum
- 739 LFS201 Class Forum
- 1 LFS201-JP クラス フォーラム
- 11 LFS203 Class Forum
- 75 LFS207 Class Forum
- 300 LFS211 Class Forum
- 54 LFS216 Class Forum
- 47 LFS241 Class Forum
- 41 LFS242 Class Forum
- 37 LFS243 Class Forum
- 11 LFS244 Class Forum
- 36 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- LFS251 Class Forum
- 140 LFS253 Class Forum
- LFS254 Class Forum
- 1.1K LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 93 LFS260 Class Forum
- 132 LFS261 Class Forum
- 33 LFS262 Class Forum
- 80 LFS263 Class Forum
- 15 LFS264 Class Forum
- 11 LFS266 Class Forum
- 18 LFS267 Class Forum
- 17 LFS268 Class Forum
- 23 LFS269 Class Forum
- 203 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- LFS274 Class Forum
- LFS281 Class Forum
- 236 LFW211 Class Forum
- 172 LFW212 Class Forum
- 7 SKF100 Class Forum
- SKF200 Class Forum
- 903 Hardware
- 219 Drivers
- 74 I/O Devices
- 44 Monitors
- 116 Multimedia
- 209 Networking
- 101 Printers & Scanners
- 85 Storage
- 763 Linux Distributions
- 88 Debian
- 66 Fedora
- 15 Linux Mint
- 13 Mageia
- 24 openSUSE
- 142 Red Hat Enterprise
- 33 Slackware
- 13 SUSE Enterprise
- 357 Ubuntu
- 479 Linux System Administration
- 41 Cloud Computing
- 70 Command Line/Scripting
- Github systems admin projects
- 95 Linux Security
- 78 Network Management
- 108 System Management
- 49 Web Management
- 68 Mobile Computing
- 23 Android
- 30 Development
- 1.2K New to Linux
- 1.1K Getting Started with Linux
- 537 Off Topic
- 131 Introductions
- 217 Small Talk
- 21 Study Material
- 826 Programming and Development
- 278 Kernel Development
- 514 Software Development
- 928 Software
- 260 Applications
- 184 Command Line
- 3 Compiling/Installing
- 76 Games
- 316 Installation
- 61 All In Program
- 61 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)