Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: apcupsd and systemd - killpower issues

  1. #11
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: apcupsd and systemd - killpower issues

    Quote Originally Posted by arvidjaar View Post
    Well ... I agree that HALT_POWERDOWN_INSERT was somehow forgotten when transitioning from /etc/init.d/halt to native systemd shutdown. Care to open bug report?

    But to be honest ... this is almost the only case I can remember. I do not know how dkms was integrated in openSUSE before, but I had no problems with it in Mandriva back in the past during systemd transition. And "each and every" looks like a bit of generalizing when you speak about two packages so far

    Notice that both are rather unusual. They integrate deep into startup/shutdown sequence and need to be executed at the very precise moments. That makes them special. "Normal" services usually continue to work. Can you give example of standard scripts that break?
    So consider I am no systemd expert but, the after.local script no longer works though I serve up a kluge that kind of works. We can see that halt does not work and apcupsd is a very common application that uses it. And, I had to come up with a fix under openSUSE 12.1 to get dkms to work properly as it simple did not work. I continue to use my same fix under 12.2, but I guess I did not try using dkms without the fix under openSUSE 12.2. All of these examples are important applications and I can't say for sure what else does not work. I know that we could not get xen to work under 12.1 if systemd was being used though I guess I also hear it only works with 64 bit these days. And really, its not some sort of rejection to systemd per say, but what systemd is doing and how it replaces what we used to use is just not that simple to understand. Just reading your short introduction is enough to cause many followers to fall of the tracks. One thing is for sure, I do not wish to discourage your attempt to help others. Anyone with a good understanding of just how systemd works is VERY WELCOME here. Trust me on that one, we want your input and we want your help and thank you for providing it.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  2. #12
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: apcupsd and systemd - killpower issues

    I started a bug report here: https://bugzilla.novell.com/show_bug.cgi?id=785156

    I encourage anyone with input on the subject to please add your comments there.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  3. #13
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: apcupsd and systemd - killpower issues

    On 2012-10-15 19:36, jdmcdaniel3 wrote:

    > It is true that standard items included with a normal openSUSE
    > releases seem to be tested properly to work with systemd, but that is
    > about the extent of it. Must we dig up each every maintainer of an
    > application is our repositories and ask if they have tested their
    > program with systemd in mind? While I am not sure of an answer to such a
    > question, time and time again, the use of systemd breaks well worn
    > programs we have come to use over the years.


    If I interpreted correctly what I read, some said that they would not
    adapt to systemd, they would not invest time on it.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  4. #14
    Join Date
    Sep 2012
    Posts
    5,235

    Default Re: apcupsd and systemd - killpower issues

    Quote Originally Posted by jdmcdaniel3 View Post
    I had to come up with a fix under openSUSE 12.1 to get dkms to work properly as it simple did not work
    I do not see dkms package in openSUSE repository so it is hard to comment. Is there any standard package for openSUSE? Or documentation "DKMS on openSUSE"? In the former case it is straightforward to add systemd unit to it; in the latter description simply has to be extended for 12.2 case.

  5. #15
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: apcupsd and systemd - killpower issues

    Quote Originally Posted by arvidjaar View Post
    I do not see dkms package in openSUSE repository so it is hard to comment. Is there any standard package for openSUSE? Or documentation "DKMS on openSUSE"? In the former case it is straightforward to add systemd unit to it; in the latter description simply has to be extended for 12.2 case.
    dkms comes from the Packman repository. It is primarily used for the recompile of the VirtualBox binary driver after a kernel version change but I also can use for the nVIDIA driver. Here are a couple of blogs I have on using dkms.

    DKMS, systemd & Virtual Box - How to get Dynamic Kernel Module Support to work in openSUSE 12.1/12.2 - Blogs - openSUSE Forums

    AND

    S.A.N.D.I. - SuSE Automated NVIDIA Driver Installer - Version 1.47 - Blogs - openSUSE Forums

    And I did get it to work after some research, not sure I would call it easy, at least easy at the time. I also have a blog on getting the after.local file to work:

    systemd and using the after.local script in openSUSE 12.1/12.2 - Blogs - openSUSE Forums

    And its really during local I guess, but I was unable to come up with a real after local operation under systemd. I understand that a change may exist in the future with systemd that might allow that to happen.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  6. #16
    Join Date
    Sep 2012
    Posts
    5,235

    Default Re: apcupsd and systemd - killpower issues

    Quote Originally Posted by jdmcdaniel3 View Post
    dkms comes from the Packman repository.
    OK, so we have package for 12.2 that does not work under 12.2. Then this package has to be fixed, right? I do not know what is the support model for packman. Do they have some mailing list or ticketing system?

  7. #17
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Default Re: apcupsd and systemd - killpower issues

    Quote Originally Posted by arvidjaar View Post
    OK, so we have package for 12.2 that does not work under 12.2. Then this package has to be fixed, right? I do not know what is the support model for packman. Do they have some mailing list or ticketing system?
    I don't know the answer to that question, but I will try to find out tonight. Here is their Web Site: PackMan :: home

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  8. #18

    Thumbs up Re: apcupsd and systemd - killpower issues

    Sorry for the delay in response.
    First, many thanks to arvidjaar for his kind and exhaustive reply. I was intimidated by the information on systemd website, but things are easier than expected.
    Here is my code, that worked simply as needed.

    Some notes:
    1. The powerdown file is created and removed by apcupsd (or by my application).
    2. Apcupsd with killpower option refuses to issue the command if such file is not available. The condition added here could be useful to suppress some warnings.
    3. Still, $HALT_POWERDOWN_INSERT is not executed. It is not needed now, but I don't know if systemd can accept system configured variables as commands. It seems it cannot, since I tried without result. If so, this configuration should be removed from Suse and a similar file should be added in apcupsd package (or in an additional package for system shutdown).

    in /etc/systemd/system/killpower.service


    Code:
    [Unit] 
    Description=APC UPS killpower 
    ConditionPathExists=/etc/apcupsd/powerfail 
    DefaultDependencies=no 
    After=shutdown.target 
    Before=final.target  
    
    [Service] 
    Type=oneshot 
    ExecStart=/sbin/apcupsd-lite --killpower 
    TimeoutSec=0 
    StandardOutput=tty 
    RemainAfterExit=yes  
    
    [Install] 
    WantedBy=shutdown.target
    Thus, after executing both commands:
    Code:
    systemctl enable killpower.service 
    systemctl daemon-reload
    On power out apcupsd turn off UPS correctly. This job is done here even better than under SysV.

    Another small clarification:
    Bug report posted by jdmcdaniel3 (https://bugzilla.novell.com/show_bug.cgi?id=785156) says that system is not shut down by apcupsd and that the expected result is that PC is shut down by apcupsd before battery runs out.
    This is not exactly true.
    The user can select the point where system is shut down, either on power fail, battery low or other triggers from apcupsd. Perhaps there could be some settings in power management, but it's easy to call commands into apcupsd scripts.
    The issue is that, on the shutdown process, an attempt to kill UPS power is to be done, otherwise UPS will keep beeping until it gets discharged (or until user intervention).

    I think this issue can be considered solved, unless you are keeping discussion on other packages that gets broken on change to systemd.

    Again, many thanks for your support and your prompt replies.

  9. #19
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: apcupsd and systemd - killpower issues

    On 2012-10-18 16:26, gnarlo wrote:
    > I
    > was intimidated by the information on systemd website,


    There is a chapter here on systemd:

    openSUSE Reference


    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  10. #20
    Join Date
    Sep 2012
    Posts
    5,235

    Default Re: apcupsd and systemd - killpower issues

    Quote Originally Posted by gnarlo View Post
    3. Still, $HALT_POWERDOWN_INSERT is not executed. It is not needed now, but I don't know if systemd can accept system configured variables as commands. It seems it cannot, since I tried without result. If so, this configuration should be removed from Suse and a similar file should be added in apcupsd package (or in an additional package for system shutdown).
    Now that's constructive attitude

    https://bugzilla.novell.com/show_bug.cgi?id=785701

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •