Announcement

Collapse
No announcement yet.

Service disappears or dies after x hours

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Service disappears or dies after x hours

    Hi,
    First, I was pleasantly surprised to see that on 20.04, the availability of hd-idle comes in default repositories, when I used 18.04 I had to install it manually.
    I set it up and enable it, by default hd-idle works fine except when you resume your computer from sleep or resume it from hibernation.
    I am one of those who never turn off, always sleep the computer.
    To solve that case, there is a patch that I mentioned in this thread/post.

    I have installed hd-idle in 20.04 through muon, and the indicated patch works fine but ... after x hours (I still don't know how many, but I think it is after many hours the sleeping computer, for example, one night integer) when I resume from sleeping the computer, the hd-idle service is gone or dead.
    Occasionally I check, in KSysGuard, that the hd-idle service is running, and indeed it is, but as I said, after x hours of sleeping the computer, I observe that hd-idle not work and I check in KSysGuard and the hd-idle service is no longer running and disappear.
    I try to re-start the service with different commands, but it does not run, the only solution is to restart the computer.
    The hd-idle service is running again, I can sleep, resume PC ... and it still works, but as I say, after x hours (I think, for example, one night) the hd-idle service disappears / dies and already it is not running.

    In 18.04, this problem did not have it, although I must mention that in 18.04 I used the hd-idle version 1.04 (which is not the last one), but I think is not for the version the cause (is my think ), because it's the service that dies / disappears .

    I've been trying to find out the cause, but can't figure it out.

    I hope you are all doing your best.

    #2
    Sorry, I didn't see this thread earlier (KFN seemed to mark all posts read for me), and replied to the other, older thread.

    Did you check out /etc/default/hd-idle and /var/log/hd-idle?

    Installed from muon, it's a standard service, and sudo service hd-idle restart should restart it, and the systemd log system should show what's happening. You might try installing KSystemlog, it makes checking the logs very easy.
    Regards, John Little

    Comment


      #3
      There's a recent(ish) bug report on the Sourceforge project page.
      Regards, John Little

      Comment


        #4
        Thinking a bit more about your problems, there may be more than one.

        I presume that by "sleeping" you mean what KDE calls "suspending". I suspend my desktop normally, usually when I get up out of the chair at my desk. A reboot only occurs typically if I'm booting into another version of Kubuntu or another distro. hd-idle works by looking at /proc/diskstats to see activity on the devices. On my Kubuntu resuming from suspension spins up the hard discs but this is not reflected in /proc/diskstats, so hd-idle does not notice they've spun up. So, I created the file /lib/systemd/system-sleep/spindown :
        Code:
        #!/bin/bash
        
        # john spin down my backup and archive drives, they drone and vibrate
        # oppressively
        
        case $1 in
        post)
        # output goes to the journal...
        echo spinning down stuff
        /sbin/hdparm -y /dev/disk/by-label/stuff
        echo spinning down the old drive with pictures
        /sbin/hdparm -y /dev/disk/by-label/pics
        ;;
        esac
        and made it executable. If you were to use this you'd need to change the drive specifiers. I used to have /dev/sda and /dev/sdb, but one day I was checking cables (to troubleshoot a motherboard problem) and reconnected them differently, and sda swapped with sdc. So now I use partition labels because I know what they are, because they're short and memorable; however, they're subject to change if I move things around; I've done that. I suggest having a look in /dev/disk to see which identifiers you like.

        I think your other problem is hd-idle failing. I can't understand that because it's such a simple, short programme. Maybe you might find something in the system logs. systemd can be told to restart a service if it stops, but I don't know how to do that.
        Regards, John Little

        Comment


          #5
          Originally posted by jlittle View Post
          Sorry, I didn't see this thread earlier (KFN seemed to mark all posts read for me), and replied to the other, older thread.

          Did you check out /etc/default/hd-idle and /var/log/hd-idle?

          Installed from muon, it's a standard service, and sudo service hd-idle restart should restart it, and the systemd log system should show what's happening. You might try installing KSystemlog, it makes checking the logs very easy.
          I check my /etc/default/hd-idle because is the file/service that I need edit for indicate my hard drivers, but any file in /var/log/hd-idle (any file or folder, any)...
          Yes, I installed with muon, it's a standard service, and yes, after this night (I and also, my computer sleed about 9 or 10 hours...xD) the service again disappear, and yes, with sudo service ht-idle restart, again, return and work and appears in services.
          But in 18.04, this problem, not exist, in 18.04 (and hd-idle version 1.04) I can work with my computer for 1 week or 10 days without restart or power off, only sleep (and sleed in some times 10-12 hours) and when resume computer from sleep, the hd-idle service continue working.
          I review now the KSystemlog...and..surprise for me! Hd-idle appears fine, like work fine... ¿?

          Originally posted by jlittle View Post
          There's a recent(ish) bug report on the Sourceforge project page.
          Yes, but this is other but that we can solved with this.
          In the final part ot this post (post 15) indicate how solved this bug, isn't the same that I have now.
          Because, now, I can sleep computer 30 minutes, 1, 2 or 3 hours (for example) and when resume computer, hd-idle service continue work.
          Its when sleep computer more hours (I think about 8 hours or more) the hd-idle service disappear from services and not work, not spin down the hard drives...

          Originally posted by jlittle View Post
          Thinking a bit more about your problems, there may be more than one.

          I presume that by "sleeping" you mean what KDE calls "suspending". I suspend my desktop normally, usually when I get up out of the chair at my desk. A reboot only occurs typically if I'm booting into another version of Kubuntu or another distro. hd-idle works by looking at /proc/diskstats to see activity on the devices. On my Kubuntu resuming from suspension spins up the hard discs but this is not reflected in /proc/diskstats, so hd-idle does not notice they've spun up. So, I created the file /lib/systemd/system-sleep/spindown :
          Code:
          #!/bin/bash
          
          # john spin down my backup and archive drives, they drone and vibrate
          # oppressively
          
          case $1 in
          post)
          # output goes to the journal...
          echo spinning down stuff
          /sbin/hdparm -y /dev/disk/by-label/stuff
          echo spinning down the old drive with pictures
          /sbin/hdparm -y /dev/disk/by-label/pics
          ;;
          esac
          and made it executable. If you were to use this you'd need to change the drive specifiers. I used to have /dev/sda and /dev/sdb, but one day I was checking cables (to troubleshoot a motherboard problem) and reconnected them differently, and sda swapped with sdc. So now I use partition labels because I know what they are, because they're short and memorable; however, they're subject to change if I move things around; I've done that. I suggest having a look in /dev/disk to see which identifiers you like.
          Thanks for all your replies and help.
          This file, I think not work for me because you use hdparm, in my case, hdparm only work for 1 of 3 hard drivers that I have. Before install and use hd-idle I try to use hdparm (in the other thread can view this) but only work for 1 of my 3 hard drivers...

          I think your other problem is hd-idle failing. I can't understand that because it's such a simple, short programme. Maybe you might find something in the system logs. systemd can be told to restart a service if it stops, but I don't know how to do that.
          Yes, is the same that I think, its a simple and in 18.04 work fine (like indicate above, in 18.04 I was use 1.04 hd-idle version but I don't think the problem is the version...).

          I investigate more in KSystemLog because in KSystemLog appears after disappear hd-idle service from services...
          I also think, systemd can be told to restart service if it stops, but also, I don't know how made this...

          Thanks and regards!

          Comment


            #6
            In this morning, when I resume my desktop from sleep, hd-idle service was disappears and not work,
            I try with the command that you indicate:
            sudo service hd-idle restart
            And again, was appears hd-idle servide in services runing and spin down my hard drivers.

            I sleep my computer a few hours ago, and I resume a few minutes, again, hd-idle service was disappear and not runing, execute again sudo service hd-idle restart and now, the service not restart and not appear in services runing.
            Also, the hard drivers not spin down.

            The first time that execute sudo service hd-idle restart, work, restart the service, but this second time that I execute, not restart...

            And in KSystemlog appears all well...

            Code:
            26/4/20 20:24	systemd	Started Restart hd-idle.
            26/4/20 20:24	systemd	Stopping hd-idle - spin down idle hard disks...
            26/4/20 20:24	systemd	hd-idle.service: Succeeded.
            26/4/20 20:24	systemd	Stopped hd-idle - spin down idle hard disks.
            26/4/20 20:24	systemd	Starting hd-idle - spin down idle hard disks...
            26/4/20 20:24	systemd	hd-idle-restart-resume.service: Succeeded.
            26/4/20 20:24	systemd	Started hd-idle - spin down idle hard disks.
            26/4/20 20:24	systemd	hd-idle.service: Succeeded.
            26/4/20 20:28	sudo	 ariadna : TTY=pts/1 ; PWD=/home/ariadna ; USER=root ; COMMAND=/usr/sbin/service hd-idle restart
            26/4/20 20:28	systemd	Starting hd-idle - spin down idle hard disks...
            26/4/20 20:28	systemd	Started hd-idle - spin down idle hard disks.
            26/4/20 20:28	systemd	hd-idle.service: Succeeded.
            26/4/20 20:29	sudo	 ariadna : TTY=pts/1 ; PWD=/home/ariadna ; USER=root ; COMMAND=/usr/sbin/service hd-idle restart
            26/4/20 20:29	systemd	Starting hd-idle - spin down idle hard disks...
            26/4/20 20:29	systemd	Started hd-idle - spin down idle hard disks.
            26/4/20 20:29	systemd	hd-idle.service: Succeeded.
            I resume my desktop from sleep at 20:24.

            Don't know what are the problem...

            Comment

            Working...
            X