<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>32577</bug_id>
          
          <creation_ts>2016-10-05 19:31:44 +0300</creation_ts>
          <short_desc>condrestart is missing in init-script</short_desc>
          <delta_ts>2016-10-06 13:17:54 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>laptop-mode-tools</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>32578</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan Zakharyaschev">imz</reporter>
          <assigned_to name="Andrey Cherepanov">cas</assigned_to>
          <cc>cas</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>159042</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2016-10-05 19:31:44 +0300</bug_when>
    <thetext>laptop-mode-tools-1.70-alt1

ALT&apos;s /usr/sbin/post_service invokes the init-script&apos;s condrestart command:

                service &quot;$1&quot; condrestart

but the Debian-style /etc/init.d/laptop-mode doesn&apos;t have it (similarly to all other Debian-style init-scripts).

I&apos;ve patched some other Debian-style init-scripts for this (&quot;condrestart&quot;) in a simple way:

http://git.altlinux.org/gears/o/owamp.git?p=owamp.git;a=commitdiff;h=ae7ac80b0eb4dd255d8918791a5b06099d69305e

diff --git a/debian/owamp-server.init b/debian/owamp-server.init
index 1a7998b..24951c3 100755
--- a/debian/owamp-server.init
+++ b/debian/owamp-server.init
@@ -122,8 +122,18 @@ case &quot;$1&quot; in
 		;;
 	esac
 	;;
+  condrestart|condreload)
+        if &quot;$0&quot; status &gt;/dev/null; then
+            exec &quot;$0&quot; restart
+        fi
+        ;;
+  condstop)
+        if &quot;$0&quot; status &gt;/dev/null; then
+            exec &quot;$0&quot; stop
+        fi
+        ;;
   *)
-	echo &quot;Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}&quot; &gt;&amp;2
+	echo &quot;Usage: $SCRIPTNAME {start|stop|status|restart|force-reload|condrestart|condreload|condstop}&quot; &gt;&amp;2
 	exit 3
 	;;
 esac

A very similar patch:

http://git.altlinux.org/gears/t/thermald.git?p=thermald.git;a=commitdiff;h=5e6857d421e2bd21323bb831ec500308cb049130

Perhaps, this trick can be moved into package service (instead of patching each individual package). (I&apos;m going to submit such a FR.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>159060</commentid>
    <comment_count>1</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2016-10-06 13:17:54 +0300</bug_when>
    <thetext>laptop-mode-tools-1.70-alt2 -&gt; sisyphus:

* Thu Oct 06 2016 Andrey Cherepanov &lt;cas@altlinux&gt; 1.70-alt2
- Fix project homepage (ALT #32576)
- Support condrestart and condstop in initscript (ALT #32577)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>