Author: dj
Date: Sun Oct 22 13:57:13 2017
New Revision: 19359

Log:
Use timers in systemd where appropriate, not crontab.

Modified:
   trunk/BOOK/general/sysutils/pciutils.xml
   trunk/BOOK/general/sysutils/usbutils.xml

Modified: trunk/BOOK/general/sysutils/pciutils.xml
==============================================================================
--- trunk/BOOK/general/sysutils/pciutils.xml    Sun Oct 22 13:14:49 2017        
(r19358)
+++ trunk/BOOK/general/sysutils/pciutils.xml    Sun Oct 22 13:57:13 2017        
(r19359)
@@ -134,7 +134,7 @@
       <filename class="directory">/usr/share/hwdata</filename>.
     </para>
 
-    <para>
+    <para revision="sysv">
       You may wish to add an entry to
       <systemitem class="username">root</systemitem>'s (or any other user who 
has
       write privilege to <filename 
class="directory">/usr/share/hwdata</filename>)
@@ -142,6 +142,40 @@
       periodically.
     </para>
 
+    <para revision="systemd">
+      You should update the <filename>/usr/share/hwdata/pci.ids</filename> file
+      periodically. Execute the following commands, as the
+      <systemitem class="username">root</systemitem> user, to create a systemd
+      timer to update it weekly on Sundays at 3:00 A.M. (local time):
+    </para>
+
+<screen role="root" revision="systemd"><userinput>cat &gt; 
/lib/systemd/system/update-pciids.service &lt;&lt; "EOF" &amp;&amp;
+<literal>[Unit]
+Description=Update pci.ids file
+Documentation=man:update-pciids(8)
+DefaultDependencies=no
+After=local-fs.target
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/sbin/update-pciids</literal>
+EOF
+cat &gt; /lib/systemd/system/update-pciids.timer &lt;&lt; "EOF" &amp;&amp;
+<literal>[Unit]
+Description=Update pci.ids file weekly
+
+[Timer]
+OnCalendar=Sun 02:30:00
+Persistent=true
+
+[Install]
+WantedBy=timers.target</literal>
+EOF
+systemctl enable update-usbids.timer</userinput></screen>
+
+
   </sect2>
 
   <sect2 role="content">

Modified: trunk/BOOK/general/sysutils/usbutils.xml
==============================================================================
--- trunk/BOOK/general/sysutils/usbutils.xml    Sun Oct 22 13:14:49 2017        
(r19358)
+++ trunk/BOOK/general/sysutils/usbutils.xml    Sun Oct 22 13:57:13 2017        
(r19359)
@@ -142,16 +142,16 @@
   <sect2 role="configuration">
     <title>Configuring USB Utils</title>
 
-    <para>
+    <para revision="sysv">
       The <filename>usb.ids</filename> data file is constantly being updated.
       To get a current version of this file, using <xref linkend="wget"/>,
       periodically run again, as the
       <systemitem class="username">root</systemitem> user:
     </para>
 
-<screen role="root"><userinput>wget http://www.linux-usb.org/usb.ids -O 
/usr/share/hwdata/usb.ids</userinput></screen>
+<screen role="root" revision="sysv"><userinput>wget 
http://www.linux-usb.org/usb.ids -O 
/usr/share/hwdata/usb.ids</userinput></screen>
 
-    <para>
+    <para revision="sysv">
       You may wish to add an entry to
       <systemitem class="username">root</systemitem>'s (or any other user who 
has
       write privilege to <filename 
class="directory">/usr/share/hwdata</filename>)
@@ -159,6 +159,39 @@
       periodically.
     </para>
 
+    <para revision="systemd">
+      You should update the <filename>/usr/share/hwdata/usb.ids</filename> file
+      periodically. Execute the following commands, as the
+      <systemitem class="username">root</systemitem> user, to create a systemd
+      timer to update it weekly on Sundays at 3:00 A.M. (local time):
+    </para>
+
+<screen role="root" revision="systemd"><userinput>cat &gt; 
/lib/systemd/system/update-usbids.service &lt;&lt; "EOF" &amp;&amp;
+<literal>[Unit]
+Description=Update usb.ids file
+Documentation=man:lusub(8)
+DefaultDependencies=no
+After=local-fs.target
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/wget http://www.linux-usb.org/usb.ids -O 
/usr/share/hwdata/usb.ids</literal>
+EOF
+cat &gt; /lib/systemd/system/update-usbids.timer &lt;&lt; "EOF" &amp;&amp;
+<literal>[Unit]
+Description=Update usb.ids file weekly
+
+[Timer]
+OnCalendar=Sun 03:00:00
+Persistent=true
+
+[Install]
+WantedBy=timers.target</literal>
+EOF
+systemctl enable update-usbids.timer</userinput></screen>
+
   </sect2>
 
   <sect2 role="content">
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to