Example 3.1. An example of a patch file
From a6419e00b515765085cc4e646c3822ebdda607df Mon Sep 17 00:00:00 2001
From: Pete Travis <immanetize@fedoraproject.org>
Date: Mon, 30 Dec 2013 21:52:57 -0700
Subject: [PATCH] Update commands for starting, stopping, and checking the
status of abrtd to use systemctl instead of service/chkconfig
---
en-US/Automatic_Bug_Reporting_Tool_ABRT.xml | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/en-US/Automatic_Bug_Reporting_Tool_ABRT.xml b/en-US/Automatic_Bug_Reporting_Tool_ABRT.xml
index 1093dc8..f01bb33 100644
--- a/en-US/Automatic_Bug_Reporting_Tool_ABRT.xml
+++ b/en-US/Automatic_Bug_Reporting_Tool_ABRT.xml
@@ -88,18 +88,18 @@
Your next step should be to verify that <systemitem
class="daemon">abrtd</systemitem> is running. The daemon is typically configured to start up at boot time. You can use the following command as root to verify its current status:
</para>
- <screen>~]# <command>service abrtd status</command>
+ <screen>~]# <command>systemctl status abrtd</command>
abrtd (pid 1535) is running...</screen>
<para>
- If the <command>service</command> command returns the <computeroutput>abrt is stopped</computeroutput> message, the daemon is not running. It can be started for the current session by entering this command:
+ If the <command>systemctl</command> command returns the <computeroutput>Active: inactive (dead)</computeroutput> message, the daemon is not running. It can be started for the current session by entering this command:
</para>
- <screen>~]# <command>service abrtd start</command>
+ <screen>~]# <command>systemctl start abrtd </command>
Starting abrt daemon: [ OK ]</screen>
<para>
- You can run the following <command>chkconfig</command> command to ensure that the <systemitem
+ You can run the following <command>systemctl</command> command to ensure that the <systemitem
class="daemon">abrtd</systemitem> service initializes every time the system starts up:
</para>
- <screen>~]# <command>chkconfig abrtd on</command></screen>
+ <screen>~]# <command>systemctl enable abrtd </command></screen>
<para>
Similarly, you can follow the same steps to check and configure the <systemitem
class="service">abrt-ccpp</systemitem> service if you want <application>ABRT</application> to catch C/C++ crashes. To set <application>ABRT</application> to detect kernel oopses, use the same steps for the <systemitem
@@ -119,12 +119,12 @@ kernel.panic = 0</screen>
<para>
Finally, you can verify that the <systemitem
class="service">ABRT notification applet</systemitem> is running:
- </para>
- <screen>~]$ <command>ps -el | grep abrt-applet</command>
+ </para>
+ <screen>~]$ <command>ps -el | grep abrt-applet</command>
0 S 500 2036 1824 0 80 0 - 61604 poll_s ? 00:00:00 abrt-applet</screen>
- <para>
- If the <application>ABRT</application> notification applet is not running, you can start it manually in your current desktop session by running the <systemitem
- class="service">abrt-applet</systemitem> program:
+ <para>
+ If the <application>ABRT</application> notification applet is not running, you can start it manually in your current desktop session by running the <systemitem
+ class="service">abrt-applet</systemitem> program:
</para>
<screen>~]$ <command>abrt-applet &</command>
[1] 2261</screen>
--
1.8.4.2
service to the current systemctl command.
Procedure 3.1. Patch creation workflow
repo column of the table has a link to the guide's git repository. Open the link, and you'll see the Clone section at the bottom of the page, listing the repository's URLs.
ssh:// and select Copy Link Location.
https:// and select Copy Link Location.
ssh:// url, even if you do not currently have commit access. If you later gain commit access, you won't have to go back and change the upstream location of the repo.
cd ~/fedora-docs
git clone ssh://git.fedorahosted.org/git/docs/system-administrators-guide.git
cd system-administrators-guide
git pull
stash them. The files will returned to the unchanged state, and you can come back to them later. For detailed information, refer to man git-stash.
git stash
# continue with patch process, then bring back your stashed state with:
git stash pop
git push
git reset --hard origin/master
git branch abrt-systemctl-not-service
git checkout abrt-systemctl-not-service
grep "<command>service" en-US/*.xml
en-US/Automatic_Bug_Reporting_Tool_ABRT.xml: <screen>~]# <command>service abrtd status</command>
en-US/Automatic_Bug_Reporting_Tool_ABRT.xml: If the <command>service</command> command returns the <computeroutput>abrt is stopped</computeroutput> message, the daemon is not running. It can be started for the current session by entering this command:
en-US/Automatic_Bug_Reporting_Tool_ABRT.xml: <screen>~]# <command>service abrtd start</command>
grep command has found the file we want to edit, en-US/Automatic_Bug_Reporting_Tool_ABRT.xml. Open the file in your favorite editor and make the required changes:
vim en-US/Automatic_Bug_Reporting_Tool_ABRT.xml
or:
emacs en-US/Automatic_Bug_Reporting_Tool_ABRT.xml
or:
gedit en-US/Automatic_Bug_Reporting_Tool_ABRT.xml
publican build --langs en-US --formats html
firefox tmp/en-US/html/index.html
git status
# On branch abrt-systemctl-not-service # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: en-US/Automatic_Bug_Reporting_Tool_ABRT.xml # no changes added to commit (use "git add" and/or "git commit -a")
git commit en-US/Automatic_Bug_Reporting_Tool_ABRT.xml
RHBZ#439858 is enough but you can also cite the full URL if you prefer.
Default Editor
~/.bashrc, such as:
export EDITOR="/usr/bin/emacs"
git commit en-US/Automatic_Bug_Reporting_Tool_ABRT.xml \ -m "Update commands for starting, stopping, and checking the status \ of abrtd to use systemctl instead of service/chkconfig"
git status
# On branch abrt-systemctl-not-service nothing to commit, working directory clean
git format-patch master
0001-Update-commands-for-starting-stopping-and-checking-t.patch
git checkout master
git clean -xdf
git branch -D abrt-systemctl-not-service
Deleted branch abrt-systemctl-not-service (was a6419e0).
git apply 0001-Update-commands-for-starting-stopping-and-checking-t.patch