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

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

    <bug>
          <bug_id>60496</bug_id>
          
          <creation_ts>2026-09-11 12:05:41 +0300</creation_ts>
          <short_desc>Не запускается командой service с ошибкой Failed to start apcupsd.service: Unit apcupsd.service not found.</short_desc>
          <delta_ts>2026-09-11 17:28:51 +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>apcupsd</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Vyacheslav Dikonov">slava</reporter>
          <assigned_to name="Sergey Y. Afonin">asy</assigned_to>
          <cc>asy</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>298022</commentid>
    <comment_count>0</comment_count>
    <who name="Vyacheslav Dikonov">slava</who>
    <bug_when>2026-09-11 12:05:41 +0300</bug_when>
    <thetext>В пакете apcupsd нет unit-файла для systemd. В результате попытка запустить его вручную выдает ошибку Failed to start apcupsd.service: Unit apcupsd.service not found.

Это можно исправить добавлением файла /lib/systemd/system/apcupsd.service следующего содержания:

---

[Unit]
Description=APC UPS Power Control Daemon for Linux
After=network.target

[Service]
Type=forking
PIDFile=/run/apcupsd.pid
ExecStartPre=-/bin/rm -f /etc/apcupsd/powerfail
ExecStart=/sbin/apcupsd -f /etc/apcupsd/apcupsd.conf
ExecStop=/sbin/apcupsd --stop
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

---</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>298024</commentid>
    <comment_count>1</comment_count>
    <who name="Vyacheslav Dikonov">slava</who>
    <bug_when>2026-09-11 12:08:45 +0300</bug_when>
    <thetext>Под запуском вручную я имел в виду команду # service apcupsd start.
Unit файл - плод сумрачного ИИ. Он работает, но лучше бы подтвердить его корректность тому, кто разбирается в systemd.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>298206</commentid>
    <comment_count>2</comment_count>
    <who name="Sergey Y. Afonin">asy</who>
    <bug_when>2026-09-11 17:28:18 +0300</bug_when>
    <thetext>Про то, что из systemd собираются убрать, но вроде не должны пока ещё?

Был установлен стартер alt-p11-kde-20260612-x86_64.iso

[root@asy asy]# apt-get install apcupsd
...
[root@asy apcupsd]# service apcupsd start 
[root@asy apcupsd]#

В общем-то пыталось запуститься:

2026-09-11 18:25:30 +0400  apcupsd 3.14.14 (31 May 2016) altlinux startup succeeded
2026-09-11 18:25:41 +0400  apcupsd FATAL ERROR in smartsetup.c at line 152
PANIC! Cannot communicate with UPS via serial port.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>298207</commentid>
    <comment_count>3</comment_count>
    <who name="Sergey Y. Afonin">asy</who>
    <bug_when>2026-09-11 17:28:51 +0300</bug_when>
    <thetext>(In reply to Sergey Y. Afonin from comment #2)

&gt; Про то, что из systemd собираются убрать, но вроде не должны пока ещё?

В смысле убрать поддержку init-скриптов.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>