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

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

    <bug>
          <bug_id>9141</bug_id>
          
          <creation_ts>2006-02-23 15:15:22 +0300</creation_ts>
          <short_desc>не работает reboot и рядом из консоли при работе по ssh</short_desc>
          <delta_ts>2019-07-20 13:18:03 +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>SysVinit-usermode</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="stalker">stalker</reporter>
          <assigned_to name="Nobody&apos;s working on this, feel free to take it">nobody</assigned_to>
          <cc>0oh2wiep</cc>
    
    <cc>inger</cc>
    
    <cc>rider</cc>
    
    <cc>ruslandh</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>36198</commentid>
    <comment_count>0</comment_count>
    <who name="stalker">stalker</who>
    <bug_when>2006-02-23 15:15:22 +0300</bug_when>
    <thetext>При логоне по ssh не получается перезагрузить\выключить машинку от простого
пользователя:
[stalker@vm stalker]$ reboot
consolehelper: Project-Id-Version: PACKAGE VERSION
POT-Creation-Date: 2002-03-18 16:08+0300
PO-Revision-Date: 2002-03-18 16:08+0300
Last-Translator: Dmitry V. Levin &lt;ldv@altlinux.org&gt;
Language-Team: &lt;devel@altlinux.ru&gt;
MIME-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 8bit

consolehelper-0.2.9.1-alt1
Steps to Reproduce:
1. Залогониться по ssh
2. сказать reboot
3. посмотреть на результаты</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36210</commentid>
    <comment_count>1</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2006-02-24 03:13:06 +0300</bug_when>
    <thetext>У меня другой результат получается:

$ reboot       
consolehelper: Аутентификация завершилась неудачно
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36212</commentid>
    <comment_count>2</comment_count>
    <who name="stalker">stalker</who>
    <bug_when>2006-02-24 12:32:24 +0300</bug_when>
    <thetext>(In reply to comment #1)
&gt; У меня другой результат получается:
&gt; 
&gt; $ reboot       
&gt; consolehelper: Аутентификация завершилась неудачно
&gt; 

Может дело вт ом что у меня pam более старый? так как сизиф от 27.11.2005</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150261</commentid>
    <comment_count>3</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 12:34:42 +0300</bug_when>
    <thetext>Нельзя использовать функции из пакета SysVinit-usermode, до тех пор, пока тот-же пользователь не войдёт локально: 

Как-только я локально вошёл тем-же пользователем локально, я смог перезагрузить комп по сети. Вход локально другим пользователем не помогает.

http://forum.altlinux.org/index.php/topic,31564.msg246990.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150262</commentid>
    <comment_count>4</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 12:36:37 +0300</bug_when>
    <thetext>То-же поведение и на дистрибутивах p7.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150264</commentid>
    <comment_count>5</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2015-02-15 13:30:25 +0300</bug_when>
    <thetext>Как воспроизвести ?

У меня всё работает - стоят виртуалки с SysVInit и нормально перезагружаются.
Как вы заходите удалённо на пользователя и рута ?

#rpm -q consolehelper 
consolehelper-0.3.1-alt1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150266</commentid>
    <comment_count>6</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 13:32:39 +0300</bug_when>
    <thetext>По ssh захожу. От пользователя.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150267</commentid>
    <comment_count>7</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2015-02-15 13:33:27 +0300</bug_when>
    <thetext>команда reboot даётся от пользователя или от рута?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150268</commentid>
    <comment_count>8</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 13:35:08 +0300</bug_when>
    <thetext>По ssh захожу. От пользователя.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150269</commentid>
    <comment_count>9</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 13:35:33 +0300</bug_when>
    <thetext>команда reboot даётся от пользователя</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150270</commentid>
    <comment_count>10</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 13:35:53 +0300</bug_when>
    <thetext>команда reboot даётся от пользователя</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150271</commentid>
    <comment_count>11</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 13:36:44 +0300</bug_when>
    <thetext>Антон, я там на форуме всё подробно описал.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150272</commentid>
    <comment_count>12</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2015-02-15 13:45:58 +0300</bug_when>
    <thetext>после установки SysVinit-usermode-1.5-alt2 проблема воспроизводится на текущем Sisyphus. Всё как описано - если зайти по ssh, то ошибка:

$ reboot 
consolehelper: Неизвестная ошибка.

# control consolehelper
public

Если при этом ещё зайти и локально - то reboot проходит без проблем.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150273</commentid>
    <comment_count>13</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 13:52:15 +0300</bug_when>
    <thetext>Да, если локально войти, то проблем нет.
А вот если локально пользователь не вошёл, то перезагрузка не работает.
Я сейчас проверил на нескольких дистрибутивах. Закрываешь все &quot;сеансы&quot; работы локально, а потом входишь на такой комп по ssh - при команде reboot, poweroff и т.п. выскакивает сообщение 
&quot;consolelper неизвестная ошибка&quot;
или, как вариант:
consolehelper: Аутентификация завершилась неудачно</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150274</commentid>
    <comment_count>14</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 13:54:58 +0300</bug_when>
    <thetext>Потом входишь на такой комп по ssh - от обычного пользователя.
Помогает даже такой костыль:

Цитата с форума:

&quot;для временного решения проблемы.
1. Установите пакет agetty.
2. Пропишите в /etc/inittab такую, например, строчку:
Код: [Выделить]
user:2345:respawn:/sbin/agetty -a user tty11&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150276</commentid>
    <comment_count>15</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2015-02-15 14:30:51 +0300</bug_when>
    <thetext>(In reply to comment #12)
&gt; после установки SysVinit-usermode-1.5-alt2 проблема воспроизводится на текущем
&gt; Sisyphus. Всё как описано - если зайти по ssh, то ошибка:
&gt; 
&gt; $ reboot 
&gt; consolehelper: Неизвестная ошибка.
&gt; 
&gt; # control consolehelper
&gt; public
&gt; 
&gt; Если при этом ещё зайти и локально - то reboot проходит без проблем.

Так было всегда (только код ошибки был другим) - это же главная фича пакета, чтобы reboot от пользователя только с консоли работал.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150277</commentid>
    <comment_count>16</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 14:38:24 +0300</bug_when>
    <thetext>Понятно, и никакой возможности отключить эту фичу нет?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150278</commentid>
    <comment_count>17</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 14:45:38 +0300</bug_when>
    <thetext>Или сделать, как в systemctl reboot - запрос пароля пользователя при выполнения этой команды?

PS Скорее более важно, что-бы другому пользователю, работающему на этой машине не помешать, а если он один, то зачем ему запрещать выключение/перезагрузку?
Тем более, что установлен пакет SysVinit-usermode</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150279</commentid>
    <comment_count>18</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2015-02-15 14:55:42 +0300</bug_when>
    <thetext>(In reply to comment #16)
&gt; Понятно, и никакой возможности отключить эту фичу нет?

Есть, конечно, почему нет?

Если заменить в /etc/pam.d/reboot
auth     required       pam_deny.so
на
auth     required       pam_permit.so
то reboot будут давать всем подряд.

(In reply to comment #17)
&gt; Или сделать, как в systemctl reboot - запрос пароля пользователя при 
&gt; выполнения этой команды?

Попробуйте заменить в /etc/pam.d/reboot
auth     required       pam_deny.so
на
auth     include        system-auth</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150280</commentid>
    <comment_count>19</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 15:18:12 +0300</bug_when>
    <thetext>Первый вариант работает, а второй требует пароль root:
$ reboot
Чтобы выполнить &quot;reboot&quot;,
необходима дополнительная информация.
Введите пароль системного администратора root:  

А пароль нельзя, что-бы пароль пользователя требовал?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150281</commentid>
    <comment_count>20</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 15:37:12 +0300</bug_when>
    <thetext>По такому случаю, я ставлю баге enhancement, т-к хотелось-бы видеть вариант, когда для перезагрузки требовался-бы пароль пользовател, ну и какой-нибудь control не помешал-бы для выбора поведения reboot/poweroff по-сети</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150283</commentid>
    <comment_count>21</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2015-02-15 15:54:23 +0300</bug_when>
    <thetext>(In reply to comment #19)
&gt; Первый вариант работает, а второй требует пароль root:
&gt; $ reboot
&gt; Чтобы выполнить &quot;reboot&quot;,
&gt; необходима дополнительная информация.
&gt; Введите пароль системного администратора root:  
&gt; 
&gt; А пароль нельзя, что-бы пароль пользователя требовал?

Можно. Насколько я помню, для этого достаточно убрать или закомментировать строчку USER=root в файле /etc/security/console.apps/reboot.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150284</commentid>
    <comment_count>22</comment_count>
    <who name="ruslandh">ruslandh</who>
    <bug_when>2015-02-15 16:14:50 +0300</bug_when>
    <thetext>Спасибо, всё правильно помните, всё так и есть.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>