Comments (2)
@prietus
Innnnnteresting! Thanks for sharing! By default, rguard only blocks poweroff, reboot, and halt targets ... did you have to uncomment hibernate.target
to get this to work for you? E.g.:
def reboot_guard_systemd_refusemanualstart(self, enforce=True, targets=[]):
"""Block/unblock entering targets by way of RefuseManualStart=yes/no."""
if not targets:
targets = [
'poweroff',
'reboot',
'halt',
# 'hibernate',
# 'hybrid-sleep',
# 'suspend',
]
reloadDaemon = False
for t in targets:
t += '.target'
if enforce:
if self.add_systemd_unit_start_block(t):
reloadDaemon = True
else:
if self.del_systemd_unit_start_block(t):
reloadDaemon = True
if reloadDaemon:
logging.debug("Reloading systemd via: systemctl daemon-reload")
if not ret(subprocess.call(['systemctl', 'daemon-reload'])):
logging.error("Unexpected error reloading systemd")
from reboot-guard.
yeah I got hibernate working
from reboot-guard.
Related Issues (11)
- Change "Exiting due to -1 or -0 option" message to INFO loglevel
- Is there a way to log or display a custom message when reboot is blocked ?
- How to continue shutdown process?
- Set a default ExecStart in rguard.service that blocks shutdown HOT 1
- rpm: add systemctl commands to rpm scriptlets like a normal package HOT 1
- rpm: switch arch to x86_64 HOT 1
- ./rguard -0 does not work HOT 4
- Explicitly specify python2 on shebang line
- Session dies when shutdown is blocked HOT 6
- RFE: make work on python2.7 and 3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reboot-guard.