Request: integrated shutdown timer Topic is solved

Suggestions for features and software you would like to see in DietPi, goes here.
Post Reply
koymoy
Posts: 6
Joined: Fri Jan 10, 2020 9:15 pm

Request: integrated shutdown timer

Post by koymoy »

Would like to have the option of installing an shutdown timer - the easy "dietpi-way" :)
koymoy
Posts: 6
Joined: Fri Jan 10, 2020 9:15 pm

Re: Request: integrated shutdown timer

Post by koymoy »

Has this been seen or is it an absolute no-go?

Br.
Christian
User avatar
MichaIng
Site Admin
Posts: 2334
Joined: Sat Nov 18, 2017 6:21 pm

Re: Request: integrated shutdown timer

Post by MichaIng »

Actually the shutdown commands had a timer function: https://manpages.debian.org/buster/syst ... v/shutdown

But it requires dbus and logind to work:

Code: Select all

systemctl unmask systemd-logind
apt update
apt install libpam-systemd
User avatar
Joulinar
Posts: 2300
Joined: Sat Nov 16, 2019 12:49 am

Re: Request: integrated shutdown timer

Post by Joulinar »

Hi,

I don`t think that this will be realised shortly.

Anyway it's not that complicated. First you would need to install dbus package

Code: Select all

apt-get install dbus
and unmask the the following service

Code: Select all

systemctl unmask systemd-logind.service
Scheduling a shutdown run the command:

Code: Select all

sudo shutdown -P 60
That will wait 60 mins before starting the shutdown sequence.

You could do as well

Code: Select all

sudo shutdown -P 1:00
to shutdown at 1 AM and

Code: Select all

sudo shutdown -P now
to shutdown now.

A message is broadcast to all terminals to warn about the shutdown.

Cancel a pending shutdown, if the time argument is not "+0" or "now", you can use:

Code: Select all

sudo shutdown -c 
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
Joulinar
Posts: 2300
Joined: Sat Nov 16, 2019 12:49 am

Re: Request: integrated shutdown timer

Post by Joulinar »

ahh shit I'm way to slow @MichaIng
But I used dbus and not libpam-systemd. Does that make any differences?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2334
Joined: Sat Nov 18, 2017 6:21 pm

Re: Request: integrated shutdown timer

Post by MichaIng »

libpam-systemd pulls dbus as dependency. I was not sure if dbus is sufficient or systemd-logind (libpam-systemd for full support) required. At least for non-root calls the later is required from what I found.
Post Reply