LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-21-2022, 05:10 AM   #1
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,501
Blog Entries: 2

Rep: Reputation: 68
Question how to inhibit shutdown ?


Hi there,

It is the 3rd time I do this: Start a borg backup of my home computer at middle of day and at the end of day, as usual, I shutdown the computer, completely forgetting about the running backup.

I wish that exist a way to inhibit shutdown/reboot/poweroff/logout while the backup it is running.

I use borgmatic which has hooks to pre/post phases, so I can hook a command to inhibit and after release the shutdown/reboot/poweroff/logout action.

Is this possible ?

Last edited by marozsas; 12-21-2022 at 05:11 AM.
 
Old 12-21-2022, 05:21 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
man systemd-inhibit
 
Old 12-21-2022, 08:20 AM   #3
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,501

Original Poster
Blog Entries: 2

Rep: Reputation: 68
Smile SOLVED

Yes ! Thank you !

Code:
systemd-inhibit --list
WHO                  UID  USER   PID   COMM            WHAT                                                                                           WHY                                                             MODE 
...
borg backup          0    root   26366 systemd-inhibit shutdown:sleep:idle:handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch borg backup runnning                                            block
...

6 inhibitors listed.
 
Old 12-21-2022, 01:59 PM   #4
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 496

Rep: Reputation: 182Reputation: 182
Quote:
and at the end of day, as usual, I shutdown the computer,
You got to stop doing that . My desktops and server run 24x7. No reason to turn them off (unless going on vacation or something).
 
  


Reply

Tags
inhibit, poweroff, reboot, shutdown



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
seeking HOWTO inhibit screen saver from command-line SaintDanBert Programming 6 01-16-2013 05:09 AM
Inhibit GTK verbose messages when running GTK/Gnome applications from terminal d1s4st3r Linux - Software 1 11-10-2009 10:33 PM
avast inhibit STARTTLS on client MUA hua Linux - Server 1 08-09-2009 11:03 PM
Copy inhibit for RedHat AS 3.0? ssolina Linux - Security 3 05-25-2005 08:35 PM
I need to inhibit outgoing web traffic on the firewall, and leave only Squid, How? mfeoli Linux - Networking 2 02-06-2004 09:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:52 AM.

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