From 9436b433df3f10260a4802b51f6259424fb986dc Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 30 Dec 2019 15:45:41 +0100 Subject: options: T1919: check file existance before os.unlink() --- src/conf_mode/system-options.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf_mode/system-options.py b/src/conf_mode/system-options.py index 74c34e19f..a893e98b3 100755 --- a/src/conf_mode/system-options.py +++ b/src/conf_mode/system-options.py @@ -57,7 +57,8 @@ def apply(opt): # Ctrl-Alt-Delete action if opt['ctrl_alt_del'] == 'ignore': - os.unlink('/lib/systemd/system/ctrl-alt-del.target') + if os.path.exists(systemd_ctrl_alt_del): + os.unlink('/lib/systemd/system/ctrl-alt-del.target') elif opt['ctrl_alt_del'] == 'reboot': if os.path.exists(systemd_ctrl_alt_del): -- cgit v1.2.3