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

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

    <bug>
          <bug_id>27390</bug_id>
          
          <creation_ts>2012-05-31 23:57:40 +0400</creation_ts>
          <short_desc>[PATCH] lone systemd service support</short_desc>
          <delta_ts>2013-03-18 15:10:51 +0400</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>service</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>http://git.altlinux.org/people/viy/packages/?p=service.git;a=commit;h=a4217a0e9b96b5ba35590b913a60e5d27c8ade52</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>27685</blocked>
    
    <blocked>28704</blocked>
    
    <blocked>28705</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="viy">viy</reporter>
          <assigned_to name="placeholder@altlinux.org">placeholder</assigned_to>
          <cc>aen</cc>
    
    <cc>glebfm</cc>
    
    <cc>ldv</cc>
    
    <cc>legion</cc>
    
    <cc>piastryyy</cc>
    
    <cc>placeholder</cc>
    
    <cc>vt</cc>
    
    <cc>zerg</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>131577</commentid>
    <comment_count>0</comment_count>
    <who name="viy">viy</who>
    <bug_when>2012-05-31 23:57:40 +0400</bug_when>
    <thetext>Support for packages that have no sysVinit script but a systemd service.

http://git.altlinux.org/people/viy/packages/?p=service.git;a=commit;h=a4217a0e9b96b5ba35590b913a60e5d27c8ade52</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>132041</commentid>
    <comment_count>1</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2012-06-24 03:06:53 +0400</bug_when>
    <thetext>Proper support of a systemd-only service means that certain chkconfig calls are replaced by corresponding systemctl cals; just omitting chkconfig calls wouldn&apos;t qualify to be called &quot;a support&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>132070</commentid>
    <comment_count>2</comment_count>
    <who name="viy">viy</who>
    <bug_when>2012-06-26 17:00:16 +0400</bug_when>
    <thetext>(В ответ на комментарий №1)
&gt; Proper support of a systemd-only service means that certain chkconfig calls are replaced by corresponding systemctl cals; just omitting chkconfig calls
&gt; wouldn&apos;t qualify to be called &quot;a support&quot;.

Let me recall that the corresponding systemctl calls are performed during the service(8) call (namely, /sbin/service &quot;$1&quot; condrestart), which is _NOT_ omitted in the proposed patch.
I recall, systemd services can be in enabled or disabled state, but system V scripts also have &quot;not installed/uninstalled&quot; state (when a system V script exists, but there are no symlinks in /etc/rc.d) so they need an additional chkconfig call.
systemd scripts does not have this state and just don&apos;t need an additional chkconfig call, so we are right to just skip it.
&quot;у нас все точно&quot; (С).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>132072</commentid>
    <comment_count>3</comment_count>
    <who name="viy">viy</who>
    <bug_when>2012-06-26 17:06:02 +0400</bug_when>
    <thetext>the whole idea about the service(8) command is that this command is a portable wrapper that hides the actual implementation (sysV, systemd, upstart,...) is used.
So anayway using the actual systemd calls instead of service would be a bad style.
For example, if user did use sysV init, nothing good happen if we call systemctl.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>132073</commentid>
    <comment_count>4</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2012-06-26 17:14:36 +0400</bug_when>
    <thetext>How do you propose to implement &quot;systemctl daemon-reload&quot; and &quot;systemctl disable specified.service&quot; commands with &quot;service&quot;?  Up to now this is implemented in chkconfig.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>132076</commentid>
    <comment_count>5</comment_count>
    <who name="viy">viy</who>
    <bug_when>2012-06-26 17:57:36 +0400</bug_when>
    <thetext>(В ответ на комментарий №4)
&gt; How do you propose to implement &quot;systemctl daemon-reload&quot; and &quot;systemctl
&gt; disable specified.service&quot; commands with &quot;service&quot;?  Up to now this is
&gt; implemented in chkconfig.

Indeed. And I was even patching that code...
I am deeply sorry.
Proposed patch is invalid, chkconfig should be tuned instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138277</commentid>
    <comment_count>6</comment_count>
    <who name="Pavel Shilovsky">piastryyy</who>
    <bug_when>2013-03-01 14:32:58 +0400</bug_when>
    <thetext>I created a patch that seems to fix the problem for me:
http://git.altlinux.org/people/piastry/packages/?p=service.git;a=commitdiff;h=950540de8cf8e5987c5694a529efded393ed8bfa

Thoughts?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138306</commentid>
    <comment_count>7</comment_count>
    <who name="viy">viy</who>
    <bug_when>2013-03-01 23:08:53 +0400</bug_when>
    <thetext>(В ответ на комментарий №6)
&gt; I created a patch that seems to fix the problem for me:
&gt; http://git.altlinux.org/people/piastry/packages/?p=service.git;a=commitdiff;h=950540de8cf8e5987c5694a529efded393ed8bfa

Thanks! This is an important fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138430</commentid>
    <comment_count>8</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2013-03-05 20:41:44 +0400</bug_when>
    <thetext>service-0.5.24-alt1 -&gt; sisyphus:

* Thu Feb 28 2013 Dmitry V. Levin &lt;ldv@altlinux&gt; 0.5.24-alt1
- Implemented systemd-only service support in {post,preun}_service
  (closes: #27390) and native support of systemd services.
  Due to systemctl limitations, when systemd is active,
  post_service will no longer be able to enable sysv-only services.
- Added /sbin/sd_booted utility.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138599</commentid>
    <comment_count>9</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2013-03-12 18:13:01 +0400</bug_when>
    <thetext>chkconfig --add some.service
не работает. При этом
systemctl enable some.service
отрабатывает нормально

Т.е. %post_service не работает.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138604</commentid>
    <comment_count>10</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2013-03-12 18:34:19 +0400</bug_when>
    <thetext>(In reply to comment #9)
&gt; chkconfig --add some.service
&gt; не работает. При этом
&gt; systemctl enable some.service
&gt; отрабатывает нормально
&gt; 
&gt; Т.е. %post_service не работает.

Если systemd активен, то %post_service использует systemctl вместо chkconfig,
и если при этом сервис sysvinit-only, то он не будет включен.  Об этом написано в %changelog&apos;е пакета.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138605</commentid>
    <comment_count>11</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2013-03-12 18:37:03 +0400</bug_when>
    <thetext>См. тж. systemd.preset(5) и /lib/systemd/system-preset/99-default.preset</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138606</commentid>
    <comment_count>12</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2013-03-12 18:52:20 +0400</bug_when>
    <thetext>Тогда вручную должно работать, как
systemctl enable тотжесамый.service</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138607</commentid>
    <comment_count>13</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2013-03-12 18:54:07 +0400</bug_when>
    <thetext>(В ответ на комментарий №11)
&gt; См. тж. systemd.preset(5) и /lib/systemd/system-preset/99-default.preset
Т.е. вне зависимости от наличия %post_service в пакете, сервисы, указанные в preset-е включаются специальными триггерами?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138609</commentid>
    <comment_count>14</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2013-03-12 18:55:07 +0400</bug_when>
    <thetext>(In reply to comment #12)
&gt; Тогда вручную должно работать, как
&gt; systemctl enable тотжесамый.service

systemctl enable тотжесамый.service работает.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138610</commentid>
    <comment_count>15</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2013-03-12 18:57:40 +0400</bug_when>
    <thetext>(In reply to comment #13)
&gt; (В ответ на комментарий №11)
&gt; &gt; См. тж. systemd.preset(5) и /lib/systemd/system-preset/99-default.preset
&gt; Т.е. вне зависимости от наличия %post_service в пакете, сервисы, указанные в
&gt; preset-е включаются специальными триггерами?

Нет, автоматически preset-ы сейсас никто не включает, их включает %post_service
при первой установке пакета.  Хотя это действительно можно было бы реализовать файлтриггерами, %post_service все равно нужен, так что зачем?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138612</commentid>
    <comment_count>16</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2013-03-12 19:17:36 +0400</bug_when>
    <thetext>Зачем пытаться кое-что кое-где возможно если повезет включить, когда надо *включить* ?

Или firetrigger нужно сделать и игнорировать chkconfig в %post_service или chkconfig должен включать вне зависимости от preset-ов.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138613</commentid>
    <comment_count>17</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2013-03-12 19:30:13 +0400</bug_when>
    <thetext>Оказывается, механизм, аналогичый system-preset присутствует в init-файлах, но в каждом индивидуально. В поле &quot;chkconfig:&quot; первым параметром написано, запускать ли его не каких-то runlevel-ах по умолчанию.

Аналог этой информации для systemd у нас на данный момент отсутствует.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138701</commentid>
    <comment_count>18</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2013-03-15 15:07:51 +0400</bug_when>
    <thetext>Может, убрать из %post_service поддержку systemd и сделать firetrigger для включения systemd-шных сервисов? А то как-то странновато в результате получается в случае с systemd.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>138702</commentid>
    <comment_count>19</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2013-03-15 15:10:24 +0400</bug_when>
    <thetext>И удобно будет: положил preset и не паришься больше ни о чем.
Иначе приходится городить костыли. У меня, например, installer-feature-kdesktop-services, а у других свои.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>