LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-22-2018, 02:26 PM   #1
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
Feature request: Sleep delays with halt/reboot


Pat,

In the rc.d scripts could we do away with the sleep delays when shutting down or reooting? If the delays remain important for edge cases and older hardware, how about defining the delay times in something like /etc/default/sleep-delay?

Thanks.

P.S. Yes, I can manually edit the delays and have done so for many years. Just trying to offer a more elegant solution for all users.

Last edited by upnort; 04-23-2018 at 10:59 AM.
 
Old 04-23-2018, 08:14 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Since you can just add a "0" to the end of a shutdown command to make it do it "now" (which you could also add) I don't see the benefit to the community at large. The reason for the delay isn't just for edge cases - it is to allow time for notification to go out to users and also lets you change your mind and cancel it.
 
Old 04-23-2018, 11:01 AM   #3
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
The request is to make the time periods configurable rather than hard-coded to five seconds.
 
Old 04-23-2018, 02:51 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by upnort View Post
The request is to make the time periods configurable rather than hard-coded to five seconds.
What time period is hard coded to 5 seconds?
 
Old 04-23-2018, 02:58 PM   #5
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by MensaWater View Post
What time period is hard coded to 5 seconds?
The wait times in the Slackware shutdown scripts.
 
Old 04-23-2018, 05:30 PM   #6
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
In rc.K there are three five-second sleep loops. There is a five second delay embedded in $FUSER_DELAY.

In rc.6, $FUSER_DELAY=5, there is /bin/sleep 5 for SIGTERM and PCMCIA, sleep 2 for DHCP, /bin/sleep 3 after running sync.

I am ONLY requesting the delays be configurable by users. The defaults would remain the same.

I suggested /etc/default/sleep-delay. Perhaps a file name of /etc/default/shutdown-delay is more appropriate or just /etc/default/shutdown, which could look something like this:

Code:
FUSER_DELAY=5
PROCESS_HANG_UP_DELAY=5
PROCESS_SIGTERM_DELAY=5
PROCESS_SIGKILL_DELAY=5
PCMCIA_DEACTIVATE_DELAY=5
DHCP_DELAY=2
In rc.K and rc.6, as appropriate, add the following:

Code:
# Default shutdown delay values:
FUSER_DELAY=5
PROCESS_HANG_UP_DELAY=5
PROCESS_SIGTERM_DELAY=5
PROCESS_SIGKILL_DELAY=5
PCMCIA_DEACTIVATE_DELAY=5
DHCP_DELAY=2
# Let users modify the default values:
if [ -r /etc/default/shutdown ]; then
  . /etc/default/shutdown
fi
Rather than for loop in 0 1 2 3 4 5, perhaps something like:

Code:
DELAY=0
while [ $DELAY -lt $PROCESS_HANG_UP_DELAY ]; do
  sleep 1
  echo -n "."
  DELAY=$(($DELAY + 1))
done
 
3 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Halt after several second before wake up after sleep Sweetie Linux - Laptop and Netbook 1 06-25-2013 01:40 PM
Problems with sleep feature on Fedora 14 KDE r2g2btru Linux - Newbie 1 03-02-2011 11:04 PM
Problems with sleep feature on Fedora 14 KDE r2g2btru Linux - Laptop and Netbook 1 01-28-2011 10:22 PM
After halt WOL feature also shuts down:( Sushy Linux - Networking 1 10-31-2005 07:18 AM
halt, shutdown, and reboot HappyDude Linux - Software 29 07-24-2003 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration