-
Notifications
You must be signed in to change notification settings - Fork 23
PED-12154: creates structure #615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
2093f74
ce63d81
fbd0985
b23d549
772f9a1
2c2066f
3451145
38a5dcf
f8ddc42
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| ## ---------------------------- | ||
| ## Doc Config File for the DB Assembly test | ||
| ## ---------------------------- | ||
| ## | ||
| ## Basics | ||
| MAIN="systemd-management.asm.xml" | ||
| SRC_DIR="articles" | ||
| IMG_SRC_DIR="images" | ||
| ## Profiling | ||
| PROFOS="sles4sap" | ||
| #PROFARCH="x86_64;zseries;power;aarch64" | ||
|
|
||
| ## stylesheet location | ||
| STYLEROOT="/usr/share/xml/docbook/stylesheet/suse2022-ns" | ||
| FALLBACK_STYLEROOT="/usr/share/xml/docbook/stylesheet/suse2021-ns" | ||
|
|
||
| DOCBOOK5_RNG_URI="urn:x-suse:rng:v2:geekodoc-flat" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| ## ---------------------------- | ||
| ## Doc Config File for the DB Assembly test | ||
| ## ---------------------------- | ||
| ## | ||
| ## Basics | ||
| MAIN="systemd-management.asm.xml" | ||
| SRC_DIR="articles" | ||
| IMG_SRC_DIR="images" | ||
| ## Profiling | ||
| PROFOS="sles" | ||
| PROFCONDITION="16.0" | ||
|
|
||
| ## stylesheet location | ||
| STYLEROOT="/usr/share/xml/docbook/stylesheet/suse2022-ns" | ||
| FALLBACK_STYLEROOT="/usr/share/xml/docbook/stylesheet/suse2021-ns" | ||
|
|
||
| DOCBOOK5_RNG_URI="urn:x-suse:rng:v2:geekodoc-flat" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,7 +35,9 @@ | |
| <resource xml:id="_systemd-manage-troubleshoot" href="../tasks/systemd-manage-troubleshoot.xml"> | ||
| <description>Troubleshooting systemd management </description> | ||
| </resource> | ||
|
|
||
| <resource xml:id="_systemd-convert-sysv" href="../tasks/systemd.sysv-convert.xml"> | ||
| <description>Converting SysV init to systemd </description> | ||
| </resource> | ||
| </resources> | ||
| <!-- References --> | ||
| <resources> | ||
|
|
@@ -69,18 +71,18 @@ | |
| <merge> | ||
| <title>Managing &systemd; Services</title> | ||
| <revhistory xml:id="rh-systemd-services"> | ||
| <revision><date>2025-11-04</date> | ||
| <revision><date>2025-12-16</date> | ||
| <revdescription> | ||
| <para> | ||
| Initial version | ||
| Added a procedure to convert Sys V init to systemd | ||
| </para> | ||
| </revdescription> | ||
| </revision> | ||
| </revhistory> | ||
| <!-- TODO: provide a listing of possible and validatable meta entry values. Maybe in our geekodoc repo? --> | ||
| <!-- add author's e-mail --> | ||
| <meta name="maintainer" content="[email protected]" its:translate="no"/> | ||
|
|
||
| <!-- this does not work yet. Use the dm tags listed below for now | ||
| <meta name="bugtracker" its:translate="no"> | ||
| <phrase role="url">https://bugzilla.suse.com/enter_bug.cgi</phrase> | ||
|
|
@@ -170,6 +172,12 @@ | |
| Basic understanding of Linux processes, daemons and control groups | ||
| </para> | ||
| </listitem> | ||
| <listitem> | ||
| <para> | ||
| <link | ||
| xlink:href="https://documentation.suse.com/sles/16.0/html/SLES-systemd-basics/index.html#systemctl-commands">Understanding unit files</link> | ||
| </para> | ||
| </listitem> | ||
| </itemizedlist> | ||
| </listitem> | ||
| </varlistentry> | ||
|
|
@@ -181,6 +189,7 @@ | |
| <!-- pull in a topic as is --> | ||
| <!-- pull in a topic and switch the title --> | ||
| <module resourceref="_about-systemd" renderas="section"/> | ||
| <module resourceref="_systemd-convert-sysv" renderas="section"/> | ||
| <module resourceref="_starting-systemd-services" renderas="section"/> | ||
| <module resourceref="_enabling-systemd-services" renderas="section"/> | ||
| <module resourceref="_terminal-signals-systemd" renderas="section"/> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE topic | ||
| [ | ||
| <!ENTITY % entities SYSTEM "../common/generic-entities.ent"> | ||
| %entities; | ||
| ]> | ||
| <topic xml:id="systemd-convert-sysv" xml:lang="en" | ||
| role="task" | ||
| xmlns="http://docbook.org/ns/docbook" version="5.1" | ||
| xmlns:its="http://www.w3.org/2005/11/its" | ||
| xmlns:xi="http://www.w3.org/2001/XInclude" | ||
| xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
| <info> | ||
| <meta name="maintainer" content="[email protected]" its:translate="no"/> | ||
| <title>Converting SysV init to &systemd; </title> | ||
| </info> | ||
| <para> | ||
| SysV init is the traditional initialization system used by older Linux distributions. | ||
| It is often referred to as init. &systemd; is now the default and only initialization system for <phrase os="sles"> | ||
| &productname; 16</phrase> <phrase os="sle4sap"></phrase>. | ||
| </para> | ||
| <example> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please make the procedure more generic and state that the mentioned init files are a must-have conversion (if they are).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not understand this " more generic" as the intent to give an example and jira mentions boot.local so I used that
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose there may be more scripts that need to be migrated, hence the more generic while using the boot as an example. Here it seems these two are the only ones that needs to migrated. |
||
| <title>Converting <literal>boot.local</literal> and <literal>after.local</literal> to &systemd;</title> | ||
| <para>The SysV init script files like <filename>/etc/init.d/boot.local</filename> and <filename>/etc/init.d/after.local</filename> | ||
| were used for running custom commands or scripts at the end of the boot process.</para> | ||
| <para>In a &systemd; environment, to run your own startup script,it is recommended to create a custom &systemd; service unit file. | ||
| The <literal>boot.local</literal> script typically runs very early in the boot process, while <literal>after.local</literal> runs later, after most system services are up. | ||
| </para> | ||
| <procedure> | ||
| <step> | ||
| <para><emphasis role="bold">Create the scripts:</emphasis> Create script files with the commands and make it executable. | ||
| For example:</para> | ||
| <itemizedlist> | ||
| <listitem><para>For <literal>boot.local</literal>actions, create <filename>/usr/local/bin/my.early-boot.sh</filename> </para></listitem> | ||
| <listitem><para>For <literal>after.local</literal>actions, create <filename>/usr/local/bin/my.late-boot.sh</filename> </para></listitem> | ||
| </itemizedlist> | ||
| </step> | ||
| <step> | ||
| <para><emphasis role="bold">Create the &systemd; unit files:</emphasis> Create the <literal>.service</literal> unit files in the <filename>/etc/systemd/system/</filename> directory. | ||
| For example:</para> | ||
| <itemizedlist> | ||
| <listitem><para>For <literal>boot.local</literal>, this service should run before basic system initialization. | ||
| Create a service file, <filename>/etc/systemd/system/my-early-boot.service</filename>:</para> | ||
| <screen>[Unit] | ||
| Description=My early startup script | ||
| DefaultDependencies=no | ||
| After=basic.target | ||
| Before=basic.target sysinit.target shutdown.target | ||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| ExecStart=/usr/local/bin/my-early-boot.sh | ||
| RemainAfterExit=yes | ||
|
|
||
| [Install] | ||
| WantedBy=basic.target | ||
| </screen> | ||
| <itemizedlist> | ||
| <listitem><para> <literal>Type=oneshot</literal> is suitable for scripts that run once and then exit.</para></listitem> | ||
| <listitem><para> <literal>DefaultDependencies=no</literal> and <literal> After/Before</literal> ensures it runs at an equivalent time to <literal>boot.local</literal>. | ||
| </para></listitem> | ||
| </itemizedlist> | ||
| </listitem> | ||
| <listitem><para>For <literal>after.local</literal>, this service should run later, typically when the multi-user environment is ready. | ||
| If it depends on the network being up, add <literal>After=network-online.target</literal>. Create <filename>/etc/systemd/system/my-late-boot.service:</filename>:</para> | ||
| <screen>[Unit] | ||
| Description=My late startup script | ||
| # Add After=network-online.target if your script needs network access | ||
| After=multi-user.target | ||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| ExecStart=/usr/local/bin/my-late-boot.sh | ||
| RemainAfterExit=yes | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
| </screen> | ||
| </listitem> | ||
| </itemizedlist> | ||
| </step> | ||
| <step> | ||
| <para><emphasis role="bold">Enable and start the services:</emphasis> After creating the files, reload the &systemd; manager configuration and enable your new services to run at boot: | ||
| </para> | ||
| <screen>&prompt.sudo; systemctl daemon-reload</screen> | ||
| <screen>&prompt.sudo; systemctl enable my-early-boot.service</screen> | ||
| <screen>&prompt.sudo; systemctl enable my-late-boot.service</screen> | ||
| <para>Optionally you can start the services without a reboot.</para> | ||
| <screen>&prompt.sudo; systemctl start my-early-boot.service</screen> | ||
| <screen>&prompt.sudo; sstemctl start my-late-boot.service</screen> | ||
| </step> | ||
| <step> | ||
| <para><emphasis role="bold">Verification:</emphasis> To verify that your new services are running as expected:</para> | ||
| <screen>&prompt.sudo; systemctl status my-early-boot.service</screen> | ||
| <screen>&prompt.sudo; systemctl status my-late-boot.service</screen> | ||
| <para>The expected output is that both should show <literal>Active: inactive (dead)</literal> with a successful exit code, because they are <literal>Type=oneshot</literal> and execute only once. | ||
| </para> | ||
| </step> | ||
| </procedure> | ||
| </example> | ||
| </topic> | ||
Uh oh!
There was an error while loading. Please reload this page.